Skip to content

Commit

Permalink
fix: remove empty chunk css imports when using esnext
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewp committed May 26, 2022
1 parent 689adc0 commit 85299c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/vite/src/node/plugins/css.ts
Expand Up @@ -560,7 +560,7 @@ export function cssPostPlugin(config: ResolvedConfig): Plugin {
.replace(/\./g, '\\.')
const emptyChunkRE = new RegExp(
opts.format === 'es' || opts.format === 'system'
? `\\bimport\\s*"[^"]*(?:${emptyChunkFiles})";\n?`
? `\\bimport\\s*["'][^"]*(?:${emptyChunkFiles})["'];\n?`
: `\\brequire\\(\\s*"[^"]*(?:${emptyChunkFiles})"\\);\n?`,
'g'
)
Expand Down

0 comments on commit 85299c2

Please sign in to comment.