@angular-devkit/build-angular 13.0.0 → 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.
- package/package.json +17 -17
- package/src/builders/browser/index.js +0 -4
- package/src/builders/dev-server/index.js +0 -4
- package/src/builders/extract-i18n/index.js +1 -4
- package/src/builders/karma/index.d.ts +2 -2
- package/src/builders/karma/index.js +1 -7
- package/src/builders/server/index.js +1 -7
- package/src/utils/build-options.d.ts +0 -2
- package/src/utils/i18n-inlining.js +18 -2
- package/src/webpack/configs/common.d.ts +2 -2
- package/src/webpack/configs/common.js +127 -156
- package/src/webpack/configs/dev-server.d.ts +2 -2
- package/src/webpack/configs/index.d.ts +0 -6
- package/src/webpack/configs/index.js +0 -6
- package/src/webpack/configs/styles.d.ts +2 -2
- package/src/webpack/plugins/index.d.ts +2 -0
- package/src/webpack/plugins/index.js +5 -1
- package/src/webpack/plugins/json-stats-plugin.d.ts +13 -0
- package/src/webpack/plugins/json-stats-plugin.js +54 -0
- package/src/webpack/{configs/worker.d.ts → plugins/progress-plugin.d.ts} +4 -3
- package/src/webpack/plugins/progress-plugin.js +38 -0
- package/src/webpack/{configs/browser.d.ts → plugins/typescript.d.ts} +2 -2
- package/src/webpack/{configs → plugins}/typescript.js +5 -24
- package/src/webpack/utils/helpers.d.ts +15 -5
- package/src/webpack/utils/helpers.js +160 -34
- package/src/webpack/utils/stats.js +1 -2
- package/src/webpack/configs/browser.js +0 -81
- package/src/webpack/configs/server.d.ts +0 -14
- package/src/webpack/configs/server.js +0 -73
- package/src/webpack/configs/stats.d.ts +0 -38
- package/src/webpack/configs/stats.js +0 -53
- package/src/webpack/configs/test.d.ts +0 -10
- package/src/webpack/configs/test.js +0 -77
- package/src/webpack/configs/typescript.d.ts +0 -12
- package/src/webpack/configs/worker.js +0 -22
|
@@ -1,73 +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.getServerConfig = void 0;
|
|
11
|
-
const path_1 = require("path");
|
|
12
|
-
const webpack_1 = require("webpack");
|
|
13
|
-
const helpers_1 = require("../utils/helpers");
|
|
14
|
-
/**
|
|
15
|
-
* Returns a partial Webpack configuration specific to creating a bundle for node
|
|
16
|
-
* @param wco Options which include the build options and app config
|
|
17
|
-
*/
|
|
18
|
-
function getServerConfig(wco) {
|
|
19
|
-
const { sourceMap, bundleDependencies, externalDependencies = [] } = wco.buildOptions;
|
|
20
|
-
const extraPlugins = [];
|
|
21
|
-
const { scripts, styles, hidden } = sourceMap;
|
|
22
|
-
if (scripts || styles) {
|
|
23
|
-
extraPlugins.push((0, helpers_1.getSourceMapDevTool)(scripts, styles, hidden));
|
|
24
|
-
}
|
|
25
|
-
const externals = [...externalDependencies];
|
|
26
|
-
if (!bundleDependencies) {
|
|
27
|
-
externals.push(({ context, request }, callback) => externalizePackages(context !== null && context !== void 0 ? context : wco.projectRoot, request, callback));
|
|
28
|
-
}
|
|
29
|
-
return {
|
|
30
|
-
resolve: {
|
|
31
|
-
mainFields: ['es2015', 'main', 'module'],
|
|
32
|
-
conditionNames: ['es2015', '...'],
|
|
33
|
-
},
|
|
34
|
-
output: {
|
|
35
|
-
libraryTarget: 'commonjs',
|
|
36
|
-
},
|
|
37
|
-
module: {
|
|
38
|
-
parser: {
|
|
39
|
-
javascript: {
|
|
40
|
-
worker: false,
|
|
41
|
-
url: false,
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
plugins: [
|
|
46
|
-
// Fixes Critical dependency: the request of a dependency is an expression
|
|
47
|
-
new webpack_1.ContextReplacementPlugin(/@?hapi(\\|\/)/),
|
|
48
|
-
new webpack_1.ContextReplacementPlugin(/express(\\|\/)/),
|
|
49
|
-
...extraPlugins,
|
|
50
|
-
],
|
|
51
|
-
node: false,
|
|
52
|
-
externals,
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
exports.getServerConfig = getServerConfig;
|
|
56
|
-
function externalizePackages(context, request, callback) {
|
|
57
|
-
if (!request) {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
// Absolute & Relative paths are not externals
|
|
61
|
-
if (request.startsWith('.') || (0, path_1.isAbsolute)(request)) {
|
|
62
|
-
callback();
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
try {
|
|
66
|
-
require.resolve(request, { paths: [context] });
|
|
67
|
-
callback(undefined, request);
|
|
68
|
-
}
|
|
69
|
-
catch {
|
|
70
|
-
// Node couldn't find it, so it must be user-aliased
|
|
71
|
-
callback();
|
|
72
|
-
}
|
|
73
|
-
}
|
|
@@ -1,38 +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 { WebpackConfigOptions } from '../../utils/build-options';
|
|
9
|
-
export declare function getWebpackStatsConfig(verbose?: boolean): {
|
|
10
|
-
all: boolean;
|
|
11
|
-
colors: boolean;
|
|
12
|
-
hash: boolean;
|
|
13
|
-
timings: boolean;
|
|
14
|
-
chunks: boolean;
|
|
15
|
-
builtAt: boolean;
|
|
16
|
-
warnings: boolean;
|
|
17
|
-
errors: boolean;
|
|
18
|
-
assets: boolean;
|
|
19
|
-
cachedAssets: boolean;
|
|
20
|
-
ids: boolean;
|
|
21
|
-
entrypoints: boolean;
|
|
22
|
-
};
|
|
23
|
-
export declare function getStatsConfig(wco: WebpackConfigOptions): {
|
|
24
|
-
stats: {
|
|
25
|
-
all: boolean;
|
|
26
|
-
colors: boolean;
|
|
27
|
-
hash: boolean;
|
|
28
|
-
timings: boolean;
|
|
29
|
-
chunks: boolean;
|
|
30
|
-
builtAt: boolean;
|
|
31
|
-
warnings: boolean;
|
|
32
|
-
errors: boolean;
|
|
33
|
-
assets: boolean;
|
|
34
|
-
cachedAssets: boolean;
|
|
35
|
-
ids: boolean;
|
|
36
|
-
entrypoints: boolean;
|
|
37
|
-
};
|
|
38
|
-
};
|
|
@@ -1,53 +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.getStatsConfig = exports.getWebpackStatsConfig = void 0;
|
|
11
|
-
const webpackOutputOptions = {
|
|
12
|
-
all: false,
|
|
13
|
-
colors: true,
|
|
14
|
-
hash: true,
|
|
15
|
-
timings: true,
|
|
16
|
-
chunks: true,
|
|
17
|
-
builtAt: true,
|
|
18
|
-
warnings: true,
|
|
19
|
-
errors: true,
|
|
20
|
-
assets: true,
|
|
21
|
-
cachedAssets: true,
|
|
22
|
-
// Needed for markAsyncChunksNonInitial.
|
|
23
|
-
ids: true,
|
|
24
|
-
entrypoints: true,
|
|
25
|
-
};
|
|
26
|
-
const verboseWebpackOutputOptions = {
|
|
27
|
-
// The verbose output will most likely be piped to a file, so colors just mess it up.
|
|
28
|
-
colors: false,
|
|
29
|
-
usedExports: true,
|
|
30
|
-
optimizationBailout: true,
|
|
31
|
-
reasons: true,
|
|
32
|
-
children: true,
|
|
33
|
-
assets: true,
|
|
34
|
-
version: true,
|
|
35
|
-
chunkModules: true,
|
|
36
|
-
errorDetails: true,
|
|
37
|
-
moduleTrace: true,
|
|
38
|
-
logging: 'verbose',
|
|
39
|
-
modulesSpace: Infinity,
|
|
40
|
-
};
|
|
41
|
-
function getWebpackStatsConfig(verbose = false) {
|
|
42
|
-
return verbose
|
|
43
|
-
? { ...webpackOutputOptions, ...verboseWebpackOutputOptions }
|
|
44
|
-
: webpackOutputOptions;
|
|
45
|
-
}
|
|
46
|
-
exports.getWebpackStatsConfig = getWebpackStatsConfig;
|
|
47
|
-
function getStatsConfig(wco) {
|
|
48
|
-
const verbose = !!wco.buildOptions.verbose;
|
|
49
|
-
return {
|
|
50
|
-
stats: getWebpackStatsConfig(verbose),
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
exports.getStatsConfig = getStatsConfig;
|
|
@@ -1,10 +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 * as webpack from 'webpack';
|
|
9
|
-
import { WebpackConfigOptions, WebpackTestOptions } from '../../utils/build-options';
|
|
10
|
-
export declare function getTestConfig(wco: WebpackConfigOptions<WebpackTestOptions>): webpack.Configuration;
|
|
@@ -1,77 +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 path = __importStar(require("path"));
|
|
31
|
-
const typescript_1 = require("typescript");
|
|
32
|
-
const helpers_1 = require("../utils/helpers");
|
|
33
|
-
function getTestConfig(wco) {
|
|
34
|
-
const { buildOptions: { main, sourceMap, webWorkerTsConfig }, root, } = wco;
|
|
35
|
-
const extraPlugins = [];
|
|
36
|
-
if (sourceMap.scripts || sourceMap.styles) {
|
|
37
|
-
extraPlugins.push((0, helpers_1.getSourceMapDevTool)(sourceMap.scripts, sourceMap.styles, false, true));
|
|
38
|
-
}
|
|
39
|
-
return {
|
|
40
|
-
mode: 'development',
|
|
41
|
-
target: wco.tsConfig.options.target === typescript_1.ScriptTarget.ES5 ? ['web', 'es5'] : 'web',
|
|
42
|
-
resolve: {
|
|
43
|
-
mainFields: ['es2020', 'es2015', 'browser', 'module', 'main'],
|
|
44
|
-
conditionNames: ['es2020', 'es2015', '...'],
|
|
45
|
-
},
|
|
46
|
-
devtool: false,
|
|
47
|
-
entry: {
|
|
48
|
-
main: path.resolve(root, main),
|
|
49
|
-
},
|
|
50
|
-
module: {
|
|
51
|
-
parser: webWorkerTsConfig === undefined
|
|
52
|
-
? {
|
|
53
|
-
javascript: {
|
|
54
|
-
worker: false,
|
|
55
|
-
url: false,
|
|
56
|
-
},
|
|
57
|
-
}
|
|
58
|
-
: undefined,
|
|
59
|
-
},
|
|
60
|
-
plugins: extraPlugins,
|
|
61
|
-
optimization: {
|
|
62
|
-
splitChunks: {
|
|
63
|
-
chunks: (chunk) => !(0, helpers_1.isPolyfillsEntry)(chunk.name),
|
|
64
|
-
cacheGroups: {
|
|
65
|
-
vendors: false,
|
|
66
|
-
defaultVendors: {
|
|
67
|
-
name: 'vendor',
|
|
68
|
-
chunks: (chunk) => chunk.name === 'main',
|
|
69
|
-
enforce: true,
|
|
70
|
-
test: /[\\/]node_modules[\\/]/,
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
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;
|