Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): increase resilience of babel cach…
Browse files Browse the repository at this point in the history
…e identifier

This provides a default cache identifer to the babel loader that includes all internal options from the customized babel loader.
  • Loading branch information
clydin committed Feb 4, 2021
1 parent 2ef1f62 commit cac973a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,15 @@ export default custom<AngularCustomOptions>(() => {
const options: Record<string, unknown> = {
...baseOptions,
...loaderOptions,
cacheIdentifier: JSON.stringify({
base: loaderOptions.cacheIdentifier,
buildAngular: require('../../package.json').version,
forceAsyncTransformation,
forceES5,
shouldLink,
baseOptions,
loaderOptions,
}),
};

// Skip babel processing if no actions are needed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -535,9 +535,6 @@ export function getCommonConfig(wco: WebpackConfigOptions): Configuration {
loader: require.resolve('../../babel/webpack-loader'),
options: {
cacheDirectory: findCachePath('babel-webpack'),
cacheIdentifier: JSON.stringify({
buildAngular: require('../../../package.json').version,
}),
scriptTarget: wco.scriptTarget,
},
},
Expand Down

0 comments on commit cac973a

Please sign in to comment.