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