Skip to content

Commit

Permalink
fix: allow css to be written for systemjs output
Browse files Browse the repository at this point in the history
  • Loading branch information
shir0u committed Nov 30, 2021
1 parent 9f1f221 commit 432515a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/vite/src/node/plugins/css.ts
Expand Up @@ -391,7 +391,11 @@ export function cssPostPlugin(config: ResolvedConfig): Plugin {
// this is a shared CSS-only chunk that is empty.
pureCssChunks.add(chunk.fileName)
}
if (opts.format === 'es' || opts.format === 'cjs') {
if (
opts.format === 'es' ||
opts.format === 'cjs' ||
opts.format === 'system'
) {
chunkCSS = await processChunkCSS(chunkCSS, {
inlined: false,
minify: true
Expand Down Expand Up @@ -450,7 +454,7 @@ export function cssPostPlugin(config: ResolvedConfig): Plugin {
.join('|')
.replace(/\./g, '\\.')
const emptyChunkRE = new RegExp(
opts.format === 'es'
opts.format === 'es' || opts.format === 'system'
? `\\bimport\\s*"[^"]*(?:${emptyChunkFiles})";\n?`
: `\\brequire\\(\\s*"[^"]*(?:${emptyChunkFiles})"\\);\n?`,
'g'
Expand Down

0 comments on commit 432515a

Please sign in to comment.