Skip to content

Commit

Permalink
fix(manifest): preserve pure css chunk assets (vitejs#14297)
Browse files Browse the repository at this point in the history
  • Loading branch information
sun0day authored and Gaubee committed Sep 13, 2023
1 parent 283e57c commit b64c8d6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/vite/src/node/plugins/css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -766,11 +766,15 @@ export function cssPostPlugin(config: ResolvedConfig): Plugin {
// chunks instead.
chunk.imports = chunk.imports.filter((file) => {
if (pureCssChunkNames.includes(file)) {
const { importedCss } = (bundle[file] as OutputChunk)
.viteMetadata!
const { importedCss, importedAssets } = (
bundle[file] as OutputChunk
).viteMetadata!
importedCss.forEach((file) =>
chunk.viteMetadata!.importedCss.add(file),
)
importedAssets.forEach((file) =>
chunk.viteMetadata!.importedAssets.add(file),
)
return false
}
return true
Expand Down

0 comments on commit b64c8d6

Please sign in to comment.