8
8
import * as webpack from 'webpack' ;
9
9
import { CommonJsUsageWarnPlugin } from '../../plugins/webpack' ;
10
10
import { WebpackConfigOptions } from '../build-options' ;
11
- import { getSourceMapDevTool , isPolyfillsEntry , normalizeExtraEntryPoints } from './utils' ;
11
+ import { getSourceMapDevTool } from './utils' ;
12
12
13
13
export function getBrowserConfig ( wco : WebpackConfigOptions ) : webpack . Configuration {
14
14
const { buildOptions } = wco ;
@@ -18,7 +18,6 @@ export function getBrowserConfig(wco: WebpackConfigOptions): webpack.Configurati
18
18
extractLicenses,
19
19
vendorChunk,
20
20
commonChunk,
21
- styles,
22
21
allowedCommonJsDependencies,
23
22
} = buildOptions ;
24
23
@@ -57,9 +56,6 @@ export function getBrowserConfig(wco: WebpackConfigOptions): webpack.Configurati
57
56
) ) ;
58
57
}
59
58
60
- const globalStylesBundleNames = normalizeExtraEntryPoints ( styles , 'styles' )
61
- . map ( style => style . bundleName ) ;
62
-
63
59
let crossOriginLoading : 'anonymous' | 'use-credentials' | false = false ;
64
60
if ( subresourceIntegrity && crossOrigin === 'none' ) {
65
61
crossOriginLoading = 'anonymous' ;
@@ -93,17 +89,11 @@ export function getBrowserConfig(wco: WebpackConfigOptions): webpack.Configurati
93
89
priority : 5 ,
94
90
} ,
95
91
vendors : false ,
96
- vendor : ! ! vendorChunk && {
92
+ defaultVendors : ! ! vendorChunk && {
97
93
name : 'vendor' ,
98
- chunks : 'initial ',
94
+ chunks : ( chunk ) => chunk . name === 'main ',
99
95
enforce : true ,
100
- test : ( module : { nameForCondition ?: Function } , chunks : Array < { name : string } > ) => {
101
- const moduleName = module . nameForCondition ? module . nameForCondition ( ) : '' ;
102
-
103
- return / [ \\ / ] n o d e _ m o d u l e s [ \\ / ] / . test ( moduleName )
104
- && ! chunks . some ( ( { name } ) => isPolyfillsEntry ( name )
105
- || globalStylesBundleNames . includes ( name ) ) ;
106
- } ,
96
+ test : / [ \\ / ] n o d e _ m o d u l e s [ \\ / ] / ,
107
97
} ,
108
98
} ,
109
99
} ,
0 commit comments