File tree 3 files changed +9
-5
lines changed
packages/angular_devkit/build_angular/src/angular-cli-files/models/webpack-configs
3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import * as webpack from 'webpack';
11
11
import { IndexHtmlWebpackPlugin } from '../../plugins/index-html-webpack-plugin' ;
12
12
import { generateEntryPoints } from '../../utilities/package-chunk-sort' ;
13
13
import { WebpackConfigOptions } from '../build-options' ;
14
- import { getSourceMapDevTool , normalizeExtraEntryPoints } from './utils' ;
14
+ import { getSourceMapDevTool , isPolyfillsEntry , normalizeExtraEntryPoints } from './utils' ;
15
15
16
16
const SubresourceIntegrityPlugin = require ( 'webpack-subresource-integrity' ) ;
17
17
@@ -114,7 +114,7 @@ export function getBrowserConfig(wco: WebpackConfigOptions): webpack.Configurati
114
114
const moduleName = module . nameForCondition ? module . nameForCondition ( ) : '' ;
115
115
116
116
return / [ \\ / ] n o d e _ m o d u l e s [ \\ / ] / . test ( moduleName )
117
- && ! chunks . some ( ( { name } ) => name === 'polyfills' || name === 'polyfills-es5'
117
+ && ! chunks . some ( ( { name } ) => isPolyfillsEntry ( name )
118
118
|| globalStylesBundleNames . includes ( name ) ) ;
119
119
} ,
120
120
} ,
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import * as glob from 'glob';
10
10
import * as path from 'path' ;
11
11
import * as webpack from 'webpack' ;
12
12
import { WebpackConfigOptions , WebpackTestOptions } from '../build-options' ;
13
- import { getSourceMapDevTool } from './utils' ;
13
+ import { getSourceMapDevTool , isPolyfillsEntry } from './utils' ;
14
14
15
15
16
16
/**
@@ -85,7 +85,7 @@ export function getTestConfig(
85
85
plugins : extraPlugins ,
86
86
optimization : {
87
87
splitChunks : {
88
- chunks : ( ( chunk : { name : string } ) => chunk . name !== 'polyfills' ) ,
88
+ chunks : ( ( chunk : { name : string } ) => ! isPolyfillsEntry ( chunk . name ) ) ,
89
89
cacheGroups : {
90
90
vendors : false ,
91
91
vendor : {
@@ -95,7 +95,7 @@ export function getTestConfig(
95
95
const moduleName = module . nameForCondition ? module . nameForCondition ( ) : '' ;
96
96
97
97
return / [ \\ / ] n o d e _ m o d u l e s [ \\ / ] / . test ( moduleName )
98
- && ! chunks . some ( ( { name } ) => name === 'polyfills' ) ;
98
+ && ! chunks . some ( ( { name } ) => isPolyfillsEntry ( name ) ) ;
99
99
} ,
100
100
} ,
101
101
} ,
Original file line number Diff line number Diff line change @@ -101,3 +101,7 @@ export function getEsVersionForFileName(
101
101
return scriptTargetOverride && esVersionInFileName ?
102
102
'-' + ScriptTarget [ scriptTargetOverride ] . toLowerCase ( ) : '' ;
103
103
}
104
+
105
+ export function isPolyfillsEntry ( name : string ) {
106
+ return name === 'polyfills' || name === 'polyfills-es5' ;
107
+ }
You can’t perform that action at this time.
0 commit comments