File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
angular_devkit/build_angular/src/tools/webpack/configs
angular/build/src/tools/esbuild Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -507,8 +507,12 @@ export function createSsrEntryCodeBundleOptions(
507507function getEsBuildServerCommonOptions ( options : NormalizedApplicationBuildOptions ) : BuildOptions {
508508 const isNodePlatform = options . ssrOptions ?. platform !== ExperimentalPlatform . Neutral ;
509509
510+ const commonOptons = getEsBuildCommonOptions ( options ) ;
511+ commonOptons . define ??= { } ;
512+ commonOptons . define [ 'ngServerMode' ] = 'true' ;
513+
510514 return {
511- ...getEsBuildCommonOptions ( options ) ,
515+ ...commonOptons ,
512516 platform : isNodePlatform ? 'node' : 'neutral' ,
513517 outExtension : { '.js' : '.mjs' } ,
514518 // Note: `es2015` is needed for RxJS v6. If not specified, `module` would
@@ -587,6 +591,7 @@ function getEsBuildCommonOptions(options: NormalizedApplicationBuildOptions): Bu
587591 // which a constant true value would break.
588592 ...( optimizationOptions . scripts ? { 'ngDevMode' : 'false' } : undefined ) ,
589593 'ngJitMode' : jit ? 'true' : 'false' ,
594+ 'ngServerMode' : 'false' ,
590595 } ,
591596 loader : loaderExtensions ,
592597 footer,
Original file line number Diff line number Diff line change @@ -299,7 +299,10 @@ export async function getCommonConfig(wco: WebpackConfigOptions): Promise<Config
299299 if ( scriptsOptimization ) {
300300 extraMinimizers . push (
301301 new JavaScriptOptimizerPlugin ( {
302- define : buildOptions . aot ? GLOBAL_DEFS_FOR_TERSER_WITH_AOT : GLOBAL_DEFS_FOR_TERSER ,
302+ define : {
303+ ...( buildOptions . aot ? GLOBAL_DEFS_FOR_TERSER_WITH_AOT : GLOBAL_DEFS_FOR_TERSER ) ,
304+ 'ngServerMode' : isPlatformServer ,
305+ } ,
303306 sourcemap : scriptsSourceMap ,
304307 supportedBrowsers : buildOptions . supportedBrowsers ,
305308 keepIdentifierNames : ! allowMangle || isPlatformServer ,
You can’t perform that action at this time.
0 commit comments