@angular-devkit/build-angular 0.803.2 → 0.803.6
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
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular-devkit/build-angular",
|
|
3
|
-
"version": "0.803.
|
|
3
|
+
"version": "0.803.6",
|
|
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.803.
|
|
11
|
-
"@angular-devkit/build-optimizer": "0.803.
|
|
12
|
-
"@angular-devkit/build-webpack": "0.803.
|
|
13
|
-
"@angular-devkit/core": "8.3.
|
|
10
|
+
"@angular-devkit/architect": "0.803.6",
|
|
11
|
+
"@angular-devkit/build-optimizer": "0.803.6",
|
|
12
|
+
"@angular-devkit/build-webpack": "0.803.6",
|
|
13
|
+
"@angular-devkit/core": "8.3.6",
|
|
14
14
|
"@babel/core": "7.5.5",
|
|
15
15
|
"@babel/preset-env": "7.5.5",
|
|
16
|
-
"@ngtools/webpack": "8.3.
|
|
16
|
+
"@ngtools/webpack": "8.3.6",
|
|
17
17
|
"ajv": "6.10.2",
|
|
18
18
|
"autoprefixer": "9.6.1",
|
|
19
19
|
"browserslist": "4.6.6",
|
|
@@ -105,27 +105,27 @@ function getCommonConfig(wco) {
|
|
|
105
105
|
// determine hashing format
|
|
106
106
|
const hashFormat = utils_2.getOutputHashFormat(buildOptions.outputHashing || 'none');
|
|
107
107
|
// process global scripts
|
|
108
|
-
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
if (existingEntry) {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
throw new Error(`The ${curr.bundleName} bundle is mixing injected and non-injected scripts.`);
|
|
117
|
-
}
|
|
118
|
-
existingEntry.paths.push(resolvedPath);
|
|
119
|
-
}
|
|
120
|
-
else {
|
|
121
|
-
prev.push({
|
|
122
|
-
bundleName,
|
|
123
|
-
paths: [resolvedPath],
|
|
124
|
-
inject: curr.inject,
|
|
125
|
-
});
|
|
108
|
+
const globalScriptsByBundleName = utils_2.normalizeExtraEntryPoints(buildOptions.scripts, 'scripts').reduce((prev, curr) => {
|
|
109
|
+
const bundleName = curr.bundleName;
|
|
110
|
+
const resolvedPath = path.resolve(root, curr.input);
|
|
111
|
+
const existingEntry = prev.find(el => el.bundleName === bundleName);
|
|
112
|
+
if (existingEntry) {
|
|
113
|
+
if (existingEntry.inject && !curr.inject) {
|
|
114
|
+
// All entries have to be lazy for the bundle to be lazy.
|
|
115
|
+
throw new Error(`The ${curr.bundleName} bundle is mixing injected and non-injected scripts.`);
|
|
126
116
|
}
|
|
127
|
-
|
|
128
|
-
}
|
|
117
|
+
existingEntry.paths.push(resolvedPath);
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
prev.push({
|
|
121
|
+
bundleName,
|
|
122
|
+
paths: [resolvedPath],
|
|
123
|
+
inject: curr.inject,
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
return prev;
|
|
127
|
+
}, []);
|
|
128
|
+
if (globalScriptsByBundleName.length > 0) {
|
|
129
129
|
// Add a new asset for each entry.
|
|
130
130
|
globalScriptsByBundleName.forEach(script => {
|
|
131
131
|
// Lazy scripts don't get a hash, otherwise they can't be loaded by name.
|
|
@@ -245,7 +245,8 @@ function getCommonConfig(wco) {
|
|
|
245
245
|
}
|
|
246
246
|
if (buildOptions.aot) {
|
|
247
247
|
// Also try to load AOT-only global definitions.
|
|
248
|
-
const GLOBAL_DEFS_FOR_TERSER_WITH_AOT = require('@angular/compiler-cli')
|
|
248
|
+
const GLOBAL_DEFS_FOR_TERSER_WITH_AOT = require('@angular/compiler-cli')
|
|
249
|
+
.GLOBAL_DEFS_FOR_TERSER_WITH_AOT;
|
|
249
250
|
if (GLOBAL_DEFS_FOR_TERSER_WITH_AOT) {
|
|
250
251
|
angularGlobalDefinitions = {
|
|
251
252
|
...angularGlobalDefinitions,
|
|
@@ -253,17 +254,13 @@ function getCommonConfig(wco) {
|
|
|
253
254
|
};
|
|
254
255
|
}
|
|
255
256
|
}
|
|
257
|
+
// TODO: Investigate why this fails for some packages: wco.supportES2015 ? 6 : 5;
|
|
258
|
+
const terserEcma = 5;
|
|
256
259
|
const terserOptions = {
|
|
257
|
-
// Use 5 if using bundle downleveling to ensure script bundles do not use ES2015+ features
|
|
258
|
-
// Script bundles are shared for differential loading
|
|
259
|
-
// Bundle processing will use the ES2015+ optimizations on the ES2015 bundles
|
|
260
|
-
ecma: wco.supportES2015 &&
|
|
261
|
-
(!differentialLoadingNeeded || (differentialLoadingNeeded && utils_1.fullDifferential))
|
|
262
|
-
? 6
|
|
263
|
-
: 5,
|
|
264
260
|
warnings: !!buildOptions.verbose,
|
|
265
261
|
safari10: true,
|
|
266
262
|
output: {
|
|
263
|
+
ecma: terserEcma,
|
|
267
264
|
comments: false,
|
|
268
265
|
webkit: true,
|
|
269
266
|
},
|
|
@@ -271,9 +268,12 @@ function getCommonConfig(wco) {
|
|
|
271
268
|
// to remove dev code, and ngI18nClosureMode to remove Closure compiler i18n code
|
|
272
269
|
compress: buildOptions.platform == 'server'
|
|
273
270
|
? {
|
|
271
|
+
ecma: terserEcma,
|
|
274
272
|
global_defs: angularGlobalDefinitions,
|
|
273
|
+
keep_fnames: true,
|
|
275
274
|
}
|
|
276
275
|
: {
|
|
276
|
+
ecma: terserEcma,
|
|
277
277
|
pure_getters: buildOptions.buildOptimizer,
|
|
278
278
|
// PURE comments work best with 3 passes.
|
|
279
279
|
// See https://github.com/webpack/webpack/issues/2899#issuecomment-317425926.
|
|
@@ -290,7 +290,28 @@ function getCommonConfig(wco) {
|
|
|
290
290
|
sourceMap: scriptsSourceMap,
|
|
291
291
|
parallel: true,
|
|
292
292
|
cache: true,
|
|
293
|
+
chunkFilter: (chunk) => !globalScriptsByBundleName.some(s => s.bundleName === chunk.name),
|
|
293
294
|
terserOptions,
|
|
295
|
+
}),
|
|
296
|
+
// Script bundles are fully optimized here in one step since they are never downleveled.
|
|
297
|
+
// They are shared between ES2015 & ES5 outputs so must support ES5.
|
|
298
|
+
new TerserPlugin({
|
|
299
|
+
sourceMap: scriptsSourceMap,
|
|
300
|
+
parallel: true,
|
|
301
|
+
cache: true,
|
|
302
|
+
chunkFilter: (chunk) => globalScriptsByBundleName.some(s => s.bundleName === chunk.name),
|
|
303
|
+
terserOptions: {
|
|
304
|
+
...terserOptions,
|
|
305
|
+
compress: {
|
|
306
|
+
...terserOptions.compress,
|
|
307
|
+
ecma: 5,
|
|
308
|
+
},
|
|
309
|
+
output: {
|
|
310
|
+
...terserOptions.output,
|
|
311
|
+
ecma: 5,
|
|
312
|
+
},
|
|
313
|
+
mangle: !mangle_options_1.manglingDisabled && buildOptions.platform !== 'server',
|
|
314
|
+
},
|
|
294
315
|
}));
|
|
295
316
|
}
|
|
296
317
|
if (wco.tsConfig.options.target !== undefined &&
|
package/src/browser/index.js
CHANGED
|
@@ -332,8 +332,30 @@ function buildWebpackBrowser(options, context, transforms = {}) {
|
|
|
332
332
|
});
|
|
333
333
|
}
|
|
334
334
|
}
|
|
335
|
+
// Workaround Node.js issue prior to 10.16 with copyFile on macOS
|
|
336
|
+
// https://github.com/angular/angular-cli/issues/15544 & https://github.com/nodejs/node/pull/27241
|
|
337
|
+
let copyFileWorkaround = false;
|
|
338
|
+
if (process.platform === 'darwin') {
|
|
339
|
+
const version = process.versions.node.split('.').map(part => Number(part));
|
|
340
|
+
if (version[0] < 10 ||
|
|
341
|
+
version[0] === 11 ||
|
|
342
|
+
(version[0] === 10 && version[1] < 16)) {
|
|
343
|
+
copyFileWorkaround = true;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
335
346
|
for (const action of cacheActions) {
|
|
347
|
+
if (copyFileWorkaround) {
|
|
348
|
+
try {
|
|
349
|
+
fs.unlinkSync(action.dest);
|
|
350
|
+
}
|
|
351
|
+
catch (_b) { }
|
|
352
|
+
}
|
|
336
353
|
fs.copyFileSync(action.src, action.dest, fs.constants.COPYFILE_FICLONE);
|
|
354
|
+
if (process.platform !== 'win32') {
|
|
355
|
+
// The cache writes entries as readonly and when using copyFile the permissions will also be copied.
|
|
356
|
+
// See: https://github.com/npm/cacache/blob/073fbe1a9f789ba42d9a41de7b8429c93cf61579/lib/util/move-file.js#L36
|
|
357
|
+
fs.chmodSync(action.dest, 0o644);
|
|
358
|
+
}
|
|
337
359
|
}
|
|
338
360
|
if (processActions.length > 0) {
|
|
339
361
|
await new Promise((resolve, reject) => {
|
package/src/protractor/index.js
CHANGED
|
@@ -118,6 +118,11 @@ async function execute(options, context) {
|
|
|
118
118
|
});
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
+
// Like the baseUrl in protractor config file when using the API we need to add
|
|
122
|
+
// a trailing slash when provide to the baseUrl.
|
|
123
|
+
if (baseUrl && !baseUrl.endsWith('/')) {
|
|
124
|
+
baseUrl += '/';
|
|
125
|
+
}
|
|
121
126
|
try {
|
|
122
127
|
return await runProtractor(context.workspaceRoot, { ...options, baseUrl });
|
|
123
128
|
}
|
|
@@ -29,7 +29,8 @@ async function processWorker(options) {
|
|
|
29
29
|
// if code size is larger than 500kB, manually handle sourcemaps with newer source-map package.
|
|
30
30
|
// babel currently uses an older version that still supports sync calls
|
|
31
31
|
const codeSize = Buffer.byteLength(options.code, 'utf8');
|
|
32
|
-
const
|
|
32
|
+
const mapSize = options.map ? Buffer.byteLength(options.map, 'utf8') : 0;
|
|
33
|
+
const manualSourceMaps = codeSize >= 500 * 1024 || mapSize >= 500 * 1024;
|
|
33
34
|
// downlevel the bundle
|
|
34
35
|
let { code, map } = await transformAsync(options.code, {
|
|
35
36
|
filename: options.filename,
|