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

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • packages/vite/src/node/plugins

packages/vite/src/node/plugins/css.ts

Lines changed: 2 additions & 2 deletions
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)