Skip to content

Commit 0cc056b

Browse files
committed
feat(vite): ensure cli flags are passed
1 parent 77e2516 commit 0cc056b

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

lib/services/bundler/bundler-compiler-service.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -359,14 +359,16 @@ export class BundlerCompilerService
359359
prepareData,
360360
);
361361
const isVite = this.getBundler() === "vite";
362+
const cliArgs = await this.buildEnvCommandLineParams(
363+
envData,
364+
platformData,
365+
projectData,
366+
prepareData,
367+
);
368+
// Note: With Vite, we need `--` to prevent vite cli from erroring on unknown options.
362369
const envParams = isVite
363-
? [`--mode=${platformData.platformNameLowerCase}`]
364-
: await this.buildEnvCommandLineParams(
365-
envData,
366-
platformData,
367-
projectData,
368-
prepareData,
369-
);
370+
? [`--mode=${platformData.platformNameLowerCase}`, "--", ...cliArgs]
371+
: cliArgs;
370372
const additionalNodeArgs =
371373
semver.major(process.version) <= 8 ? ["--harmony"] : [];
372374

0 commit comments

Comments
 (0)