Skip to content

Commit 1d9db13

Browse files
ihsnowdgp1130
authored andcommitted
fix(@angular/build): always generate a new hash for optimized chunk
1 parent ab6e19e commit 1d9db13

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

packages/angular/build/src/builders/application/chunk-optimizer.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,7 @@ export async function optimizeChunks(
103103
const result = await bundle.generate({
104104
compact: true,
105105
sourcemap,
106-
chunkFileNames(chunkInfo) {
107-
// Do not add hash to file name if already present
108-
return /-[a-zA-Z0-9]{8}$/.test(chunkInfo.name) ? '[name].js' : '[name]-[hash].js';
109-
},
106+
chunkFileNames: (chunkInfo) => `${chunkInfo.name.replace(/-[a-zA-Z0-9]{8}$/, '')}-[hash].js`,
110107
});
111108
optimizedOutput = result.output;
112109
} catch (e) {

0 commit comments

Comments
 (0)