@angular-devkit/build-angular 15.0.0-next.1 → 15.0.0-next.3

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.
Files changed (75) hide show
  1. package/package.json +15 -17
  2. package/src/babel/presets/application.d.ts +1 -2
  3. package/src/babel/presets/application.js +1 -4
  4. package/src/babel/webpack-loader.js +8 -22
  5. package/src/builders/app-shell/index.js +16 -8
  6. package/src/builders/browser/index.d.ts +1 -1
  7. package/src/builders/browser/index.js +4 -16
  8. package/src/builders/browser/schema.d.ts +6 -2
  9. package/src/builders/browser/schema.json +18 -4
  10. package/src/builders/browser-esbuild/compiler-plugin.d.ts +1 -0
  11. package/src/builders/browser-esbuild/compiler-plugin.js +20 -17
  12. package/src/builders/browser-esbuild/experimental-warnings.js +0 -1
  13. package/src/builders/browser-esbuild/index.js +18 -5
  14. package/src/builders/browser-esbuild/options.js +6 -1
  15. package/src/builders/browser-esbuild/schema.d.ts +8 -6
  16. package/src/builders/browser-esbuild/schema.json +29 -34
  17. package/src/builders/browser-esbuild/stylesheets.d.ts +1 -0
  18. package/src/builders/browser-esbuild/stylesheets.js +1 -0
  19. package/src/builders/extract-i18n/index.js +1 -1
  20. package/src/builders/karma/find-tests-plugin.d.ts +19 -0
  21. package/src/builders/karma/{find-tests.js → find-tests-plugin.js} +49 -5
  22. package/src/builders/karma/index.js +40 -38
  23. package/src/builders/karma/schema.d.ts +7 -3
  24. package/src/builders/karma/schema.json +20 -5
  25. package/src/builders/server/index.d.ts +1 -1
  26. package/src/builders/server/index.js +42 -10
  27. package/src/builders/server/platform-server-exports-loader.d.ts +13 -0
  28. package/src/builders/server/platform-server-exports-loader.js +24 -0
  29. package/src/builders/server/schema.d.ts +0 -5
  30. package/src/builders/server/schema.json +0 -5
  31. package/src/sass/sass-service-legacy.d.ts +51 -0
  32. package/src/sass/sass-service-legacy.js +175 -0
  33. package/src/sass/sass-service.d.ts +6 -9
  34. package/src/sass/sass-service.js +69 -52
  35. package/src/{builders/karma/find-tests.d.ts → sass/worker-legacy.d.ts} +1 -1
  36. package/src/sass/worker-legacy.js +44 -0
  37. package/src/sass/worker.js +64 -14
  38. package/src/utils/build-options.d.ts +2 -4
  39. package/src/utils/environment-options.d.ts +1 -0
  40. package/src/utils/environment-options.js +11 -1
  41. package/src/utils/esbuild-targets.d.ts +12 -0
  42. package/src/utils/esbuild-targets.js +39 -0
  43. package/src/utils/i18n-inlining.d.ts +1 -1
  44. package/src/utils/i18n-inlining.js +3 -4
  45. package/src/utils/normalize-builder-schema.d.ts +3 -2
  46. package/src/utils/normalize-builder-schema.js +5 -4
  47. package/src/utils/normalize-polyfills.d.ts +8 -0
  48. package/src/utils/normalize-polyfills.js +24 -0
  49. package/src/utils/process-bundle.d.ts +0 -1
  50. package/src/utils/process-bundle.js +29 -57
  51. package/src/utils/supported-browsers.d.ts +2 -1
  52. package/src/utils/supported-browsers.js +18 -2
  53. package/src/utils/webpack-browser-config.d.ts +0 -2
  54. package/src/utils/webpack-browser-config.js +2 -8
  55. package/src/utils/webpack-diagnostics.d.ts +1 -1
  56. package/src/utils/webpack-diagnostics.js +2 -3
  57. package/src/webpack/configs/common.js +37 -24
  58. package/src/webpack/configs/dev-server.js +1 -1
  59. package/src/webpack/configs/styles.js +63 -80
  60. package/src/webpack/plugins/any-component-style-budget-checker.js +1 -1
  61. package/src/webpack/plugins/css-optimizer-plugin.d.ts +0 -1
  62. package/src/webpack/plugins/css-optimizer-plugin.js +3 -26
  63. package/src/webpack/plugins/hmr/hmr-loader.d.ts +1 -1
  64. package/src/webpack/plugins/hmr/hmr-loader.js +2 -5
  65. package/src/webpack/plugins/javascript-optimizer-plugin.d.ts +4 -6
  66. package/src/webpack/plugins/javascript-optimizer-plugin.js +7 -16
  67. package/src/webpack/plugins/javascript-optimizer-worker.d.ts +3 -2
  68. package/src/webpack/plugins/javascript-optimizer-worker.js +21 -46
  69. package/src/webpack/plugins/karma/karma.js +4 -5
  70. package/src/webpack/plugins/transfer-size-plugin.js +2 -1
  71. package/src/webpack/plugins/typescript.js +14 -25
  72. package/src/webpack/utils/helpers.d.ts +0 -3
  73. package/src/webpack/utils/helpers.js +1 -36
  74. package/src/webpack/plugins/single-test-transform.d.ts +0 -27
  75. package/src/webpack/plugins/single-test-transform.js +0 -44
@@ -33,12 +33,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
33
33
  return (mod && mod.__esModule) ? mod : { "default": mod };
34
34
  };
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.getMainFieldsAndConditionNames = exports.getStatsOptions = exports.externalizePackages = exports.assetPatterns = exports.globalScriptsByBundleName = exports.getCacheSettings = exports.getInstrumentationExcludedPaths = exports.assetNameTemplateFactory = exports.normalizeExtraEntryPoints = exports.getOutputHashFormat = void 0;
36
+ exports.getStatsOptions = exports.assetPatterns = exports.globalScriptsByBundleName = exports.getCacheSettings = exports.getInstrumentationExcludedPaths = exports.assetNameTemplateFactory = exports.normalizeExtraEntryPoints = exports.getOutputHashFormat = void 0;
37
37
  const crypto_1 = require("crypto");
38
38
  const fs_1 = require("fs");
39
39
  const glob_1 = __importDefault(require("glob"));
40
40
  const path = __importStar(require("path"));
41
- const typescript_1 = require("typescript");
42
41
  const schema_1 = require("../../builders/browser/schema");
43
42
  const package_version_1 = require("../../utils/package-version");
44
43
  function getOutputHashFormat(outputHashing = schema_1.OutputHashing.None, length = 20) {
@@ -232,25 +231,6 @@ function assetPatterns(root, assets) {
232
231
  });
233
232
  }
234
233
  exports.assetPatterns = assetPatterns;
235
- function externalizePackages(context, request, callback) {
236
- if (!request) {
237
- return;
238
- }
239
- // Absolute & Relative paths are not externals
240
- if (request.startsWith('.') || path.isAbsolute(request)) {
241
- callback();
242
- return;
243
- }
244
- try {
245
- require.resolve(request, { paths: [context] });
246
- callback(undefined, request);
247
- }
248
- catch {
249
- // Node couldn't find it, so it must be user-aliased
250
- callback();
251
- }
252
- }
253
- exports.externalizePackages = externalizePackages;
254
234
  function getStatsOptions(verbose = false) {
255
235
  const webpackOutputOptions = {
256
236
  all: false,
@@ -288,18 +268,3 @@ function getStatsOptions(verbose = false) {
288
268
  : webpackOutputOptions;
289
269
  }
290
270
  exports.getStatsOptions = getStatsOptions;
291
- function getMainFieldsAndConditionNames(target, platformServer) {
292
- const mainFields = platformServer
293
- ? ['es2015', 'module', 'main']
294
- : ['es2015', 'browser', 'module', 'main'];
295
- const conditionNames = ['es2015', '...'];
296
- if (target >= typescript_1.ScriptTarget.ES2020) {
297
- mainFields.unshift('es2020');
298
- conditionNames.unshift('es2020');
299
- }
300
- return {
301
- mainFields,
302
- conditionNames,
303
- };
304
- }
305
- exports.getMainFieldsAndConditionNames = getMainFieldsAndConditionNames;
@@ -1,27 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright Google LLC All Rights Reserved.
4
- *
5
- * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
7
- */
8
- import { logging } from '@angular-devkit/core';
9
- export interface SingleTestTransformLoaderOptions {
10
- files?: string[];
11
- logger?: logging.Logger;
12
- }
13
- export declare const SingleTestTransformLoader: string;
14
- /**
15
- * This loader transforms the default test file to only run tests
16
- * for some specs instead of all specs.
17
- * It works by replacing the known content of the auto-generated test file:
18
- * const context = require.context('./', true, /\.spec\.ts$/);
19
- * context.keys().map(context);
20
- * with:
21
- * const context = { keys: () => ({ map: (_a) => { } }) };
22
- * context.keys().map(context);
23
- * So that it does nothing.
24
- * Then it adds import statements for each file in the files options
25
- * array to import them directly, and thus run the tests there.
26
- */
27
- export default function loader(this: import('webpack').LoaderContext<SingleTestTransformLoaderOptions>, source: string): string;
@@ -1,44 +0,0 @@
1
- "use strict";
2
- /**
3
- * @license
4
- * Copyright Google LLC All Rights Reserved.
5
- *
6
- * Use of this source code is governed by an MIT-style license that can be
7
- * found in the LICENSE file at https://angular.io/license
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.SingleTestTransformLoader = void 0;
11
- const core_1 = require("@angular-devkit/core");
12
- const path_1 = require("path");
13
- exports.SingleTestTransformLoader = __filename;
14
- /**
15
- * This loader transforms the default test file to only run tests
16
- * for some specs instead of all specs.
17
- * It works by replacing the known content of the auto-generated test file:
18
- * const context = require.context('./', true, /\.spec\.ts$/);
19
- * context.keys().map(context);
20
- * with:
21
- * const context = { keys: () => ({ map: (_a) => { } }) };
22
- * context.keys().map(context);
23
- * So that it does nothing.
24
- * Then it adds import statements for each file in the files options
25
- * array to import them directly, and thus run the tests there.
26
- */
27
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
28
- function loader(source) {
29
- const { files = [], logger = console } = this.getOptions();
30
- // signal the user that expected content is not present.
31
- if (!source.includes('require.context(')) {
32
- logger.error(core_1.tags.stripIndent `The 'include' option requires that the 'main' file for tests includes the below line:
33
- const context = require.context('./', true, /\.spec\.ts$/);
34
- Arguments passed to require.context are not strict and can be changed.`);
35
- return source;
36
- }
37
- const targettedImports = files
38
- .map((path) => `require('./${path.replace('.' + (0, path_1.extname)(path), '')}');`)
39
- .join('\n');
40
- const mockedRequireContext = 'Object.assign(() => { }, { keys: () => [], resolve: () => undefined });\n';
41
- source = source.replace(/require\.context\(.*/, mockedRequireContext + targettedImports);
42
- return source;
43
- }
44
- exports.default = loader;