Skip to content

Commit

Permalink
fix: Fixed chunk name
Browse files Browse the repository at this point in the history
  • Loading branch information
seebeen committed Jun 18, 2024
1 parent fb34a79 commit 28be0c3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/services/compile-config.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export class CompileConfig {
plugins: [
new MiniCssExtractPlugin({
filename: ({ chunk }: PathData) =>
this.cssName(chunk?.id?.toString(), bundle, cfg, '[id]'),
this.cssName(chunk?.name, bundle, cfg),
}),
new CssUrlRelativePlugin(),
],
Expand All @@ -157,10 +157,9 @@ export class CompileConfig {
chunkId: string | undefined,
{ name, entry }: BundleConfig,
cfg: WordPackConfig,
fname: string = '[name]',
): string {
const dir = Object.keys(entry).includes(chunkId || '') ? name : 'vendor';

return `${cfg.styles('dist')}/${dir}/${fname}.css`;
return `${cfg.styles('dist')}/${dir}/[name].css`;
}
}

0 comments on commit 28be0c3

Please sign in to comment.