Custom environment with webCompatible: true
implying inlineDynamicImports: true
might be surprising
#18233
Open
7 tasks done
Labels
webCompatible: true
implying inlineDynamicImports: true
might be surprising
#18233
Describe the bug
I know it's been discussed that
webCompatible
needs to be a more fine-grained option, but this one confused me a bit, so I'm reporting it here so not to forget.It looks like old
ssr.target: "webworker"
now corresponds toconsumer: "server" + webCompatible: true
, soinlineDynamicImports: true
kicks in even for esm build:vite/packages/vite/src/node/build.ts
Lines 761 to 766 in 95020ab
(Context: I noticed this when I was using
emitFile({ type: "chunk" })
in my web worker example https://github.com/hi-ogawa/vite-environment-examples/tree/main/examples/web-worker but emitted files are not splitas I expected.)Reproduction
https://stackblitz.com/github/hi-ogawa/reproductions/tree/main/vite-environment-inlineDynamicImport?file=vite.config.ts
Steps to reproduce
pnpm build
inlineDynamicImports: false
, then runpnpm build
System Info
(stackblitz) System: OS: Linux 5.0 undefined CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz Memory: 0 Bytes / 0 Bytes Shell: 1.0 - /bin/jsh Binaries: Node: 18.20.3 - /usr/local/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 10.2.3 - /usr/local/bin/npm pnpm: 8.15.6 - /usr/local/bin/pnpm npmPackages: vite: 6.0.0-beta.1 => 6.0.0-beta.1
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: