@angular-devkit/build-angular 17.1.2 → 17.1.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,15 +1,15 @@
1
1
  {
2
2
  "name": "@angular-devkit/build-angular",
3
- "version": "17.1.2",
3
+ "version": "17.1.4",
4
4
  "description": "Angular Webpack Build Facade",
5
5
  "main": "src/index.js",
6
6
  "typings": "src/index.d.ts",
7
7
  "builders": "builders.json",
8
8
  "dependencies": {
9
9
  "@ampproject/remapping": "2.2.1",
10
- "@angular-devkit/architect": "0.1701.2",
11
- "@angular-devkit/build-webpack": "0.1701.2",
12
- "@angular-devkit/core": "17.1.2",
10
+ "@angular-devkit/architect": "0.1701.4",
11
+ "@angular-devkit/build-webpack": "0.1701.4",
12
+ "@angular-devkit/core": "17.1.4",
13
13
  "@babel/core": "7.23.7",
14
14
  "@babel/generator": "7.23.6",
15
15
  "@babel/helper-annotate-as-pure": "7.22.5",
@@ -20,7 +20,7 @@
20
20
  "@babel/preset-env": "7.23.7",
21
21
  "@babel/runtime": "7.23.7",
22
22
  "@discoveryjs/json-ext": "0.5.7",
23
- "@ngtools/webpack": "17.1.2",
23
+ "@ngtools/webpack": "17.1.4",
24
24
  "@vitejs/plugin-basic-ssl": "1.0.2",
25
25
  "ansi-colors": "4.1.3",
26
26
  "autoprefixer": "10.4.16",
@@ -66,7 +66,6 @@ async function* serveWithVite(serverOptions, builderName, context, transformers,
66
66
  // Avoid bundling and processing the ssr entry-point as this is not used by the dev-server.
67
67
  browserOptions.ssr = true;
68
68
  // https://nodejs.org/api/process.html#processsetsourcemapsenabledval
69
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
70
69
  process.setSourceMapsEnabled(true);
71
70
  }
72
71
  // Set all packages as external to support Vite's prebundle caching
@@ -75,7 +74,7 @@ async function* serveWithVite(serverOptions, builderName, context, transformers,
75
74
  if (serverOptions.servePath === undefined && baseHref !== undefined) {
76
75
  // Remove trailing slash
77
76
  serverOptions.servePath =
78
- baseHref[baseHref.length - 1] === '/' ? baseHref.slice(0, -1) : baseHref;
77
+ baseHref !== './' && baseHref[baseHref.length - 1] === '/' ? baseHref.slice(0, -1) : baseHref;
79
78
  }
80
79
  // The development server currently only supports a single locale when localizing.
81
80
  // This matches the behavior of the Webpack-based development server but could be expanded in the future.
@@ -164,8 +163,9 @@ async function* serveWithVite(serverOptions, builderName, context, transformers,
164
163
  externalMetadata.implicitServer.length = 0;
165
164
  externalMetadata.implicitBrowser.length = 0;
166
165
  externalMetadata.explicit.push(...explicit);
167
- externalMetadata.implicitServer.push(...implicitServer);
168
- externalMetadata.implicitBrowser.push(...implicitBrowser);
166
+ // Remove any absolute URLs (http://, https://, //) to avoid Vite's prebundling from processing them as files
167
+ externalMetadata.implicitServer.push(...implicitServer.filter((value) => !/^(?:https?:)?\/\//.test(value)));
168
+ externalMetadata.implicitBrowser.push(...implicitBrowser.filter((value) => !/^(?:https?:)?\/\//.test(value)));
169
169
  // The below needs to be sorted as Vite uses these options are part of the hashing invalidation algorithm.
170
170
  // See: https://github.com/vitejs/vite/blob/0873bae0cfe0f0718ad2f5743dd34a17e4ab563d/packages/vite/src/node/optimizer/index.ts#L1203-L1239
171
171
  externalMetadata.explicit.sort();
@@ -162,7 +162,7 @@ function createCompilerPlugin(pluginOptions, styleOptions) {
162
162
  });
163
163
  referencedFileTracker.add(containingFile, Object.keys(workerResult.metafile.inputs).map((input) => path.join(build.initialOptions.absWorkingDir ?? '', input)));
164
164
  // Return bundled worker file entry name to be used in the built output
165
- const workerCodeFile = workerResult.outputFiles.find((file) => file.path.endsWith('.js'));
165
+ const workerCodeFile = workerResult.outputFiles.find((file) => /^worker-[A-Z0-9]{8}.[cm]?js$/.test(path.basename(file.path)));
166
166
  (0, node_assert_1.default)(workerCodeFile, 'Web Worker bundled code file should always be present.');
167
167
  const workerCodePath = path.relative(build.initialOptions.outdir ?? '', workerCodeFile.path);
168
168
  return workerCodePath.replaceAll('\\', '/');