You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Vite depOptimizer doesn't include the assets like css files which are extracted to dist in vite build result. And this cause the build result is different with the result in development.
Just like the example below
import'@luxp/test-vite-deps-optimizer'
And the @luxp/test-vite-deps-optimizer is something like
import './css-in-test-vite-deps-optimizer.css'
Vite doesn't include the css-in-test-vite-deps-optimizer.css in dev mode, but in build result the css content will be extracted to a css file.
Describe the bug
Vite depOptimizer doesn't include the assets like css files which are extracted to
dist
invite build
result. And this cause the build result is different with the result in development.Just like the example below
And the
@luxp/test-vite-deps-optimizer
is something likeVite doesn't include the
css-in-test-vite-deps-optimizer.css
in dev mode, but in build result the css content will be extracted to a css file.Reproduction
Issue can be Reproduction in the repo below.
https://github.com/luxp/vite-deps-optimizer-assets-issue
System Info
vite
version: v0.20.2I guess this issue is related with https://github.com/vitejs/vite/blob/master/src/node/depOptimizer.ts#L229.
The depOptimizer only write the
chunk
to disk and ignore theassets
.Looking forward for help.
The text was updated successfully, but these errors were encountered: