Skip to content

Commit 2b080a2

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. (cherry picked from commit ab5078d)
1 parent ece264f commit 2b080a2

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
@@ -544,9 +544,6 @@ export function getCommonConfig(wco: WebpackConfigOptions): Configuration {
544544
loader: require.resolve('../../babel/webpack-loader'),
545545
options: {
546546
cacheDirectory: findCachePath('babel-webpack'),
547-
cacheIdentifier: JSON.stringify({
548-
buildAngular: require('../../../package.json').version,
549-
}),
550547
scriptTarget: wco.scriptTarget,
551548
},
552549
},

0 commit comments

Comments
 (0)