@angular-devkit/build-angular 14.0.4 → 14.0.5
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 +5 -5
- package/src/builders/app-shell/index.js +1 -1
- package/src/builders/browser/index.d.ts +1 -1
- package/src/builders/browser/index.js +5 -7
- package/src/builders/browser-esbuild/index.js +5 -1
- package/src/builders/browser-esbuild/stylesheets.d.ts +1 -1
- package/src/builders/karma/find-tests.js +2 -0
- package/src/utils/copy-assets.js +5 -4
- package/src/webpack/plugins/common-js-usage-warn-plugin.js +6 -1
- package/src/webpack/utils/helpers.d.ts +1 -1
- package/src/webpack/utils/helpers.js +3 -3
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular-devkit/build-angular",
|
|
3
|
-
"version": "14.0.
|
|
3
|
+
"version": "14.0.5",
|
|
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": "2.2.0",
|
|
10
|
-
"@angular-devkit/architect": "0.1400.
|
|
11
|
-
"@angular-devkit/build-webpack": "0.1400.
|
|
12
|
-
"@angular-devkit/core": "14.0.
|
|
10
|
+
"@angular-devkit/architect": "0.1400.5",
|
|
11
|
+
"@angular-devkit/build-webpack": "0.1400.5",
|
|
12
|
+
"@angular-devkit/core": "14.0.5",
|
|
13
13
|
"@babel/core": "7.17.10",
|
|
14
14
|
"@babel/generator": "7.17.10",
|
|
15
15
|
"@babel/helper-annotate-as-pure": "7.16.7",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"@babel/runtime": "7.17.9",
|
|
21
21
|
"@babel/template": "7.16.7",
|
|
22
22
|
"@discoveryjs/json-ext": "0.5.7",
|
|
23
|
-
"@ngtools/webpack": "14.0.
|
|
23
|
+
"@ngtools/webpack": "14.0.5",
|
|
24
24
|
"ansi-colors": "4.1.1",
|
|
25
25
|
"babel-loader": "8.2.5",
|
|
26
26
|
"babel-plugin-istanbul": "6.1.1",
|
|
@@ -95,7 +95,7 @@ async function _renderUniversal(options, context, browserResult, serverResult, s
|
|
|
95
95
|
}
|
|
96
96
|
await fs.promises.writeFile(outputIndexPath, html);
|
|
97
97
|
if (browserOptions.serviceWorker) {
|
|
98
|
-
await (0, service_worker_1.augmentAppWithServiceWorker)(projectRoot, root, outputPath, baseHref, browserOptions.ngswConfigPath);
|
|
98
|
+
await (0, service_worker_1.augmentAppWithServiceWorker)(projectRoot, root, outputPath, baseHref !== null && baseHref !== void 0 ? baseHref : '/', browserOptions.ngswConfigPath);
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
return browserResult;
|
|
@@ -117,9 +117,7 @@ function buildWebpackBrowser(options, context, transforms = {}) {
|
|
|
117
117
|
}), (0, operators_1.switchMap)(
|
|
118
118
|
// eslint-disable-next-line max-lines-per-function
|
|
119
119
|
({ config, projectRoot, projectSourceRoot, i18n, target, cacheOptions }) => {
|
|
120
|
-
var _a;
|
|
121
120
|
const normalizedOptimization = (0, utils_1.normalizeOptimization)(options.optimization);
|
|
122
|
-
const defaultBaseHref = (_a = options.baseHref) !== null && _a !== void 0 ? _a : '/';
|
|
123
121
|
return (0, build_webpack_1.runWebpack)(config, context, {
|
|
124
122
|
webpackFactory: require('webpack'),
|
|
125
123
|
logging: transforms.logging ||
|
|
@@ -129,7 +127,7 @@ function buildWebpackBrowser(options, context, transforms = {}) {
|
|
|
129
127
|
}
|
|
130
128
|
}),
|
|
131
129
|
}).pipe((0, operators_1.concatMap)(async (buildEvent) => {
|
|
132
|
-
var _a, _b, _c, _d, _e, _f;
|
|
130
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
133
131
|
const spinner = new spinner_1.Spinner();
|
|
134
132
|
spinner.enabled = options.progress !== false;
|
|
135
133
|
const { success, emittedFiles = [], outputPath: webpackOutputPath } = buildEvent;
|
|
@@ -218,7 +216,7 @@ function buildWebpackBrowser(options, context, transforms = {}) {
|
|
|
218
216
|
for (const [locale, outputPath] of outputPaths.entries()) {
|
|
219
217
|
try {
|
|
220
218
|
const { content, warnings, errors } = await indexHtmlGenerator.process({
|
|
221
|
-
baseHref: getLocaleBaseHref(i18n, locale)
|
|
219
|
+
baseHref: (_f = getLocaleBaseHref(i18n, locale)) !== null && _f !== void 0 ? _f : options.baseHref,
|
|
222
220
|
// i18nLocale is used when Ivy is disabled
|
|
223
221
|
lang: locale || undefined,
|
|
224
222
|
outputPath,
|
|
@@ -254,7 +252,7 @@ function buildWebpackBrowser(options, context, transforms = {}) {
|
|
|
254
252
|
spinner.start('Generating service worker...');
|
|
255
253
|
for (const [locale, outputPath] of outputPaths.entries()) {
|
|
256
254
|
try {
|
|
257
|
-
await (0, service_worker_1.augmentAppWithServiceWorker)(projectRoot, context.workspaceRoot, outputPath, (
|
|
255
|
+
await (0, service_worker_1.augmentAppWithServiceWorker)(projectRoot, context.workspaceRoot, outputPath, (_h = (_g = getLocaleBaseHref(i18n, locale)) !== null && _g !== void 0 ? _g : options.baseHref) !== null && _h !== void 0 ? _h : '/', options.ngswConfigPath);
|
|
258
256
|
}
|
|
259
257
|
catch (error) {
|
|
260
258
|
spinner.fail('Service worker generation failed.');
|
|
@@ -278,11 +276,11 @@ function buildWebpackBrowser(options, context, transforms = {}) {
|
|
|
278
276
|
return ({
|
|
279
277
|
locale,
|
|
280
278
|
path,
|
|
281
|
-
baseHref: (_a = getLocaleBaseHref(i18n, locale)) !== null && _a !== void 0 ? _a :
|
|
279
|
+
baseHref: (_a = getLocaleBaseHref(i18n, locale)) !== null && _a !== void 0 ? _a : options.baseHref,
|
|
282
280
|
});
|
|
283
281
|
})) || {
|
|
284
282
|
path: baseOutputPath,
|
|
285
|
-
baseHref:
|
|
283
|
+
baseHref: options.baseHref,
|
|
286
284
|
},
|
|
287
285
|
})));
|
|
288
286
|
}));
|
|
@@ -249,7 +249,11 @@ async function bundleCode(workspaceRoot, entryPoints, outputNames, options, opti
|
|
|
249
249
|
{
|
|
250
250
|
workspaceRoot,
|
|
251
251
|
optimization: !!optimizationOptions.styles.minify,
|
|
252
|
-
sourcemap:
|
|
252
|
+
sourcemap:
|
|
253
|
+
// Hidden component stylesheet sourcemaps are inaccessible which is effectively
|
|
254
|
+
// the same as being disabled. Disabling has the advantage of avoiding the overhead
|
|
255
|
+
// of sourcemap processing.
|
|
256
|
+
!!sourcemapOptions.styles && (sourcemapOptions.hidden ? false : 'inline'),
|
|
253
257
|
outputNames,
|
|
254
258
|
}),
|
|
255
259
|
],
|
|
@@ -10,7 +10,7 @@ export interface BundleStylesheetOptions {
|
|
|
10
10
|
workspaceRoot?: string;
|
|
11
11
|
optimization: boolean;
|
|
12
12
|
preserveSymlinks?: boolean;
|
|
13
|
-
sourcemap: boolean | 'external';
|
|
13
|
+
sourcemap: boolean | 'external' | 'inline';
|
|
14
14
|
outputNames?: {
|
|
15
15
|
bundles?: string;
|
|
16
16
|
media?: string;
|
package/src/utils/copy-assets.js
CHANGED
|
@@ -37,17 +37,18 @@ exports.copyAssets = void 0;
|
|
|
37
37
|
const fs = __importStar(require("fs"));
|
|
38
38
|
const glob_1 = __importDefault(require("glob"));
|
|
39
39
|
const path = __importStar(require("path"));
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
40
|
+
const util_1 = require("util");
|
|
41
|
+
const globPromise = (0, util_1.promisify)(glob_1.default);
|
|
43
42
|
async function copyAssets(entries, basePaths, root, changed) {
|
|
44
43
|
const defaultIgnore = ['.gitkeep', '**/.DS_Store', '**/Thumbs.db'];
|
|
45
44
|
for (const entry of entries) {
|
|
46
45
|
const cwd = path.resolve(root, entry.input);
|
|
47
|
-
const files = await
|
|
46
|
+
const files = await globPromise(entry.glob, {
|
|
48
47
|
cwd,
|
|
49
48
|
dot: true,
|
|
50
49
|
nodir: true,
|
|
50
|
+
root: cwd,
|
|
51
|
+
nomount: true,
|
|
51
52
|
ignore: entry.ignore ? defaultIgnore.concat(entry.ignore) : defaultIgnore,
|
|
52
53
|
follow: entry.followSymlinks,
|
|
53
54
|
});
|
|
@@ -12,7 +12,9 @@ const path_1 = require("path");
|
|
|
12
12
|
const webpack_diagnostics_1 = require("../../utils/webpack-diagnostics");
|
|
13
13
|
// Webpack doesn't export these so the deep imports can potentially break.
|
|
14
14
|
const AMDDefineDependency = require('webpack/lib/dependencies/AMDDefineDependency');
|
|
15
|
+
const CommonJsExportsDependency = require('webpack/lib/dependencies/CommonJsExportsDependency');
|
|
15
16
|
const CommonJsRequireDependency = require('webpack/lib/dependencies/CommonJsRequireDependency');
|
|
17
|
+
const CommonJsSelfReferenceDependency = require('webpack/lib/dependencies/CommonJsSelfReferenceDependency');
|
|
16
18
|
class CommonJsUsageWarnPlugin {
|
|
17
19
|
constructor(options = {}) {
|
|
18
20
|
this.options = options;
|
|
@@ -81,7 +83,10 @@ class CommonJsUsageWarnPlugin {
|
|
|
81
83
|
}
|
|
82
84
|
hasCommonJsDependencies(compilation, dependencies, checkParentModules = false) {
|
|
83
85
|
for (const dep of dependencies) {
|
|
84
|
-
if (dep instanceof CommonJsRequireDependency ||
|
|
86
|
+
if (dep instanceof CommonJsRequireDependency ||
|
|
87
|
+
dep instanceof CommonJsExportsDependency ||
|
|
88
|
+
dep instanceof CommonJsSelfReferenceDependency ||
|
|
89
|
+
dep instanceof AMDDefineDependency) {
|
|
85
90
|
return true;
|
|
86
91
|
}
|
|
87
92
|
if (checkParentModules) {
|
|
@@ -21,7 +21,7 @@ export declare function getOutputHashFormat(outputHashing?: OutputHashing, lengt
|
|
|
21
21
|
export declare type NormalizedEntryPoint = Required<Exclude<ScriptElement | StyleElement, string>>;
|
|
22
22
|
export declare function normalizeExtraEntryPoints(extraEntryPoints: (ScriptElement | StyleElement)[], defaultBundleName: string): NormalizedEntryPoint[];
|
|
23
23
|
export declare function assetNameTemplateFactory(hashFormat: HashFormat): (resourcePath: string) => string;
|
|
24
|
-
export declare function getInstrumentationExcludedPaths(
|
|
24
|
+
export declare function getInstrumentationExcludedPaths(root: string, excludedPaths: string[]): Set<string>;
|
|
25
25
|
export declare function getCacheSettings(wco: WebpackConfigOptions, angularVersion: string): WebpackOptionsNormalized['cache'];
|
|
26
26
|
export declare function globalScriptsByBundleName(root: string, scripts: ScriptElement[]): {
|
|
27
27
|
bundleName: string;
|
|
@@ -121,12 +121,12 @@ function assetNameTemplateFactory(hashFormat) {
|
|
|
121
121
|
};
|
|
122
122
|
}
|
|
123
123
|
exports.assetNameTemplateFactory = assetNameTemplateFactory;
|
|
124
|
-
function getInstrumentationExcludedPaths(
|
|
124
|
+
function getInstrumentationExcludedPaths(root, excludedPaths) {
|
|
125
125
|
const excluded = new Set();
|
|
126
126
|
for (const excludeGlob of excludedPaths) {
|
|
127
127
|
glob_1.default
|
|
128
|
-
.sync(excludeGlob, { nodir: true, cwd:
|
|
129
|
-
.forEach((p) => excluded.add(path.join(
|
|
128
|
+
.sync(excludeGlob, { nodir: true, cwd: root, root, nomount: true })
|
|
129
|
+
.forEach((p) => excluded.add(path.join(root, p)));
|
|
130
130
|
}
|
|
131
131
|
return excluded;
|
|
132
132
|
}
|