Skip to content

Commit

Permalink
breaking: build assets with the entry name when it is an entry point
Browse files Browse the repository at this point in the history
  • Loading branch information
aleen42 committed Jan 4, 2023
1 parent 7d20580 commit 7b7520f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/vite/src/node/plugins/css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -549,9 +549,10 @@ export function cssPostPlugin(config: ResolvedConfig): Plugin {
pureCssChunks.add(chunk)
}
if (opts.format === 'es' || opts.format === 'cjs') {
const cssAssetName = chunk.facadeModuleId
? normalizePath(path.relative(config.root, chunk.facadeModuleId))
: chunk.name
const cssAssetName =
chunk.facadeModuleId && !chunk.isEntry
? normalizePath(path.relative(config.root, chunk.facadeModuleId))
: chunk.name

const lang = path.extname(cssAssetName).slice(1)
const cssFileName = ensureFileExt(cssAssetName, '.css')
Expand Down

0 comments on commit 7b7520f

Please sign in to comment.