Building with esbuild minifier produces the same css twice
See original GitHub issue⚠️ IMPORTANT ⚠️ Please check the following list before proceeding. If you ignore this issue template, your issue will be directly closed.
- Read the docs.
- Use Vite >=2.0. (1.x is no longer supported)
- If the issue is related to 1.x -> 2.0 upgrade, read the Migration Guide first.
Describe the bug
When building with minify: 'esbuild'
, production code has the same CSS twice. One in a js
chunk, and the second one in css
chunk.
Reproduction
- create project with vue-ts template
npm init @vitejs/app esbuild-bug --template vue-ts
- update vite.config.ts as follows:
export default defineConfig({
plugins: [vue()],
build: {
minify: 'esbuild'
}
})
- run
npm run build
- open
/dist/assets/index.[hash].js
- you will see non-minified CSS
- open index.[hash].css
- you will see the same css, but minified
System Info
vite
version: 2.0.1- Operating System: MacOS Big Sur 11.2.1
- Node version: 14.4
- Package manager (npm/yarn/pnpm) and version: 6.14.4
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
API - ESBuild
The build API can take the following options: Simple options: Alias; Bundle; Define; Entry points; External; Format; Inject; Loader; Minify; Outdir; Outfile ...
Read more >Comparing the New Generation of Build Tools - CSS-Tricks
These new tools aren't designed to perform the exact same function ... Using the “minify” and “bundle” options in your esbuild command won't ......
Read more >Some notes on using esbuild - Hacker News
Even if it's the same version and I assume the same link, it will bundle it twice and you can get some pretty...
Read more >Let's talk about esbuild - YouTube
Related Links: esbuild Docs https:// esbuild.github.io/Explain Module Bundlers in 3 Levels of Difficulty https://youtu.be/iOYO2dKBYow00:00 ...
Read more >rollup.js
rollup.config.js (building more than one bundle) export default [ { input: ... It is bad practice to mix default and named exports in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@sheremet-va it’s still no fixed on the latest vite (v2.4.4)
I use a workaround plugin to make
minify: 'esbuild'
work correctlyit happened again after 91eb2a6 🌚