@angular/build 18.2.3 → 18.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/build",
3
- "version": "18.2.3",
3
+ "version": "18.2.4",
4
4
  "description": "Official build system for Angular",
5
5
  "keywords": [
6
6
  "Angular CLI",
@@ -23,7 +23,7 @@
23
23
  "builders": "builders.json",
24
24
  "dependencies": {
25
25
  "@ampproject/remapping": "2.3.0",
26
- "@angular-devkit/architect": "0.1802.3",
26
+ "@angular-devkit/architect": "0.1802.4",
27
27
  "@babel/core": "7.25.2",
28
28
  "@babel/helper-annotate-as-pure": "7.24.7",
29
29
  "@babel/helper-split-export-declaration": "7.24.7",
@@ -19,6 +19,10 @@ interface OutputFileRecord {
19
19
  updated: boolean;
20
20
  servable: boolean;
21
21
  }
22
+ interface DevServerExternalResultMetadata extends Omit<ExternalResultMetadata, 'explicit'> {
23
+ explicitBrowser: string[];
24
+ explicitServer: string[];
25
+ }
22
26
  export type BuilderAction = (options: ApplicationBuilderInternalOptions, context: BuilderContext, plugins?: Plugin[]) => AsyncIterable<Result>;
23
27
  export declare function serveWithVite(serverOptions: NormalizedDevServerOptions, builderName: string, builderAction: BuilderAction, context: BuilderContext, transformers?: {
24
28
  indexHtml?: (content: string) => Promise<string>;
@@ -26,6 +30,6 @@ export declare function serveWithVite(serverOptions: NormalizedDevServerOptions,
26
30
  middleware?: Connect.NextHandleFunction[];
27
31
  buildPlugins?: Plugin[];
28
32
  }): AsyncIterableIterator<DevServerBuilderOutput>;
29
- export declare function setupServer(serverOptions: NormalizedDevServerOptions, outputFiles: Map<string, OutputFileRecord>, assets: Map<string, string>, preserveSymlinks: boolean | undefined, externalMetadata: ExternalResultMetadata, ssr: boolean, prebundleTransformer: JavaScriptTransformer, target: string[], zoneless: boolean, prebundleLoaderExtensions: EsbuildLoaderOption | undefined, extensionMiddleware?: Connect.NextHandleFunction[], indexHtmlTransformer?: (content: string) => Promise<string>, thirdPartySourcemaps?: boolean): Promise<InlineConfig>;
33
+ export declare function setupServer(serverOptions: NormalizedDevServerOptions, outputFiles: Map<string, OutputFileRecord>, assets: Map<string, string>, preserveSymlinks: boolean | undefined, externalMetadata: DevServerExternalResultMetadata, ssr: boolean, prebundleTransformer: JavaScriptTransformer, target: string[], zoneless: boolean, prebundleLoaderExtensions: EsbuildLoaderOption | undefined, extensionMiddleware?: Connect.NextHandleFunction[], indexHtmlTransformer?: (content: string) => Promise<string>, thirdPartySourcemaps?: boolean): Promise<InlineConfig>;
30
34
  type EsbuildLoaderOption = Exclude<DepOptimizationConfig['esbuildOptions'], undefined>['loader'];
31
35
  export {};
@@ -107,7 +107,8 @@ async function* serveWithVite(serverOptions, builderName, builderAction, context
107
107
  const externalMetadata = {
108
108
  implicitBrowser: [],
109
109
  implicitServer: [],
110
- explicit: [],
110
+ explicitBrowser: [],
111
+ explicitServer: [],
111
112
  };
112
113
  // Add cleanup logic via a builder teardown.
113
114
  let deferred;
@@ -187,15 +188,18 @@ async function* serveWithVite(serverOptions, builderName, builderAction, context
187
188
  requiresServerRestart = implicitServerFiltered.some((dep) => !previousImplicitServer.has(dep));
188
189
  }
189
190
  // Empty Arrays to avoid growing unlimited with every re-build.
190
- externalMetadata.explicit.length = 0;
191
+ externalMetadata.explicitBrowser.length = 0;
192
+ externalMetadata.explicitServer.length = 0;
191
193
  externalMetadata.implicitServer.length = 0;
192
194
  externalMetadata.implicitBrowser.length = 0;
193
- externalMetadata.explicit.push(...explicit);
195
+ externalMetadata.explicitBrowser.push(...explicit);
196
+ externalMetadata.explicitServer.push(...explicit, ...nodeJsBuiltinModules);
194
197
  externalMetadata.implicitServer.push(...implicitServerFiltered);
195
198
  externalMetadata.implicitBrowser.push(...implicitBrowserFiltered);
196
199
  // The below needs to be sorted as Vite uses these options are part of the hashing invalidation algorithm.
197
200
  // See: https://github.com/vitejs/vite/blob/0873bae0cfe0f0718ad2f5743dd34a17e4ab563d/packages/vite/src/node/optimizer/index.ts#L1203-L1239
198
- externalMetadata.explicit.sort();
201
+ externalMetadata.explicitBrowser.sort();
202
+ externalMetadata.explicitServer.sort();
199
203
  externalMetadata.implicitServer.sort();
200
204
  externalMetadata.implicitBrowser.sort();
201
205
  }
@@ -422,18 +426,18 @@ async function setupServer(serverOptions, outputFiles, assets, preserveSymlinks,
422
426
  },
423
427
  // This is needed when `externalDependencies` is used to prevent Vite load errors.
424
428
  // NOTE: If Vite adds direct support for externals, this can be removed.
425
- preTransformRequests: externalMetadata.explicit.length === 0,
429
+ preTransformRequests: externalMetadata.explicitBrowser.length === 0,
426
430
  },
427
431
  ssr: {
428
432
  // Note: `true` and `/.*/` have different sematics. When true, the `external` option is ignored.
429
433
  noExternal: /.*/,
430
434
  // Exclude any Node.js built in module and provided dependencies (currently build defined externals)
431
- external: externalMetadata.explicit,
435
+ external: externalMetadata.explicitServer,
432
436
  optimizeDeps: getDepOptimizationConfig({
433
437
  // Only enable with caching since it causes prebundle dependencies to be cached
434
438
  disabled: serverOptions.prebundle === false,
435
439
  // Exclude any explicitly defined dependencies (currently build defined externals and node.js built-ins)
436
- exclude: externalMetadata.explicit,
440
+ exclude: externalMetadata.explicitServer,
437
441
  // Include all implict dependencies from the external packages internal option
438
442
  include: externalMetadata.implicitServer,
439
443
  ssr: true,
@@ -452,19 +456,19 @@ async function setupServer(serverOptions, outputFiles, assets, preserveSymlinks,
452
456
  outputFiles,
453
457
  assets,
454
458
  ssr,
455
- external: externalMetadata.explicit,
459
+ external: externalMetadata.explicitBrowser,
456
460
  indexHtmlTransformer,
457
461
  extensionMiddleware,
458
462
  normalizePath,
459
463
  }),
460
- (0, id_prefix_plugin_1.createRemoveIdPrefixPlugin)(externalMetadata.explicit),
464
+ (0, id_prefix_plugin_1.createRemoveIdPrefixPlugin)(externalMetadata.explicitBrowser),
461
465
  ],
462
466
  // Browser only optimizeDeps. (This does not run for SSR dependencies).
463
467
  optimizeDeps: getDepOptimizationConfig({
464
468
  // Only enable with caching since it causes prebundle dependencies to be cached
465
469
  disabled: serverOptions.prebundle === false,
466
470
  // Exclude any explicitly defined dependencies (currently build defined externals)
467
- exclude: externalMetadata.explicit,
471
+ exclude: externalMetadata.explicitBrowser,
468
472
  // Include all implict dependencies from the external packages internal option
469
473
  include: externalMetadata.implicitBrowser,
470
474
  ssr: false,
@@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.normalizeCacheOptions = normalizeCacheOptions;
11
11
  const node_path_1 = require("node:path");
12
12
  /** Version placeholder is replaced during the build process with actual package version */
13
- const VERSION = '18.2.3';
13
+ const VERSION = '18.2.4';
14
14
  function hasCacheMetadata(value) {
15
15
  return (!!value &&
16
16
  typeof value === 'object' &&