befly-vite 1.12.0 → 1.13.0
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.
- package/cli.js +19 -1
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -37,8 +37,26 @@ function resolveViteBinPath() {
|
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
function buildViteArgs(args) {
|
|
41
|
+
if (args.includes("--force")) {
|
|
42
|
+
return args;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const firstArg = args[0];
|
|
46
|
+
|
|
47
|
+
if (firstArg === "build" || firstArg === "preview") {
|
|
48
|
+
return args;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (firstArg === "serve" || firstArg === "dev") {
|
|
52
|
+
return [firstArg, "--force", ...args.slice(1)];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return ["--force", ...args];
|
|
56
|
+
}
|
|
57
|
+
|
|
40
58
|
const viteBinPath = resolveViteBinPath();
|
|
41
|
-
const viteArgs = process.argv.slice(2);
|
|
59
|
+
const viteArgs = buildViteArgs(process.argv.slice(2));
|
|
42
60
|
const bunBinPath = Bun.which("bun") || process.execPath || "bun";
|
|
43
61
|
|
|
44
62
|
const processHandle = Bun.spawn([bunBinPath, "run", viteBinPath, ...viteArgs], {
|