@angular-devkit/build-angular 13.0.0-rc.1 → 13.1.0-next.0

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 (43) hide show
  1. package/package.json +30 -30
  2. package/src/babel/presets/application.d.ts +8 -0
  3. package/src/babel/presets/application.js +18 -0
  4. package/src/babel/webpack-loader.d.ts +9 -0
  5. package/src/babel/webpack-loader.js +15 -24
  6. package/src/builders/browser/index.js +0 -4
  7. package/src/builders/browser/schema.json +1 -1
  8. package/src/builders/dev-server/index.js +0 -4
  9. package/src/builders/extract-i18n/index.js +11 -14
  10. package/src/builders/karma/index.d.ts +2 -2
  11. package/src/builders/karma/index.js +1 -7
  12. package/src/builders/server/index.js +1 -7
  13. package/src/sass/sass-service.js +2 -2
  14. package/src/sass/worker.js +0 -1
  15. package/src/utils/action-executor.js +4 -5
  16. package/src/utils/build-options.d.ts +0 -2
  17. package/src/utils/i18n-inlining.js +18 -2
  18. package/src/utils/normalize-optimization.js +2 -4
  19. package/src/webpack/configs/common.js +133 -156
  20. package/src/webpack/configs/dev-server.d.ts +2 -2
  21. package/src/webpack/configs/index.d.ts +0 -6
  22. package/src/webpack/configs/index.js +0 -6
  23. package/src/webpack/configs/styles.d.ts +2 -2
  24. package/src/webpack/plugins/index.d.ts +2 -0
  25. package/src/webpack/plugins/index.js +5 -1
  26. package/src/webpack/plugins/json-stats-plugin.d.ts +13 -0
  27. package/src/webpack/plugins/json-stats-plugin.js +54 -0
  28. package/src/webpack/{configs/worker.d.ts → plugins/progress-plugin.d.ts} +4 -3
  29. package/src/webpack/plugins/progress-plugin.js +38 -0
  30. package/src/webpack/{configs/browser.d.ts → plugins/typescript.d.ts} +2 -2
  31. package/src/webpack/{configs → plugins}/typescript.js +5 -24
  32. package/src/webpack/utils/helpers.d.ts +16 -5
  33. package/src/webpack/utils/helpers.js +174 -34
  34. package/src/webpack/utils/stats.js +1 -2
  35. package/src/webpack/configs/browser.js +0 -81
  36. package/src/webpack/configs/server.d.ts +0 -14
  37. package/src/webpack/configs/server.js +0 -72
  38. package/src/webpack/configs/stats.d.ts +0 -38
  39. package/src/webpack/configs/stats.js +0 -53
  40. package/src/webpack/configs/test.d.ts +0 -10
  41. package/src/webpack/configs/test.js +0 -98
  42. package/src/webpack/configs/typescript.d.ts +0 -12
  43. package/src/webpack/configs/worker.js +0 -22
@@ -1,98 +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
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
12
- }) : (function(o, m, k, k2) {
13
- if (k2 === undefined) k2 = k;
14
- o[k2] = m[k];
15
- }));
16
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
- Object.defineProperty(o, "default", { enumerable: true, value: v });
18
- }) : function(o, v) {
19
- o["default"] = v;
20
- });
21
- var __importStar = (this && this.__importStar) || function (mod) {
22
- if (mod && mod.__esModule) return mod;
23
- var result = {};
24
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
- __setModuleDefault(result, mod);
26
- return result;
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.getTestConfig = void 0;
30
- const glob = __importStar(require("glob"));
31
- const path = __importStar(require("path"));
32
- const typescript_1 = require("typescript");
33
- const helpers_1 = require("../utils/helpers");
34
- function getTestConfig(wco) {
35
- const { buildOptions: { codeCoverage, codeCoverageExclude, main, sourceMap, webWorkerTsConfig }, root, sourceRoot, } = wco;
36
- const extraRules = [];
37
- const extraPlugins = [];
38
- if (codeCoverage) {
39
- const exclude = [/\.(e2e|spec)\.tsx?$/, /node_modules/];
40
- if (codeCoverageExclude) {
41
- for (const excludeGlob of codeCoverageExclude) {
42
- glob
43
- .sync(path.join(root, excludeGlob), { nodir: true })
44
- .forEach((file) => exclude.push(path.normalize(file)));
45
- }
46
- }
47
- extraRules.push({
48
- test: /\.[cm]?[tj]sx?$/,
49
- loader: require.resolve('@jsdevtools/coverage-istanbul-loader'),
50
- options: { esModules: true },
51
- enforce: 'post',
52
- exclude,
53
- include: sourceRoot,
54
- });
55
- }
56
- if (sourceMap.scripts || sourceMap.styles) {
57
- extraPlugins.push((0, helpers_1.getSourceMapDevTool)(sourceMap.scripts, sourceMap.styles, false, true));
58
- }
59
- return {
60
- mode: 'development',
61
- target: wco.tsConfig.options.target === typescript_1.ScriptTarget.ES5 ? ['web', 'es5'] : 'web',
62
- resolve: {
63
- mainFields: ['es2020', 'es2015', 'browser', 'module', 'main'],
64
- conditionNames: ['es2020', 'es2015', '...'],
65
- },
66
- devtool: false,
67
- entry: {
68
- main: path.resolve(root, main),
69
- },
70
- module: {
71
- rules: extraRules,
72
- parser: webWorkerTsConfig === undefined
73
- ? {
74
- javascript: {
75
- worker: false,
76
- url: false,
77
- },
78
- }
79
- : undefined,
80
- },
81
- plugins: extraPlugins,
82
- optimization: {
83
- splitChunks: {
84
- chunks: (chunk) => !(0, helpers_1.isPolyfillsEntry)(chunk.name),
85
- cacheGroups: {
86
- vendors: false,
87
- defaultVendors: {
88
- name: 'vendor',
89
- chunks: (chunk) => chunk.name === 'main',
90
- enforce: true,
91
- test: /[\\/]node_modules[\\/]/,
92
- },
93
- },
94
- },
95
- },
96
- };
97
- }
98
- exports.getTestConfig = getTestConfig;
@@ -1,12 +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 { AngularWebpackPlugin } from '@ngtools/webpack';
9
- import { Configuration } from 'webpack';
10
- import { WebpackConfigOptions } from '../../utils/build-options';
11
- export declare function getTypeScriptConfig(wco: WebpackConfigOptions): Configuration;
12
- export declare function getTypescriptWorkerPlugin(wco: WebpackConfigOptions, workerTsConfigPath: string): AngularWebpackPlugin;
@@ -1,22 +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.getWorkerConfig = void 0;
11
- const path_1 = require("path");
12
- const typescript_1 = require("./typescript");
13
- function getWorkerConfig(wco) {
14
- const { webWorkerTsConfig } = wco.buildOptions;
15
- if (!webWorkerTsConfig) {
16
- return {};
17
- }
18
- return {
19
- plugins: [(0, typescript_1.getTypescriptWorkerPlugin)(wco, (0, path_1.resolve)(wco.root, webWorkerTsConfig))],
20
- };
21
- }
22
- exports.getWorkerConfig = getWorkerConfig;