@angular/build 20.0.0-next.1 → 20.0.0-next.2

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": "20.0.0-next.1",
3
+ "version": "20.0.0-next.2",
4
4
  "description": "Official build system for Angular",
5
5
  "keywords": [
6
6
  "Angular CLI",
@@ -23,30 +23,31 @@
23
23
  "builders": "builders.json",
24
24
  "dependencies": {
25
25
  "@ampproject/remapping": "2.3.0",
26
- "@angular-devkit/architect": "0.2000.0-next.1",
26
+ "@angular-devkit/architect": "0.2000.0-next.2",
27
27
  "@babel/core": "7.26.10",
28
28
  "@babel/helper-annotate-as-pure": "7.25.9",
29
29
  "@babel/helper-split-export-declaration": "7.24.7",
30
30
  "@babel/plugin-syntax-import-attributes": "7.26.0",
31
- "@inquirer/confirm": "5.1.7",
31
+ "@inquirer/confirm": "5.1.8",
32
32
  "@vitejs/plugin-basic-ssl": "2.0.0",
33
33
  "beasties": "0.2.0",
34
34
  "browserslist": "^4.23.0",
35
35
  "esbuild": "0.25.1",
36
36
  "https-proxy-agent": "7.0.6",
37
37
  "istanbul-lib-instrument": "6.0.3",
38
+ "jsonc-parser": "3.3.1",
38
39
  "listr2": "8.2.5",
39
40
  "magic-string": "0.30.17",
40
41
  "mrmime": "2.0.1",
41
42
  "parse5-html-rewriting-stream": "7.0.0",
42
43
  "picomatch": "4.0.2",
43
- "piscina": "4.8.0",
44
- "rollup": "4.35.0",
45
- "sass": "1.85.1",
44
+ "piscina": "4.9.2",
45
+ "rollup": "4.36.0",
46
+ "sass": "1.86.0",
46
47
  "semver": "7.7.1",
47
48
  "source-map-support": "0.5.21",
48
49
  "tinyglobby": "0.2.12",
49
- "vite": "6.2.1",
50
+ "vite": "6.2.2",
50
51
  "watchpack": "2.4.2"
51
52
  },
52
53
  "optionalDependencies": {
@@ -58,7 +59,7 @@
58
59
  "@angular/localize": "^20.0.0 || ^20.0.0-next.0",
59
60
  "@angular/platform-server": "^20.0.0 || ^20.0.0-next.0",
60
61
  "@angular/service-worker": "^20.0.0 || ^20.0.0-next.0",
61
- "@angular/ssr": "^20.0.0-next.1",
62
+ "@angular/ssr": "^20.0.0-next.2",
62
63
  "karma": "^6.4.0",
63
64
  "less": "^4.2.0",
64
65
  "ng-packagr": "^20.0.0 || ^20.0.0-next.0",
@@ -350,7 +350,8 @@ async function initializeApplication(options, context, karmaOptions, transforms
350
350
  // Write test files
351
351
  await writeTestFiles(buildOutput.files, buildOptions.outputPath);
352
352
  // We need to add this to the beginning *after* the testing framework has
353
- // prepended its files.
353
+ // prepended its files. The output path is required for each since they are
354
+ // added later in the test process via a plugin.
354
355
  const polyfillsFile = {
355
356
  pattern: `${outputPath}/polyfills.js`,
356
357
  included: true,
@@ -365,28 +366,29 @@ async function initializeApplication(options, context, karmaOptions, transforms
365
366
  type: 'module',
366
367
  watched: false,
367
368
  };
369
+ karmaOptions.basePath = outputPath;
368
370
  karmaOptions.files ??= [];
369
371
  if (options.scripts?.length) {
370
372
  // This should be more granular to support named bundles.
371
373
  // However, it replicates the behavior of the Karma Webpack-based builder.
372
374
  karmaOptions.files.push({
373
- pattern: `${outputPath}/scripts.js`,
375
+ pattern: `scripts.js`,
374
376
  watched: false,
375
377
  type: 'js',
376
378
  });
377
379
  }
378
380
  karmaOptions.files.push(
379
381
  // Serve global setup script.
380
- { pattern: `${outputPath}/${mainName}.js`, type: 'module', watched: false },
382
+ { pattern: `${mainName}.js`, type: 'module', watched: false },
381
383
  // Serve all source maps.
382
- { pattern: `${outputPath}/*.map`, included: false, watched: false },
384
+ { pattern: `*.map`, included: false, watched: false },
383
385
  // These are the test entrypoints.
384
- { pattern: `${outputPath}/spec-*.js`, type: 'module', watched: false });
386
+ { pattern: `spec-*.js`, type: 'module', watched: false });
385
387
  if (hasChunkOrWorkerFiles(buildOutput.files)) {
386
388
  karmaOptions.files.push(
387
389
  // Allow loading of chunk-* files but don't include them all on load.
388
390
  {
389
- pattern: `${outputPath}/{chunk,worker}-*.js`,
391
+ pattern: `{chunk,worker}-*.js`,
390
392
  type: 'module',
391
393
  included: false,
392
394
  watched: false,
@@ -394,7 +396,7 @@ async function initializeApplication(options, context, karmaOptions, transforms
394
396
  }
395
397
  if (options.styles?.length) {
396
398
  // Serve CSS outputs on page load, these are the global styles.
397
- karmaOptions.files.push({ pattern: `${outputPath}/*.css`, type: 'css', watched: false });
399
+ karmaOptions.files.push({ pattern: `*.css`, type: 'css', watched: false });
398
400
  }
399
401
  const parsedKarmaConfig = await karma.config.parseConfig(options.karmaConfig && path.resolve(context.workspaceRoot, options.karmaConfig), transforms.karmaOptions ? transforms.karmaOptions(karmaOptions) : karmaOptions, { promiseConfig: true, throwErrors: true });
400
402
  // Remove the webpack plugin/framework:
@@ -118,6 +118,9 @@ function createAngularCompilerHost(typescript, compilerOptions, hostOptions, pac
118
118
  };
119
119
  host.resourceNameToFileName = function (resourceName, containingFile) {
120
120
  const resolvedPath = node_path_1.default.join(node_path_1.default.dirname(containingFile), resourceName);
121
+ if (!this.fileExists(resolvedPath)) {
122
+ return null;
123
+ }
121
124
  // All resource names that have template file extensions are assumed to be templates
122
125
  // TODO: Update compiler to provide the resource type to avoid extension matching here.
123
126
  if (!hostOptions.externalStylesheets || hasTemplateExtension(resolvedPath)) {
@@ -430,6 +430,7 @@ function getEsBuildCommonOptions(options) {
430
430
  ...(optimizationOptions.scripts ? { 'ngDevMode': 'false' } : undefined),
431
431
  'ngJitMode': jit ? 'true' : 'false',
432
432
  'ngServerMode': 'false',
433
+ 'ngHmrMode': options.templateUpdates ? 'true' : 'false',
433
434
  },
434
435
  loader: loaderExtensions,
435
436
  footer,
@@ -71,7 +71,8 @@ exports.SassStylesheetLanguage = Object.freeze({
71
71
  if (options.containingUrl) {
72
72
  resolveDir = (0, node_path_1.dirname)((0, node_url_1.fileURLToPath)(options.containingUrl));
73
73
  }
74
- const result = await build.resolve(url, {
74
+ const path = url.startsWith('pkg:') ? url.slice(4) : url;
75
+ const result = await build.resolve(path, {
75
76
  kind: 'import-rule',
76
77
  resolveDir,
77
78
  });
@@ -81,8 +82,8 @@ exports.SassStylesheetLanguage = Object.freeze({
81
82
  },
82
83
  });
83
84
  function parsePackageName(url) {
84
- const parts = url.split('/');
85
- const hasScope = parts.length >= 2 && parts[0].startsWith('@');
85
+ const parts = (url.startsWith('pkg:') ? url.slice(4) : url).split('/');
86
+ const hasScope = parts.length >= 2 && parts[0][0] === '@';
86
87
  const [nameOrScope, nameOrFirstPath, ...pathPart] = parts;
87
88
  const packageName = hasScope ? `${nameOrScope}/${nameOrFirstPath}` : nameOrScope;
88
89
  return {
@@ -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 = '20.0.0-next.1';
13
+ const VERSION = '20.0.0-next.2';
14
14
  function hasCacheMetadata(value) {
15
15
  return (!!value &&
16
16
  typeof value === 'object' &&