|
| 1 | +diff --git a/node_modules/@angular-devkit/build-angular/node_modules/@angular/build/src/tools/esbuild/application-code-bundle.js b/node_modules/@angular-devkit/build-angular/node_modules/@angular/build/src/tools/esbuild/application-code-bundle.js |
| 2 | +index f6fb661..5e5aabb 100755 |
| 3 | +--- a/node_modules/@angular-devkit/build-angular/node_modules/@angular/build/src/tools/esbuild/application-code-bundle.js |
| 4 | ++++ b/node_modules/@angular-devkit/build-angular/node_modules/@angular/build/src/tools/esbuild/application-code-bundle.js |
| 5 | +@@ -121,7 +121,7 @@ function createServerPolyfillBundleOptions(options, target, sourceFileCache) { |
| 6 | + polyfillsFromConfig.has('@angular/localize/init')) { |
| 7 | + serverPolyfills.push('@angular/localize/init'); |
| 8 | + } |
| 9 | +- serverPolyfills.push('@angular/platform-server/init'); |
| 10 | ++ // serverPolyfills.push('@angular/platform-server/init'); |
| 11 | + const namespace = 'angular:polyfills-server'; |
| 12 | + const polyfillBundleOptions = getEsBuildCommonPolyfillsOptions({ |
| 13 | + ...options, |
| 14 | +@@ -144,8 +144,8 @@ function createServerPolyfillBundleOptions(options, target, sourceFileCache) { |
| 15 | + js: [ |
| 16 | + // Note: Needed as esbuild does not provide require shims / proxy from ESModules. |
| 17 | + // See: https://github.com/evanw/esbuild/issues/1921. |
| 18 | +- `import { createRequire } from 'node:module';`, |
| 19 | +- `globalThis['require'] ??= createRequire(import.meta.url);`, |
| 20 | ++ // `import { createRequire } from 'node:module';`, |
| 21 | ++ // `globalThis['require'] ??= createRequire(import.meta.url);`, |
| 22 | + ].join('\n'), |
| 23 | + }, |
| 24 | + target, |
| 25 | +@@ -197,15 +197,17 @@ function createServerMainCodeBundleOptions(options, target, sourceFileCache) { |
| 26 | + } |
| 27 | + // Mark manifest and polyfills file as external as these are generated by a different bundle step. |
| 28 | + (buildOptions.external ??= []).push(...utils_1.SERVER_GENERATED_EXTERNALS); |
| 29 | +- buildOptions.plugins.push((0, virtual_module_plugin_1.createVirtualModulePlugin)({ |
| 30 | +- namespace: mainServerInjectPolyfillsNamespace, |
| 31 | +- cache: sourceFileCache?.loadResultCache, |
| 32 | +- loadContent: () => ({ |
| 33 | +- contents: `import './polyfills.server.mjs';`, |
| 34 | +- loader: 'js', |
| 35 | +- resolveDir: workspaceRoot, |
| 36 | +- }), |
| 37 | +- }), (0, virtual_module_plugin_1.createVirtualModulePlugin)({ |
| 38 | ++ buildOptions.plugins.push( |
| 39 | ++ // (0, virtual_module_plugin_1.createVirtualModulePlugin)({ |
| 40 | ++ // namespace: mainServerInjectPolyfillsNamespace, |
| 41 | ++ // cache: sourceFileCache?.loadResultCache, |
| 42 | ++ // loadContent: () => ({ |
| 43 | ++ // contents: `import './polyfills.server.mjs';`, |
| 44 | ++ // loader: 'js', |
| 45 | ++ // resolveDir: workspaceRoot, |
| 46 | ++ // }), |
| 47 | ++ // }), |
| 48 | ++ (0, virtual_module_plugin_1.createVirtualModulePlugin)({ |
| 49 | + namespace: mainServerInjectManifestNamespace, |
| 50 | + cache: sourceFileCache?.loadResultCache, |
| 51 | + loadContent: async () => { |
0 commit comments