Skip to content

Commit ab5078d

Browse files
clydinalan-agius4
authored andcommitted
fix(@angular-devkit/build-angular): increase resilience of babel cache identifier
This provides a default cache identifer to the babel loader that includes all internal options from the customized babel loader.
1 parent 3806903 commit ab5078d

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

packages/angular_devkit/build_angular/src/babel/webpack-loader.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,14 @@ export default custom<AngularCustomOptions>(() => {
9898
const options: Record<string, unknown> = {
9999
...baseOptions,
100100
...loaderOptions,
101+
cacheIdentifier: JSON.stringify({
102+
buildAngular: require('../../package.json').version,
103+
forceAsyncTransformation,
104+
forceES5,
105+
shouldLink,
106+
baseOptions,
107+
loaderOptions,
108+
}),
101109
};
102110

103111
// Skip babel processing if no actions are needed

packages/angular_devkit/build_angular/src/webpack/configs/common.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -535,9 +535,6 @@ export function getCommonConfig(wco: WebpackConfigOptions): Configuration {
535535
loader: require.resolve('../../babel/webpack-loader'),
536536
options: {
537537
cacheDirectory: findCachePath('babel-webpack'),
538-
cacheIdentifier: JSON.stringify({
539-
buildAngular: require('../../../package.json').version,
540-
}),
541538
scriptTarget: wco.scriptTarget,
542539
},
543540
},

0 commit comments

Comments
 (0)