Skip to content

Commit

Permalink
fix: backport remove empty chunk css imports when using esnext (#8345)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewp authored and patak-dev committed Jun 6, 2022
1 parent dfe4307 commit 9fbc1a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/vite/src/node/plugins/css.ts
Expand Up @@ -518,8 +518,8 @@ export function cssPostPlugin(config: ResolvedConfig): Plugin {
.replace(/\./g, '\\.')
const emptyChunkRE = new RegExp(
opts.format === 'es'
? `\\bimport\\s*"[^"]*(?:${emptyChunkFiles})";\n?`
: `\\brequire\\(\\s*"[^"]*(?:${emptyChunkFiles})"\\);\n?`,
? `\\bimport\\s*["'][^"']*(?:${emptyChunkFiles})["'];\n?`
: `\\brequire\\(\\s*["'][^"']*(?:${emptyChunkFiles})["']\\);\n?`,
'g'
)
for (const file in bundle) {
Expand Down

0 comments on commit 9fbc1a9

Please sign in to comment.