@angular-devkit/build-angular 13.0.0-rc.1 → 13.0.1
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 +21 -21
- package/src/babel/presets/application.d.ts +8 -0
- package/src/babel/presets/application.js +18 -0
- package/src/babel/webpack-loader.d.ts +9 -0
- package/src/babel/webpack-loader.js +15 -24
- package/src/builders/browser/schema.json +1 -1
- package/src/builders/extract-i18n/index.js +10 -10
- package/src/sass/sass-service.js +2 -2
- package/src/sass/worker.js +0 -1
- package/src/utils/action-executor.js +4 -5
- package/src/utils/normalize-optimization.js +2 -4
- package/src/webpack/configs/common.d.ts +2 -2
- package/src/webpack/configs/common.js +8 -2
- package/src/webpack/configs/server.js +2 -1
- package/src/webpack/configs/test.js +1 -22
- package/src/webpack/utils/helpers.d.ts +1 -0
- package/src/webpack/utils/helpers.js +15 -1
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular-devkit/build-angular",
|
|
3
|
-
"version": "13.0.
|
|
3
|
+
"version": "13.0.1",
|
|
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": "1.0.1",
|
|
10
|
-
"@angular-devkit/architect": "0.1300.
|
|
11
|
-
"@angular-devkit/build-webpack": "0.1300.
|
|
12
|
-
"@angular-devkit/core": "13.0.
|
|
10
|
+
"@angular-devkit/architect": "0.1300.1",
|
|
11
|
+
"@angular-devkit/build-webpack": "0.1300.1",
|
|
12
|
+
"@angular-devkit/core": "13.0.1",
|
|
13
13
|
"@babel/core": "7.15.8",
|
|
14
14
|
"@babel/generator": "7.15.8",
|
|
15
15
|
"@babel/helper-annotate-as-pure": "7.15.4",
|
|
@@ -20,42 +20,42 @@
|
|
|
20
20
|
"@babel/runtime": "7.15.4",
|
|
21
21
|
"@babel/template": "7.15.4",
|
|
22
22
|
"@discoveryjs/json-ext": "0.5.5",
|
|
23
|
-
"@
|
|
24
|
-
"@ngtools/webpack": "13.0.0-rc.1",
|
|
23
|
+
"@ngtools/webpack": "13.0.1",
|
|
25
24
|
"ansi-colors": "4.1.1",
|
|
26
|
-
"babel-loader": "8.2.
|
|
25
|
+
"babel-loader": "8.2.3",
|
|
26
|
+
"babel-plugin-istanbul": "6.1.1",
|
|
27
27
|
"browserslist": "^4.9.1",
|
|
28
28
|
"cacache": "15.3.0",
|
|
29
29
|
"caniuse-lite": "^1.0.30001032",
|
|
30
30
|
"circular-dependency-plugin": "5.2.2",
|
|
31
31
|
"copy-webpack-plugin": "9.0.1",
|
|
32
|
-
"core-js": "3.
|
|
33
|
-
"critters": "0.0.
|
|
34
|
-
"css-loader": "6.
|
|
35
|
-
"esbuild-wasm": "0.13.
|
|
32
|
+
"core-js": "3.19.0",
|
|
33
|
+
"critters": "0.0.14",
|
|
34
|
+
"css-loader": "6.5.0",
|
|
35
|
+
"esbuild-wasm": "0.13.12",
|
|
36
36
|
"glob": "7.2.0",
|
|
37
37
|
"https-proxy-agent": "5.0.0",
|
|
38
38
|
"inquirer": "8.2.0",
|
|
39
39
|
"karma-source-map-support": "1.4.0",
|
|
40
40
|
"less": "4.1.2",
|
|
41
|
-
"less-loader": "10.
|
|
41
|
+
"less-loader": "10.2.0",
|
|
42
42
|
"license-webpack-plugin": "3.0.0",
|
|
43
|
-
"loader-utils": "
|
|
44
|
-
"mini-css-extract-plugin": "2.4.
|
|
43
|
+
"loader-utils": "3.0.0",
|
|
44
|
+
"mini-css-extract-plugin": "2.4.3",
|
|
45
45
|
"minimatch": "3.0.4",
|
|
46
|
-
"open": "8.
|
|
46
|
+
"open": "8.4.0",
|
|
47
47
|
"ora": "5.4.1",
|
|
48
48
|
"parse5-html-rewriting-stream": "6.0.1",
|
|
49
49
|
"piscina": "3.1.0",
|
|
50
|
-
"postcss": "8.3.
|
|
50
|
+
"postcss": "8.3.11",
|
|
51
51
|
"postcss-import": "14.0.2",
|
|
52
52
|
"postcss-loader": "6.2.0",
|
|
53
53
|
"postcss-preset-env": "6.7.0",
|
|
54
54
|
"regenerator-runtime": "0.13.9",
|
|
55
55
|
"resolve-url-loader": "4.0.0",
|
|
56
56
|
"rxjs": "6.6.7",
|
|
57
|
-
"sass": "1.43.
|
|
58
|
-
"sass-loader": "12.
|
|
57
|
+
"sass": "1.43.4",
|
|
58
|
+
"sass-loader": "12.3.0",
|
|
59
59
|
"semver": "7.3.5",
|
|
60
60
|
"source-map-loader": "3.0.0",
|
|
61
61
|
"source-map-support": "0.5.20",
|
|
@@ -65,14 +65,14 @@
|
|
|
65
65
|
"text-table": "0.2.0",
|
|
66
66
|
"tree-kill": "1.2.2",
|
|
67
67
|
"tslib": "2.3.1",
|
|
68
|
-
"webpack": "5.
|
|
68
|
+
"webpack": "5.60.0",
|
|
69
69
|
"webpack-dev-middleware": "5.2.1",
|
|
70
|
-
"webpack-dev-server": "4.
|
|
70
|
+
"webpack-dev-server": "4.4.0",
|
|
71
71
|
"webpack-merge": "5.8.0",
|
|
72
72
|
"webpack-subresource-integrity": "5.0.0"
|
|
73
73
|
},
|
|
74
74
|
"optionalDependencies": {
|
|
75
|
-
"esbuild": "0.13.
|
|
75
|
+
"esbuild": "0.13.12"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
78
|
"@angular/compiler-cli": "^13.0.0 || ^13.0.0-next",
|
|
@@ -32,6 +32,14 @@ export interface ApplicationPresetOptions {
|
|
|
32
32
|
};
|
|
33
33
|
forceES5?: boolean;
|
|
34
34
|
forceAsyncTransformation?: boolean;
|
|
35
|
+
instrumentCode?: {
|
|
36
|
+
includedBasePath: string;
|
|
37
|
+
};
|
|
38
|
+
optimize?: {
|
|
39
|
+
looseEnums: boolean;
|
|
40
|
+
pureTopLevel: boolean;
|
|
41
|
+
wrapDecorators: boolean;
|
|
42
|
+
};
|
|
35
43
|
diagnosticReporter?: DiagnosticReporter;
|
|
36
44
|
}
|
|
37
45
|
export default function (api: unknown, options: ApplicationPresetOptions): {
|
|
@@ -145,6 +145,24 @@ function default_1(api, options) {
|
|
|
145
145
|
plugins.push(require('@babel/plugin-transform-async-to-generator').default, require('@babel/plugin-proposal-async-generator-functions').default);
|
|
146
146
|
needRuntimeTransform = true;
|
|
147
147
|
}
|
|
148
|
+
if (options.optimize) {
|
|
149
|
+
if (options.optimize.pureTopLevel) {
|
|
150
|
+
plugins.push(require('../plugins/pure-toplevel-functions').default);
|
|
151
|
+
}
|
|
152
|
+
plugins.push(require('../plugins/elide-angular-metadata').default, [
|
|
153
|
+
require('../plugins/adjust-typescript-enums').default,
|
|
154
|
+
{ loose: options.optimize.looseEnums },
|
|
155
|
+
], [
|
|
156
|
+
require('../plugins/adjust-static-class-members').default,
|
|
157
|
+
{ wrapDecorators: options.optimize.wrapDecorators },
|
|
158
|
+
]);
|
|
159
|
+
}
|
|
160
|
+
if (options.instrumentCode) {
|
|
161
|
+
plugins.push([
|
|
162
|
+
require('babel-plugin-istanbul').default,
|
|
163
|
+
{ inputSourceMap: false, cwd: options.instrumentCode.includedBasePath },
|
|
164
|
+
]);
|
|
165
|
+
}
|
|
148
166
|
if (needRuntimeTransform) {
|
|
149
167
|
// Babel equivalent to TypeScript's `importHelpers` option
|
|
150
168
|
plugins.push([
|
|
@@ -5,5 +5,14 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
|
+
import { ApplicationPresetOptions } from './presets/application';
|
|
9
|
+
interface AngularCustomOptions extends Omit<ApplicationPresetOptions, 'instrumentCode'> {
|
|
10
|
+
instrumentCode?: {
|
|
11
|
+
/** node_modules and test files are always excluded. */
|
|
12
|
+
excludedPaths: Set<String>;
|
|
13
|
+
includedBasePath: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export declare type AngularBabelLoaderOptions = AngularCustomOptions & Record<string, unknown>;
|
|
8
17
|
declare const _default: any;
|
|
9
18
|
export default _default;
|
|
@@ -51,8 +51,9 @@ exports.default = (0, babel_loader_1.custom)(() => {
|
|
|
51
51
|
inputSourceMap: false,
|
|
52
52
|
});
|
|
53
53
|
return {
|
|
54
|
-
async customOptions(
|
|
54
|
+
async customOptions(options, { source }) {
|
|
55
55
|
var _a, _b;
|
|
56
|
+
const { i18n, scriptTarget, aot, optimize, instrumentCode, ...rawOptions } = options;
|
|
56
57
|
// Must process file if plugins are added
|
|
57
58
|
let shouldProcess = Array.isArray(rawOptions.plugins) && rawOptions.plugins.length > 0;
|
|
58
59
|
const customOptions = {
|
|
@@ -60,6 +61,7 @@ exports.default = (0, babel_loader_1.custom)(() => {
|
|
|
60
61
|
forceES5: false,
|
|
61
62
|
angularLinker: undefined,
|
|
62
63
|
i18n: undefined,
|
|
64
|
+
instrumentCode: undefined,
|
|
63
65
|
};
|
|
64
66
|
// Analyze file for linking
|
|
65
67
|
if (await requiresLinking(this.resourcePath, source)) {
|
|
@@ -91,7 +93,7 @@ exports.default = (0, babel_loader_1.custom)(() => {
|
|
|
91
93
|
customOptions.forceAsyncTransformation =
|
|
92
94
|
!/[\\/][_f]?esm2015[\\/]/.test(this.resourcePath) && source.includes('async');
|
|
93
95
|
}
|
|
94
|
-
shouldProcess || (shouldProcess = customOptions.forceAsyncTransformation || customOptions.forceES5);
|
|
96
|
+
shouldProcess || (shouldProcess = customOptions.forceAsyncTransformation || customOptions.forceES5 || false);
|
|
95
97
|
}
|
|
96
98
|
// Analyze for i18n inlining
|
|
97
99
|
if (i18n &&
|
|
@@ -131,6 +133,16 @@ exports.default = (0, babel_loader_1.custom)(() => {
|
|
|
131
133
|
};
|
|
132
134
|
shouldProcess = true;
|
|
133
135
|
}
|
|
136
|
+
if (instrumentCode &&
|
|
137
|
+
!instrumentCode.excludedPaths.has(this.resourcePath) &&
|
|
138
|
+
!/\.(e2e|spec)\.tsx?$|[\\/]node_modules[\\/]/.test(this.resourcePath) &&
|
|
139
|
+
this.resourcePath.startsWith(instrumentCode.includedBasePath)) {
|
|
140
|
+
// `babel-plugin-istanbul` has it's own includes but we do the below so that we avoid running the the loader.
|
|
141
|
+
customOptions.instrumentCode = {
|
|
142
|
+
includedBasePath: instrumentCode.includedBasePath,
|
|
143
|
+
};
|
|
144
|
+
shouldProcess = true;
|
|
145
|
+
}
|
|
134
146
|
// Add provided loader options to default base options
|
|
135
147
|
const loaderOptions = {
|
|
136
148
|
...baseOptions,
|
|
@@ -150,27 +162,12 @@ exports.default = (0, babel_loader_1.custom)(() => {
|
|
|
150
162
|
return { custom: customOptions, loader: loaderOptions };
|
|
151
163
|
},
|
|
152
164
|
config(configuration, { customOptions }) {
|
|
153
|
-
var _a;
|
|
154
|
-
const plugins = (_a = configuration.options.plugins) !== null && _a !== void 0 ? _a : [];
|
|
155
|
-
if (customOptions.optimize) {
|
|
156
|
-
if (customOptions.optimize.pureTopLevel) {
|
|
157
|
-
plugins.push(require('./plugins/pure-toplevel-functions').default);
|
|
158
|
-
}
|
|
159
|
-
plugins.push(require('./plugins/elide-angular-metadata').default, [
|
|
160
|
-
require('./plugins/adjust-typescript-enums').default,
|
|
161
|
-
{ loose: customOptions.optimize.looseEnums },
|
|
162
|
-
], [
|
|
163
|
-
require('./plugins/adjust-static-class-members').default,
|
|
164
|
-
{ wrapDecorators: customOptions.optimize.wrapDecorators },
|
|
165
|
-
]);
|
|
166
|
-
}
|
|
167
165
|
return {
|
|
168
166
|
...configuration.options,
|
|
169
167
|
// Using `false` disables babel from attempting to locate sourcemaps or process any inline maps.
|
|
170
168
|
// The babel types do not include the false option even though it is valid
|
|
171
169
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
172
170
|
inputSourceMap: false,
|
|
173
|
-
plugins,
|
|
174
171
|
presets: [
|
|
175
172
|
...(configuration.options.presets || []),
|
|
176
173
|
[
|
|
@@ -201,13 +198,7 @@ exports.default = (0, babel_loader_1.custom)(() => {
|
|
|
201
198
|
// `@ampproject/remapping` source map objects but both are compatible with Webpack.
|
|
202
199
|
// This method for merging is used because it provides more accurate output
|
|
203
200
|
// and is faster while using less memory.
|
|
204
|
-
result.map =
|
|
205
|
-
// Convert the SourceMap back to simple plain object.
|
|
206
|
-
// This is needed because otherwise code-coverage will fail with `don't know how to turn this value into a node`
|
|
207
|
-
// Which is throw by Babel when it is invoked again from `istanbul-lib-instrument`.
|
|
208
|
-
// https://github.com/babel/babel/blob/780aa48d2a34dc55f556843074b6aed45e7eabeb/packages/babel-types/src/converters/valueToNode.ts#L115-L130
|
|
209
|
-
...(0, remapping_1.default)([result.map, inputSourceMap], () => null),
|
|
210
|
-
};
|
|
201
|
+
result.map = (0, remapping_1.default)([result.map, inputSourceMap], () => null);
|
|
211
202
|
}
|
|
212
203
|
return result;
|
|
213
204
|
},
|
|
@@ -132,6 +132,16 @@ async function execute(options, context, transforms) {
|
|
|
132
132
|
if (!context.target || !context.target.project) {
|
|
133
133
|
throw new Error('The builder requires a target.');
|
|
134
134
|
}
|
|
135
|
+
try {
|
|
136
|
+
require.resolve('@angular/localize');
|
|
137
|
+
}
|
|
138
|
+
catch {
|
|
139
|
+
return {
|
|
140
|
+
success: false,
|
|
141
|
+
error: `i18n extraction requires the '@angular/localize' package.`,
|
|
142
|
+
outputPath: outFile,
|
|
143
|
+
};
|
|
144
|
+
}
|
|
135
145
|
const metadata = await context.getProjectMetadata(context.target);
|
|
136
146
|
const i18n = (0, i18n_options_1.createI18nOptions)(metadata);
|
|
137
147
|
let useLegacyIds = true;
|
|
@@ -196,16 +206,6 @@ async function execute(options, context, transforms) {
|
|
|
196
206
|
});
|
|
197
207
|
return partials;
|
|
198
208
|
});
|
|
199
|
-
try {
|
|
200
|
-
require.resolve('@angular/localize');
|
|
201
|
-
}
|
|
202
|
-
catch {
|
|
203
|
-
return {
|
|
204
|
-
success: false,
|
|
205
|
-
error: `Ivy extraction requires the '@angular/localize' package.`,
|
|
206
|
-
outputPath: outFile,
|
|
207
|
-
};
|
|
208
|
-
}
|
|
209
209
|
// All the localize usages are setup to first try the ESM entry point then fallback to the deep imports.
|
|
210
210
|
// This provides interim compatibility while the framework is transitioned to bundled ESM packages.
|
|
211
211
|
const localizeToolsModule = await (0, load_esm_1.loadEsmModule)('@angular/localize/tools');
|
package/src/sass/sass-service.js
CHANGED
|
@@ -48,9 +48,9 @@ class SassWorkerImplementation {
|
|
|
48
48
|
* @param callback The function to execute when the rendering is complete.
|
|
49
49
|
*/
|
|
50
50
|
render(options, callback) {
|
|
51
|
-
// The `functions` and `importer` options are JavaScript functions that cannot be transferred.
|
|
51
|
+
// The `functions`, `logger` and `importer` options are JavaScript functions that cannot be transferred.
|
|
52
52
|
// If any additional function options are added in the future, they must be excluded as well.
|
|
53
|
-
const { functions, importer, ...serializableOptions } = options;
|
|
53
|
+
const { functions, importer, logger, ...serializableOptions } = options;
|
|
54
54
|
// The CLI's configuration does not use or expose the ability to defined custom Sass functions
|
|
55
55
|
if (functions && Object.keys(functions).length > 0) {
|
|
56
56
|
throw new Error('Sass custom functions are not supported.');
|
package/src/sass/worker.js
CHANGED
|
@@ -25,7 +25,6 @@ worker_threads_1.parentPort.on('message', ({ id, hasImporter, options }) => {
|
|
|
25
25
|
options.importer = function (url, prev) {
|
|
26
26
|
var _a;
|
|
27
27
|
Atomics.store(importerSignal, 0, 0);
|
|
28
|
-
// `this.fromImport` was added in dart-sass in 1.33.0, `@types/sass` doesn't include it yet.
|
|
29
28
|
const { fromImport } = this;
|
|
30
29
|
workerImporterPort.postMessage({ id, url, prev, fromImport });
|
|
31
30
|
Atomics.wait(importerSignal, 0, 0);
|
|
@@ -40,13 +40,12 @@ class BundleActionExecutor {
|
|
|
40
40
|
const executions = new Map();
|
|
41
41
|
for (const action of actions) {
|
|
42
42
|
const execution = executor(action);
|
|
43
|
-
executions.set(execution, execution.then((result) =>
|
|
44
|
-
executions.delete(execution);
|
|
45
|
-
return result;
|
|
46
|
-
}));
|
|
43
|
+
executions.set(execution, execution.then((result) => [execution, result]));
|
|
47
44
|
}
|
|
48
45
|
while (executions.size > 0) {
|
|
49
|
-
|
|
46
|
+
const [execution, result] = await Promise.race(executions.values());
|
|
47
|
+
executions.delete(execution);
|
|
48
|
+
yield result;
|
|
50
49
|
}
|
|
51
50
|
}
|
|
52
51
|
stop() {
|
|
@@ -16,8 +16,7 @@ function normalizeOptimization(optimization = true) {
|
|
|
16
16
|
? optimization.styles
|
|
17
17
|
: {
|
|
18
18
|
minify: !!optimization.styles,
|
|
19
|
-
|
|
20
|
-
inlineCritical: false,
|
|
19
|
+
inlineCritical: !!optimization.styles,
|
|
21
20
|
},
|
|
22
21
|
fonts: typeof optimization.fonts === 'object'
|
|
23
22
|
? optimization.fonts
|
|
@@ -30,8 +29,7 @@ function normalizeOptimization(optimization = true) {
|
|
|
30
29
|
scripts: optimization,
|
|
31
30
|
styles: {
|
|
32
31
|
minify: optimization,
|
|
33
|
-
|
|
34
|
-
inlineCritical: false,
|
|
32
|
+
inlineCritical: optimization,
|
|
35
33
|
},
|
|
36
34
|
fonts: {
|
|
37
35
|
inline: optimization,
|
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
8
|
import { Configuration } from 'webpack';
|
|
9
|
-
import { WebpackConfigOptions } from '../../utils/build-options';
|
|
10
|
-
export declare function getCommonConfig(wco: WebpackConfigOptions): Promise<Configuration>;
|
|
9
|
+
import { WebpackConfigOptions, WebpackTestOptions } from '../../utils/build-options';
|
|
10
|
+
export declare function getCommonConfig(wco: WebpackConfigOptions<WebpackTestOptions>): Promise<Configuration>;
|
|
@@ -47,8 +47,8 @@ const helpers_1 = require("../utils/helpers");
|
|
|
47
47
|
// eslint-disable-next-line max-lines-per-function
|
|
48
48
|
async function getCommonConfig(wco) {
|
|
49
49
|
var _a, _b;
|
|
50
|
-
const { root, projectRoot, buildOptions, tsConfig, projectName } = wco;
|
|
51
|
-
const { cache, platform = 'browser', sourceMap: { styles: stylesSourceMap, scripts: scriptsSourceMap, vendor: vendorSourceMap }, optimization: { styles: stylesOptimization, scripts: scriptsOptimization }, } = buildOptions;
|
|
50
|
+
const { root, projectRoot, buildOptions, tsConfig, projectName, sourceRoot } = wco;
|
|
51
|
+
const { cache, codeCoverage, codeCoverageExclude = [], platform = 'browser', sourceMap: { styles: stylesSourceMap, scripts: scriptsSourceMap, vendor: vendorSourceMap }, optimization: { styles: stylesOptimization, scripts: scriptsOptimization }, } = buildOptions;
|
|
52
52
|
const extraPlugins = [];
|
|
53
53
|
const extraRules = [];
|
|
54
54
|
const entryPoints = {};
|
|
@@ -325,6 +325,12 @@ async function getCommonConfig(wco) {
|
|
|
325
325
|
scriptTarget: wco.scriptTarget,
|
|
326
326
|
aot: buildOptions.aot,
|
|
327
327
|
optimize: buildOptions.buildOptimizer,
|
|
328
|
+
instrumentCode: codeCoverage
|
|
329
|
+
? {
|
|
330
|
+
includedBasePath: sourceRoot,
|
|
331
|
+
excludedPaths: (0, helpers_1.getInstrumentationExcludedPaths)(root, codeCoverageExclude),
|
|
332
|
+
}
|
|
333
|
+
: undefined,
|
|
328
334
|
},
|
|
329
335
|
},
|
|
330
336
|
],
|
|
@@ -27,32 +27,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.getTestConfig = void 0;
|
|
30
|
-
const glob = __importStar(require("glob"));
|
|
31
30
|
const path = __importStar(require("path"));
|
|
32
31
|
const typescript_1 = require("typescript");
|
|
33
32
|
const helpers_1 = require("../utils/helpers");
|
|
34
33
|
function getTestConfig(wco) {
|
|
35
|
-
const { buildOptions: {
|
|
36
|
-
const extraRules = [];
|
|
34
|
+
const { buildOptions: { main, sourceMap, webWorkerTsConfig }, root, } = wco;
|
|
37
35
|
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
36
|
if (sourceMap.scripts || sourceMap.styles) {
|
|
57
37
|
extraPlugins.push((0, helpers_1.getSourceMapDevTool)(sourceMap.scripts, sourceMap.styles, false, true));
|
|
58
38
|
}
|
|
@@ -68,7 +48,6 @@ function getTestConfig(wco) {
|
|
|
68
48
|
main: path.resolve(root, main),
|
|
69
49
|
},
|
|
70
50
|
module: {
|
|
71
|
-
rules: extraRules,
|
|
72
51
|
parser: webWorkerTsConfig === undefined
|
|
73
52
|
? {
|
|
74
53
|
javascript: {
|
|
@@ -20,3 +20,4 @@ export declare function getSourceMapDevTool(scriptsSourceMap: boolean | undefine
|
|
|
20
20
|
export declare function isPolyfillsEntry(name: string): boolean;
|
|
21
21
|
export declare function getWatchOptions(poll: number | undefined): NonNullable<Configuration['watchOptions']>;
|
|
22
22
|
export declare function assetNameTemplateFactory(hashFormat: HashFormat): (resourcePath: string) => string;
|
|
23
|
+
export declare function getInstrumentationExcludedPaths(sourceRoot: string, excludedPaths: string[]): Set<string>;
|
|
@@ -25,8 +25,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
__setModuleDefault(result, mod);
|
|
26
26
|
return result;
|
|
27
27
|
};
|
|
28
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
29
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
|
+
};
|
|
28
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.assetNameTemplateFactory = exports.getWatchOptions = exports.isPolyfillsEntry = exports.getSourceMapDevTool = exports.normalizeExtraEntryPoints = exports.getOutputHashFormat = void 0;
|
|
32
|
+
exports.getInstrumentationExcludedPaths = exports.assetNameTemplateFactory = exports.getWatchOptions = exports.isPolyfillsEntry = exports.getSourceMapDevTool = exports.normalizeExtraEntryPoints = exports.getOutputHashFormat = void 0;
|
|
33
|
+
const glob_1 = __importDefault(require("glob"));
|
|
30
34
|
const path = __importStar(require("path"));
|
|
31
35
|
const webpack_1 = require("webpack");
|
|
32
36
|
function getOutputHashFormat(option, length = 20) {
|
|
@@ -126,3 +130,13 @@ function assetNameTemplateFactory(hashFormat) {
|
|
|
126
130
|
};
|
|
127
131
|
}
|
|
128
132
|
exports.assetNameTemplateFactory = assetNameTemplateFactory;
|
|
133
|
+
function getInstrumentationExcludedPaths(sourceRoot, excludedPaths) {
|
|
134
|
+
const excluded = new Set();
|
|
135
|
+
for (const excludeGlob of excludedPaths) {
|
|
136
|
+
glob_1.default
|
|
137
|
+
.sync(path.join(sourceRoot, excludeGlob), { nodir: true })
|
|
138
|
+
.forEach((p) => excluded.add(path.normalize(p)));
|
|
139
|
+
}
|
|
140
|
+
return excluded;
|
|
141
|
+
}
|
|
142
|
+
exports.getInstrumentationExcludedPaths = getInstrumentationExcludedPaths;
|