Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): use a dash in bundle names
Browse files Browse the repository at this point in the history
This updates the esbuild based builder to use a dash in bundles and media instead of a dot to be consistent with the chunks files `chunk-xxx.js`.
  • Loading branch information
cexbrayat committed Sep 20, 2023
1 parent ca938de commit 55ed9a0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,12 @@ export async function normalizeOptions(
const outputNames = {
bundles:
options.outputHashing === OutputHashing.All || options.outputHashing === OutputHashing.Bundles
? '[name].[hash]'
? '[name]-[hash]'
: '[name]',
media:
'media/' +
(options.outputHashing === OutputHashing.All || options.outputHashing === OutputHashing.Media
? '[name].[hash]'
? '[name]-[hash]'
: '[name]'),
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ export class BundlerContext {
outputFile.path = relativeFilePath;

if (entryPoint) {
// The first part of the filename is the name of file (e.g., "polyfills" for "polyfills.7S5G3MDY.js")
const name = basename(relativeFilePath).split('.', 1)[0];
// The first part of the filename is the name of file (e.g., "polyfills" for "polyfills-7S5G3MDY.js")
const name = basename(relativeFilePath).split('-', 1)[0];
// Entry points are only styles or scripts
const type = extname(relativeFilePath) === '.css' ? 'style' : 'script';

Expand Down

0 comments on commit 55ed9a0

Please sign in to comment.