Skip to content

Commit

Permalink
fix(@angular/build): always generate a new hash for optimized chunk
Browse files Browse the repository at this point in the history
(cherry picked from commit 1d9db13)
  • Loading branch information
ihsnow authored and dgp1130 committed Oct 7, 2024
1 parent dfd2d5c commit 9b5cfaa
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,7 @@ export async function optimizeChunks(
const result = await bundle.generate({
compact: true,
sourcemap,
chunkFileNames(chunkInfo) {
// Do not add hash to file name if already present
return /-[a-zA-Z0-9]{8}$/.test(chunkInfo.name) ? '[name].js' : '[name]-[hash].js';
},
chunkFileNames: (chunkInfo) => `${chunkInfo.name.replace(/-[a-zA-Z0-9]{8}$/, '')}-[hash].js`,
});
optimizedOutput = result.output;
} catch (e) {
Expand Down

0 comments on commit 9b5cfaa

Please sign in to comment.