File tree 1 file changed +10
-2
lines changed
packages/angular/build/src/tools/esbuild
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -200,7 +200,11 @@ export function createServerPolyfillBundleOptions(
200
200
return ;
201
201
}
202
202
203
- const jsBanner : string [ ] = [ `globalThis['ngServerMode'] = true;` ] ;
203
+ const jsBanner : string [ ] = [ ] ;
204
+ if ( polyfillBundleOptions . external ?. length ) {
205
+ jsBanner . push ( `globalThis['ngServerMode'] = true;` ) ;
206
+ }
207
+
204
208
if ( isNodePlatform ) {
205
209
// Note: Needed as esbuild does not provide require shims / proxy from ESModules.
206
210
// See: https://github.com/evanw/esbuild/issues/1921.
@@ -394,7 +398,11 @@ export function createSsrEntryCodeBundleOptions(
394
398
const ssrInjectManifestNamespace = 'angular:ssr-entry-inject-manifest' ;
395
399
const isNodePlatform = options . ssrOptions ?. platform !== ExperimentalPlatform . Neutral ;
396
400
397
- const jsBanner : string [ ] = [ `globalThis['ngServerMode'] = true;` ] ;
401
+ const jsBanner : string [ ] = [ ] ;
402
+ if ( options . externalDependencies ?. length ) {
403
+ jsBanner . push ( `globalThis['ngServerMode'] = true;` ) ;
404
+ }
405
+
398
406
if ( isNodePlatform ) {
399
407
// Note: Needed as esbuild does not provide require shims / proxy from ESModules.
400
408
// See: https://github.com/evanw/esbuild/issues/1921.
You can’t perform that action at this time.
0 commit comments