-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Building with esbuild minifier produces the same css twice #2144
Comments
@edison1105 I think producing giant unused variable is a bug. It even contains comments if there are some. As far as I know, Vite uses it's own plugin for esbuild to parse |
I agree, the unused variable should remove. |
Related: #2148 We may remove the |
This is also reproduced in the use of import './style.css'
export function Component() {
return <div>foo</div>
} and bundle contains additional unnecessary css strings |
seems it's already fixed on #3570 |
it happened again after 91eb2a6 🌚 |
Is it fixed? Can we close the issue? |
@sheremet-va it's still no fixed on the latest vite (v2.4.4) I use a workaround plugin to make {
plugins: [
// other plugin
{
name: 'remove-css-in-js',
enforce: 'post',
transform (_, id) {
if (id.endsWith('.scss') || id.endsWith('.css')) {
return ''
}
},
},
],
build: {
minify: 'esbuild',
},
} |
seems it's already fixed on 2.6.0-beta.0 (3e3c203) |
Thanks for the heads up @Dreamacro! |
Describe the bug
When building with
minify: 'esbuild'
, production code has the same CSS twice. One in ajs
chunk, and the second one incss
chunk.Reproduction
npm init @vitejs/app esbuild-bug --template vue-ts
npm run build
/dist/assets/index.[hash].js
System Info
vite
version: 2.0.1The text was updated successfully, but these errors were encountered: