Skip to content

Commit b3d9652

Browse files
matthewpsapphi-red
andauthored
fix: remove empty chunk css imports when using esnext (#8345)
Co-authored-by: 翠 / green <[email protected]>
1 parent 5a57626 commit b3d9652

File tree

1 file changed

+2
-2
lines changed
  • packages/vite/src/node/plugins

1 file changed

+2
-2
lines changed

Diff for: packages/vite/src/node/plugins/css.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -558,8 +558,8 @@ export function cssPostPlugin(config: ResolvedConfig): Plugin {
558558
.replace(/\./g, '\\.')
559559
const emptyChunkRE = new RegExp(
560560
opts.format === 'es' || opts.format === 'system'
561-
? `\\bimport\\s*"[^"]*(?:${emptyChunkFiles})";\n?`
562-
: `\\brequire\\(\\s*"[^"]*(?:${emptyChunkFiles})"\\);\n?`,
561+
? `\\bimport\\s*["'][^"']*(?:${emptyChunkFiles})["'];\n?`
562+
: `\\brequire\\(\\s*["'][^"']*(?:${emptyChunkFiles})["']\\);\n?`,
563563
'g'
564564
)
565565
for (const file in bundle) {

0 commit comments

Comments
 (0)