@@ -66,42 +66,43 @@ export function getCommonConfig(wco: WebpackConfigOptions): Configuration {
66
66
entryPoints [ 'main' ] = [ path . resolve ( root , buildOptions . main ) ] ;
67
67
}
68
68
69
- const es5Polyfills = path . join ( __dirname , '..' , 'es5-polyfills.js' ) ;
70
- const es5JitPolyfills = path . join ( __dirname , '..' , 'es5-jit-polyfills.js' ) ;
71
-
72
- if ( targetInFileName ) {
73
- // For differential loading we don't need to have 2 polyfill bundles
74
- if ( buildOptions . scriptTargetOverride === ScriptTarget . ES2015 ) {
75
- entryPoints [ 'polyfills' ] = [ path . join ( __dirname , '..' , 'safari-nomodule.js' ) ] ;
76
- } else {
77
- entryPoints [ 'polyfills' ] = [ es5Polyfills ] ;
78
- if ( ! buildOptions . aot ) {
79
- entryPoints [ 'polyfills' ] . push ( es5JitPolyfills ) ;
69
+ if ( wco . buildOptions . platform !== 'server' ) {
70
+ const es5Polyfills = path . join ( __dirname , '..' , 'es5-polyfills.js' ) ;
71
+ const es5JitPolyfills = path . join ( __dirname , '..' , 'es5-jit-polyfills.js' ) ;
72
+ if ( targetInFileName ) {
73
+ // For differential loading we don't need to have 2 polyfill bundles
74
+ if ( buildOptions . scriptTargetOverride === ScriptTarget . ES2015 ) {
75
+ entryPoints [ 'polyfills' ] = [ path . join ( __dirname , '..' , 'safari-nomodule.js' ) ] ;
76
+ } else {
77
+ entryPoints [ 'polyfills' ] = [ es5Polyfills ] ;
78
+ if ( ! buildOptions . aot ) {
79
+ entryPoints [ 'polyfills' ] . push ( es5JitPolyfills ) ;
80
+ }
80
81
}
81
- }
82
- } else {
83
- // For NON differential loading we want to have 2 polyfill bundles
84
- if ( buildOptions . es5BrowserSupport
85
- || ( buildOptions . es5BrowserSupport === undefined && isEs5SupportNeeded ( projectRoot ) ) ) {
86
- entryPoints [ 'polyfills-es5' ] = [ es5Polyfills ] ;
87
- if ( ! buildOptions . aot ) {
88
- entryPoints [ 'polyfills-es5' ] . push ( es5JitPolyfills ) ;
82
+ } else {
83
+ // For NON differential loading we want to have 2 polyfill bundles
84
+ if ( buildOptions . es5BrowserSupport
85
+ || ( buildOptions . es5BrowserSupport === undefined && isEs5SupportNeeded ( projectRoot ) ) ) {
86
+ entryPoints [ 'polyfills-es5' ] = [ es5Polyfills ] ;
87
+ if ( ! buildOptions . aot ) {
88
+ entryPoints [ 'polyfills-es5' ] . push ( es5JitPolyfills ) ;
89
+ }
89
90
}
90
91
}
91
- }
92
92
93
- if ( buildOptions . polyfills ) {
94
- entryPoints [ 'polyfills' ] = [
95
- ...( entryPoints [ 'polyfills' ] || [ ] ) ,
96
- path . resolve ( root , buildOptions . polyfills ) ,
97
- ] ;
98
- }
93
+ if ( buildOptions . polyfills ) {
94
+ entryPoints [ 'polyfills' ] = [
95
+ ...( entryPoints [ 'polyfills' ] || [ ] ) ,
96
+ path . resolve ( root , buildOptions . polyfills ) ,
97
+ ] ;
98
+ }
99
99
100
- if ( ! buildOptions . aot ) {
101
- entryPoints [ 'polyfills' ] = [
102
- ...( entryPoints [ 'polyfills' ] || [ ] ) ,
103
- path . join ( __dirname , '..' , 'jit-polyfills.js' ) ,
104
- ] ;
100
+ if ( ! buildOptions . aot ) {
101
+ entryPoints [ 'polyfills' ] = [
102
+ ...( entryPoints [ 'polyfills' ] || [ ] ) ,
103
+ path . join ( __dirname , '..' , 'jit-polyfills.js' ) ,
104
+ ] ;
105
+ }
105
106
}
106
107
107
108
if ( buildOptions . profile || process . env [ 'NG_BUILD_PROFILING' ] ) {
0 commit comments