@coze-arch/cli 0.0.36-alpha.1dcb49 → 0.0.36-alpha.b293fc
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -4,8 +4,7 @@ import { defineConfig, type Plugin } from "vite";
|
|
|
4
4
|
import serveStatic from "serve-static";
|
|
5
5
|
|
|
6
6
|
const DEV_PHASER_BRIDGE_URL =
|
|
7
|
-
"https://unpkg.byted-static.com/coze-game/phaser-bridge/
|
|
8
|
-
const DEV_IMAGE_DELAY_MS = 200;
|
|
7
|
+
"https://unpkg.byted-static.com/latest/coze-game/phaser-bridge/dist/index.js";
|
|
9
8
|
|
|
10
9
|
function injectDevPhaserBridge(): Plugin {
|
|
11
10
|
return {
|
|
@@ -70,28 +69,6 @@ function copyGameAssets(directory: string): Plugin {
|
|
|
70
69
|
};
|
|
71
70
|
}
|
|
72
71
|
|
|
73
|
-
function delayDevImages(): Plugin {
|
|
74
|
-
return {
|
|
75
|
-
name: "phaser-dev-image-delay",
|
|
76
|
-
configureServer(server) {
|
|
77
|
-
server.middlewares.use((request, _response, next) => {
|
|
78
|
-
const pathname = request.url?.split("?", 1)[0] ?? "";
|
|
79
|
-
const isImageRequest =
|
|
80
|
-
(request.method === "GET" || request.method === "HEAD") &&
|
|
81
|
-
pathname.includes("/assets/image/") &&
|
|
82
|
-
/\.(?:avif|gif|jpe?g|png|webp)$/i.test(pathname);
|
|
83
|
-
|
|
84
|
-
if (!isImageRequest) {
|
|
85
|
-
next();
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
setTimeout(next, DEV_IMAGE_DELAY_MS);
|
|
90
|
-
});
|
|
91
|
-
},
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
|
|
95
72
|
export default defineConfig(() => {
|
|
96
73
|
const isDev = process.env.COZE_PHASER_GAME_ENV === "DEV";
|
|
97
74
|
const assetsDirectory = path.join(import.meta.dirname, "assets");
|
|
@@ -111,7 +88,6 @@ export default defineConfig(() => {
|
|
|
111
88
|
...(isDev
|
|
112
89
|
? [
|
|
113
90
|
injectDevPhaserBridge(),
|
|
114
|
-
delayDevImages(),
|
|
115
91
|
mountDevAssets(assetsDirectory),
|
|
116
92
|
]
|
|
117
93
|
: []),
|
package/lib/cli.js
CHANGED
|
@@ -2107,7 +2107,7 @@ const EventBuilder = {
|
|
|
2107
2107
|
};
|
|
2108
2108
|
|
|
2109
2109
|
var name = "@coze-arch/cli";
|
|
2110
|
-
var version = "0.0.36-alpha.
|
|
2110
|
+
var version = "0.0.36-alpha.b293fc";
|
|
2111
2111
|
var description = "coze coding devtools cli";
|
|
2112
2112
|
var license = "MIT";
|
|
2113
2113
|
var author = "fanwenjie.fe@bytedance.com";
|