@angular-devkit/build-angular 0.803.5 → 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.5",
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.5",
11
- "@angular-devkit/build-optimizer": "0.803.5",
12
- "@angular-devkit/build-webpack": "0.803.5",
13
- "@angular-devkit/core": "8.3.5",
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.5",
16
+ "@ngtools/webpack": "8.3.6",
17
17
  "ajv": "6.10.2",
18
18
  "autoprefixer": "9.6.1",
19
19
  "browserslist": "4.6.6",
@@ -254,11 +254,13 @@ function getCommonConfig(wco) {
254
254
  };
255
255
  }
256
256
  }
257
+ // TODO: Investigate why this fails for some packages: wco.supportES2015 ? 6 : 5;
258
+ const terserEcma = 5;
257
259
  const terserOptions = {
258
260
  warnings: !!buildOptions.verbose,
259
261
  safari10: true,
260
262
  output: {
261
- ecma: wco.supportES2015 ? 6 : 5,
263
+ ecma: terserEcma,
262
264
  comments: false,
263
265
  webkit: true,
264
266
  },
@@ -266,12 +268,12 @@ function getCommonConfig(wco) {
266
268
  // to remove dev code, and ngI18nClosureMode to remove Closure compiler i18n code
267
269
  compress: buildOptions.platform == 'server'
268
270
  ? {
269
- ecma: wco.supportES2015 ? 6 : 5,
271
+ ecma: terserEcma,
270
272
  global_defs: angularGlobalDefinitions,
271
273
  keep_fnames: true,
272
274
  }
273
275
  : {
274
- ecma: wco.supportES2015 ? 6 : 5,
276
+ ecma: terserEcma,
275
277
  pure_getters: buildOptions.buildOptimizer,
276
278
  // PURE comments work best with 3 passes.
277
279
  // See https://github.com/webpack/webpack/issues/2899#issuecomment-317425926.
@@ -332,7 +332,24 @@ 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);
337
354
  if (process.platform !== 'win32') {
338
355
  // The cache writes entries as readonly and when using copyFile the permissions will also be copied.
@@ -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 manualSourceMaps = codeSize >= 500 * 1024;
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,