diff --git a/docs/guide/backend-integration.md b/docs/guide/backend-integration.md index 5a6cb5ce73a88f..5f3cc938774530 100644 --- a/docs/guide/backend-integration.md +++ b/docs/guide/backend-integration.md @@ -98,6 +98,7 @@ If you need a custom integration, you can follow the steps in this guide to conf - The manifest has a `Record` structure - For entry or dynamic entry chunks, the key is the relative src path from project root. - For non entry chunks, the key is the base name of the generated file prefixed with `_`. + - For the CSS file generated when [`build.cssCodeSplit`](/config/build-options.md#build-csscodesplit) is `false`, the key is `style.css`. - Chunks will contain information on its static and dynamic imports (both are keys that map to the corresponding chunk in the manifest), and also its corresponding CSS and asset files (if any). 4. You can use this file to render links or preload directives with hashed filenames. diff --git a/packages/vite/src/node/plugins/css.ts b/packages/vite/src/node/plugins/css.ts index 3f3e35fb962f49..8c484b54e28e4a 100644 --- a/packages/vite/src/node/plugins/css.ts +++ b/packages/vite/src/node/plugins/css.ts @@ -939,6 +939,9 @@ export function cssPostPlugin(config: ResolvedConfig): Plugin { name: getCssBundleName(), type: 'asset', source: extractedCss, + // this file is an implicit entry point, use `style.css` as the original file name + // this name is also used as a key in the manifest + originalFileName: 'style.css', }) } }