Skip to content

Commit 8638a59

Browse files
authored
fix(css): set moduleType in css-post plugin (#272)
1 parent d6369f3 commit 8638a59

File tree

1 file changed

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

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ export function cssPostPlugin(config: ResolvedConfig): Plugin {
602602
`${modulesCode || 'import.meta.hot.accept()'}`,
603603
`import.meta.hot.prune(() => __vite__removeStyle(__vite__id))`,
604604
].join('\n')
605-
return { code, map: { mappings: '' } }
605+
return { code, map: { mappings: '' }, moduleType: 'js' }
606606
}
607607

608608
// build CSS handling ----------------------------------------------------
@@ -632,6 +632,7 @@ export function cssPostPlugin(config: ResolvedConfig): Plugin {
632632
// avoid the css module from being tree-shaken so that we can retrieve
633633
// it in renderChunk()
634634
moduleSideEffects: modulesCode || inlined ? false : 'no-treeshake',
635+
moduleType: 'js',
635636
}
636637
},
637638
},

0 commit comments

Comments
 (0)