@angular-devkit/build-angular 0.1000.4 → 0.1000.8
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 +6 -6
- package/src/angular-cli-files/models/webpack-configs/server.js +1 -1
- package/src/angular-cli-files/plugins/common-js-usage-warn-plugin.js +7 -4
- package/src/angular-cli-files/utilities/stats.js +6 -5
- package/src/browser/index.js +3 -3
- package/src/extract-i18n/index.js +2 -2
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular-devkit/build-angular",
|
|
3
|
-
"version": "0.1000.
|
|
3
|
+
"version": "0.1000.8",
|
|
4
4
|
"description": "Angular Webpack Build Facade",
|
|
5
5
|
"experimental": true,
|
|
6
6
|
"main": "src/index.js",
|
|
7
7
|
"typings": "src/index.d.ts",
|
|
8
8
|
"builders": "builders.json",
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@angular-devkit/architect": "0.1000.
|
|
11
|
-
"@angular-devkit/build-optimizer": "0.1000.
|
|
12
|
-
"@angular-devkit/build-webpack": "0.1000.
|
|
13
|
-
"@angular-devkit/core": "10.0.
|
|
10
|
+
"@angular-devkit/architect": "0.1000.8",
|
|
11
|
+
"@angular-devkit/build-optimizer": "0.1000.8",
|
|
12
|
+
"@angular-devkit/build-webpack": "0.1000.8",
|
|
13
|
+
"@angular-devkit/core": "10.0.8",
|
|
14
14
|
"@babel/core": "7.9.6",
|
|
15
15
|
"@babel/generator": "7.9.6",
|
|
16
16
|
"@babel/plugin-transform-runtime": "7.9.6",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"@babel/runtime": "7.9.6",
|
|
19
19
|
"@babel/template": "7.8.6",
|
|
20
20
|
"@jsdevtools/coverage-istanbul-loader": "3.0.3",
|
|
21
|
-
"@ngtools/webpack": "10.0.
|
|
21
|
+
"@ngtools/webpack": "10.0.8",
|
|
22
22
|
"ajv": "6.12.3",
|
|
23
23
|
"autoprefixer": "9.8.0",
|
|
24
24
|
"babel-loader": "8.1.0",
|
|
@@ -48,7 +48,7 @@ function getServerConfig(wco) {
|
|
|
48
48
|
...externalDependencies,
|
|
49
49
|
(context, request, callback) => {
|
|
50
50
|
// Absolute & Relative paths are not externals
|
|
51
|
-
if (request.startsWith('
|
|
51
|
+
if (request.startsWith('.') || path_1.isAbsolute(request)) {
|
|
52
52
|
callback();
|
|
53
53
|
return;
|
|
54
54
|
}
|
|
@@ -43,12 +43,12 @@ class CommonJsUsageWarnPlugin {
|
|
|
43
43
|
*/
|
|
44
44
|
continue;
|
|
45
45
|
}
|
|
46
|
-
if (this.hasCommonJsDependencies(dependencies
|
|
46
|
+
if (this.hasCommonJsDependencies(dependencies)) {
|
|
47
47
|
// Dependency is CommonsJS or AMD.
|
|
48
48
|
// Check if it's parent issuer is also a CommonJS dependency.
|
|
49
49
|
// In case it is skip as an warning will be show for the parent CommonJS dependency.
|
|
50
50
|
const parentDependencies = (_a = issuer === null || issuer === void 0 ? void 0 : issuer.issuer) === null || _a === void 0 ? void 0 : _a.dependencies;
|
|
51
|
-
if (parentDependencies && this.hasCommonJsDependencies(parentDependencies)) {
|
|
51
|
+
if (parentDependencies && this.hasCommonJsDependencies(parentDependencies, true)) {
|
|
52
52
|
continue;
|
|
53
53
|
}
|
|
54
54
|
// Find the main issuer (entry-point).
|
|
@@ -74,10 +74,10 @@ class CommonJsUsageWarnPlugin {
|
|
|
74
74
|
});
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
|
-
hasCommonJsDependencies(dependencies,
|
|
77
|
+
hasCommonJsDependencies(dependencies, checkParentModules = false) {
|
|
78
78
|
for (const dep of dependencies) {
|
|
79
79
|
if (dep instanceof CommonJsRequireDependency) {
|
|
80
|
-
if (
|
|
80
|
+
if (STYLES_TEMPLATE_URL_REGEXP.test(dep.request)) {
|
|
81
81
|
// Skip in case it's a template or stylesheet
|
|
82
82
|
continue;
|
|
83
83
|
}
|
|
@@ -86,6 +86,9 @@ class CommonJsUsageWarnPlugin {
|
|
|
86
86
|
if (dep instanceof AMDDefineDependency) {
|
|
87
87
|
return true;
|
|
88
88
|
}
|
|
89
|
+
if (checkParentModules && dep.module && this.hasCommonJsDependencies(dep.module.dependencies)) {
|
|
90
|
+
return true;
|
|
91
|
+
}
|
|
89
92
|
}
|
|
90
93
|
return false;
|
|
91
94
|
}
|
|
@@ -70,9 +70,9 @@ function statsToString(json, statsConfig) {
|
|
|
70
70
|
}
|
|
71
71
|
exports.statsToString = statsToString;
|
|
72
72
|
// TODO(#16193): Don't emit this warning in the first place rather than just suppressing it.
|
|
73
|
-
const
|
|
73
|
+
const ERRONEOUS_WARNINGS_FILTER = (warning) => ![
|
|
74
74
|
/multiple assets emit different content.*3rdpartylicenses\.txt/i,
|
|
75
|
-
];
|
|
75
|
+
].some(msg => msg.test(warning));
|
|
76
76
|
function statsWarningsToString(json, statsConfig) {
|
|
77
77
|
const colors = statsConfig.colors;
|
|
78
78
|
const rs = (x) => colors ? reset(x) : x;
|
|
@@ -85,7 +85,7 @@ function statsWarningsToString(json, statsConfig) {
|
|
|
85
85
|
}
|
|
86
86
|
return rs('\n' + warnings
|
|
87
87
|
.map((warning) => `${warning}`)
|
|
88
|
-
.filter(
|
|
88
|
+
.filter(ERRONEOUS_WARNINGS_FILTER)
|
|
89
89
|
.map((warning) => y(`WARNING in ${warning}`))
|
|
90
90
|
.join('\n\n'));
|
|
91
91
|
}
|
|
@@ -107,11 +107,12 @@ function statsErrorsToString(json, statsConfig) {
|
|
|
107
107
|
exports.statsErrorsToString = statsErrorsToString;
|
|
108
108
|
function statsHasErrors(json) {
|
|
109
109
|
var _a;
|
|
110
|
-
return json.errors.length
|
|
110
|
+
return json.errors.length || !!((_a = json.children) === null || _a === void 0 ? void 0 : _a.some((c) => c.errors.length));
|
|
111
111
|
}
|
|
112
112
|
exports.statsHasErrors = statsHasErrors;
|
|
113
113
|
function statsHasWarnings(json) {
|
|
114
114
|
var _a;
|
|
115
|
-
return json.warnings.
|
|
115
|
+
return json.warnings.filter(ERRONEOUS_WARNINGS_FILTER).length ||
|
|
116
|
+
!!((_a = json.children) === null || _a === void 0 ? void 0 : _a.some((c) => c.warnings.filter(ERRONEOUS_WARNINGS_FILTER).length));
|
|
116
117
|
}
|
|
117
118
|
exports.statsHasWarnings = statsHasWarnings;
|
package/src/browser/index.js
CHANGED
|
@@ -45,10 +45,10 @@ function createBrowserLoggingCallback(verbose, logger) {
|
|
|
45
45
|
else {
|
|
46
46
|
logger.info(stats_1.statsToString(json, config.stats));
|
|
47
47
|
}
|
|
48
|
-
if (
|
|
48
|
+
if (stats_1.statsHasWarnings(json)) {
|
|
49
49
|
logger.warn(stats_1.statsWarningsToString(json, config.stats));
|
|
50
50
|
}
|
|
51
|
-
if (
|
|
51
|
+
if (stats_1.statsHasErrors(json)) {
|
|
52
52
|
logger.error(stats_1.statsErrorsToString(json, config.stats));
|
|
53
53
|
}
|
|
54
54
|
};
|
|
@@ -497,7 +497,7 @@ function buildWebpackBrowser(options, context, transforms = {}) {
|
|
|
497
497
|
}
|
|
498
498
|
}
|
|
499
499
|
}
|
|
500
|
-
if (
|
|
500
|
+
if (options.serviceWorker) {
|
|
501
501
|
for (const [locale, outputPath] of outputPaths.entries()) {
|
|
502
502
|
let localeBaseHref;
|
|
503
503
|
if (i18n.locales[locale] && i18n.locales[locale].baseHref !== '') {
|
|
@@ -96,10 +96,10 @@ async function execute(options, context) {
|
|
|
96
96
|
]);
|
|
97
97
|
const logging = (stats, config) => {
|
|
98
98
|
const json = stats.toJson({ errors: true, warnings: true });
|
|
99
|
-
if (
|
|
99
|
+
if (stats_1.statsHasWarnings(json)) {
|
|
100
100
|
context.logger.warn(stats_1.statsWarningsToString(json, config.stats));
|
|
101
101
|
}
|
|
102
|
-
if (
|
|
102
|
+
if (stats_1.statsHasErrors(json)) {
|
|
103
103
|
context.logger.error(stats_1.statsErrorsToString(json, config.stats));
|
|
104
104
|
}
|
|
105
105
|
};
|