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 committed Sep 10, 2023
1 parent 6ffe070 commit 4bf31e5
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 @@ -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 4bf31e5

Please sign in to comment.