Skip to content

Commit

Permalink
fix(manifest): preserve pure css chunk assets (#14297)
Browse files Browse the repository at this point in the history
  • Loading branch information
sun0day authored and bluwy committed Oct 3, 2023
1 parent d334b3d commit 3d63ae6
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 @@ -769,11 +769,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 3d63ae6

Please sign in to comment.