Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vite depOptimizer doesn't include the assets files #337

Closed
luxp opened this issue Jun 3, 2020 · 1 comment
Closed

Vite depOptimizer doesn't include the assets files #337

luxp opened this issue Jun 3, 2020 · 1 comment

Comments

@luxp
Copy link

luxp commented Jun 3, 2020

Describe the bug

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.

Reproduction

Issue can be Reproduction in the repo below.
https://github.com/luxp/vite-deps-optimizer-assets-issue

System Info

  • required vite version: v0.20.2
  • required Operating System: MacOS 10.15.4
  • required Node version: v13.10.1

I 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 the assets.

Looking forward for help.

@luxp
Copy link
Author

luxp commented Jun 5, 2020

Cool, it works perfectly now. Thanks!

@github-actions github-actions bot locked and limited conversation to collaborators Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant