Skip to content

Commit 3d63ae6

Browse files
sun0daybluwy
authored andcommitted
fix(manifest): preserve pure css chunk assets (#14297)
1 parent d334b3d commit 3d63ae6

File tree

1 file changed

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

1 file changed

+6
-2
lines changed

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

+6-2
Original file line numberDiff line numberDiff line change
@@ -769,11 +769,15 @@ export function cssPostPlugin(config: ResolvedConfig): Plugin {
769769
// chunks instead.
770770
chunk.imports = chunk.imports.filter((file) => {
771771
if (pureCssChunkNames.includes(file)) {
772-
const { importedCss } = (bundle[file] as OutputChunk)
773-
.viteMetadata!
772+
const { importedCss, importedAssets } = (
773+
bundle[file] as OutputChunk
774+
).viteMetadata!
774775
importedCss.forEach((file) =>
775776
chunk.viteMetadata!.importedCss.add(file),
776777
)
778+
importedAssets.forEach((file) =>
779+
chunk.viteMetadata!.importedAssets.add(file),
780+
)
777781
return false
778782
}
779783
return true

0 commit comments

Comments
 (0)