@angular-devkit/build-angular 0.803.20 → 0.803.21

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.20",
3
+ "version": "0.803.21",
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.20",
11
- "@angular-devkit/build-optimizer": "0.803.20",
12
- "@angular-devkit/build-webpack": "0.803.20",
13
- "@angular-devkit/core": "8.3.20",
14
- "@babel/core": "7.5.5",
15
- "@babel/preset-env": "7.5.5",
16
- "@ngtools/webpack": "8.3.20",
10
+ "@angular-devkit/architect": "0.803.21",
11
+ "@angular-devkit/build-optimizer": "0.803.21",
12
+ "@angular-devkit/build-webpack": "0.803.21",
13
+ "@angular-devkit/core": "8.3.21",
14
+ "@babel/core": "7.7.5",
15
+ "@babel/preset-env": "7.7.6",
16
+ "@ngtools/webpack": "8.3.21",
17
17
  "ajv": "6.10.2",
18
18
  "autoprefixer": "9.6.1",
19
19
  "browserslist": "4.6.6",
@@ -21,7 +21,7 @@
21
21
  "caniuse-lite": "1.0.30000989",
22
22
  "circular-dependency-plugin": "5.2.0",
23
23
  "clean-css": "4.2.1",
24
- "copy-webpack-plugin": "5.0.4",
24
+ "copy-webpack-plugin": "5.1.1",
25
25
  "core-js": "3.2.1",
26
26
  "file-loader": "4.2.0",
27
27
  "find-cache-dir": "3.0.0",
@@ -55,7 +55,7 @@
55
55
  "stylus-loader": "3.0.2",
56
56
  "tree-kill": "1.2.1",
57
57
  "terser": "4.3.9",
58
- "terser-webpack-plugin": "1.4.1",
58
+ "terser-webpack-plugin": "1.4.3",
59
59
  "webpack": "4.39.2",
60
60
  "webpack-dev-middleware": "3.7.2",
61
61
  "webpack-dev-server": "3.9.0",
@@ -81,4 +81,5 @@ export interface WebpackConfigOptions<T = BuildOptions> {
81
81
  tsConfig: ParsedConfiguration;
82
82
  tsConfigPath: string;
83
83
  supportES2015: boolean;
84
+ differentialLoadingMode?: boolean;
84
85
  }
@@ -40,7 +40,7 @@ function getBrowserConfig(wco) {
40
40
  }));
41
41
  }
42
42
  if (!isEval && (scriptsSourceMap || stylesSourceMap)) {
43
- extraPlugins.push(utils_1.getSourceMapDevTool(!!scriptsSourceMap, !!stylesSourceMap, hiddenSourceMap));
43
+ extraPlugins.push(utils_1.getSourceMapDevTool(!!scriptsSourceMap, !!stylesSourceMap, wco.differentialLoadingMode ? true : hiddenSourceMap));
44
44
  }
45
45
  const globalStylesBundleNames = utils_1.normalizeExtraEntryPoints(buildOptions.styles, 'styles')
46
46
  .map(style => style.bundleName);
@@ -140,7 +140,7 @@ class BundleActionCache {
140
140
  cacheEntry = entries[2 /* DownlevelCode */];
141
141
  if (cacheEntry) {
142
142
  result.downlevel = {
143
- filename: action.filename.replace('es2015', 'es5'),
143
+ filename: action.filename.replace(/\-es20\d{2}/, '-es5'),
144
144
  size: cacheEntry.size,
145
145
  integrity: cacheEntry.integrity,
146
146
  };
@@ -148,7 +148,7 @@ class BundleActionCache {
148
148
  cacheEntry = entries[3 /* DownlevelMap */];
149
149
  if (cacheEntry) {
150
150
  result.downlevel.map = {
151
- filename: action.filename.replace('es2015', 'es5') + '.map',
151
+ filename: action.filename.replace(/\-es20\d{2}/, '-es5') + '.map',
152
152
  size: cacheEntry.size,
153
153
  };
154
154
  BundleActionCache.copyEntryContent(cacheEntry, result.downlevel.filename + '.map');
@@ -323,10 +323,6 @@ function _addLiveReload(options, browserOptions, webpackConfig, clientAddress, l
323
323
  if (clientAddress.pathname) {
324
324
  clientAddress.pathname = path.posix.join(clientAddress.pathname, 'sockjs-node');
325
325
  sockjsPath = '&sockPath=' + clientAddress.pathname;
326
- // ensure webpack-dev-server uses the correct path to connect to the reloading socket
327
- if (webpackConfig.devServer) {
328
- webpackConfig.devServer.sockPath = clientAddress.pathname;
329
- }
330
326
  }
331
327
  const entryPoints = [`${webpackDevServerPath}?${url.format(clientAddress)}${sockjsPath}`];
332
328
  if (options.hmr) {
@@ -7,13 +7,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  * Use of this source code is governed by an MIT-style license that can be
8
8
  * found in the LICENSE file at https://angular.io/license
9
9
  */
10
+ const core_1 = require("@babel/core");
10
11
  const crypto_1 = require("crypto");
11
12
  const fs = require("fs");
12
13
  const path = require("path");
13
14
  const source_map_1 = require("source-map");
14
15
  const terser_1 = require("terser");
15
- const typescript_1 = require("typescript");
16
- const webpack_sources_1 = require("webpack-sources");
17
16
  const mangle_options_1 = require("./mangle-options");
18
17
  const cacache = require('cacache');
19
18
  let cachePath;
@@ -55,24 +54,36 @@ async function process(options) {
55
54
  let downlevelMap;
56
55
  if (downlevel) {
57
56
  // Downlevel the bundle
58
- const transformResult = typescript_1.transpileModule(sourceCode, {
59
- fileName: downlevelFilename,
60
- compilerOptions: {
61
- downlevelIteration: true,
62
- sourceMap: !!sourceMap,
63
- target: typescript_1.ScriptTarget.ES5,
64
- },
57
+ const transformResult = await core_1.transformAsync(sourceCode, {
58
+ filename: options.filename,
59
+ inputSourceMap: manualSourceMaps ? undefined : sourceMap,
60
+ babelrc: false,
61
+ presets: [
62
+ [
63
+ require.resolve('@babel/preset-env'),
64
+ {
65
+ // modules aren't needed since the bundles use webpack's custom module loading
66
+ modules: false,
67
+ // 'transform-typeof-symbol' generates slower code
68
+ exclude: ['transform-typeof-symbol'],
69
+ },
70
+ ],
71
+ ],
72
+ minified: options.optimize,
73
+ // `false` ensures it is disabled and prevents large file warnings
74
+ compact: options.optimize || false,
75
+ sourceMaps: !!sourceMap,
65
76
  });
66
- downlevelCode = transformResult.outputText;
67
- if (sourceMap && transformResult.sourceMapText) {
68
- if (manualSourceMaps) {
69
- downlevelMap = await mergeSourcemaps(sourceMap, JSON.parse(transformResult.sourceMapText));
70
- }
71
- else {
72
- // More accurate but significantly more costly
73
- const tempSource = new webpack_sources_1.SourceMapSource(transformResult.outputText, downlevelFilename, JSON.parse(transformResult.sourceMapText), sourceCode, sourceMap);
74
- downlevelMap = tempSource.map();
75
- }
77
+ if (!transformResult || !transformResult.code) {
78
+ throw new Error(`Unknown error occurred processing bundle for "${options.filename}".`);
79
+ }
80
+ downlevelCode = transformResult.code;
81
+ if (manualSourceMaps && sourceMap && transformResult.map) {
82
+ downlevelMap = await mergeSourcemaps(sourceMap, transformResult.map);
83
+ }
84
+ else {
85
+ // undefined is needed here to normalize the property type
86
+ downlevelMap = transformResult.map || undefined;
76
87
  }
77
88
  }
78
89
  if (options.optimize) {
@@ -63,6 +63,7 @@ async function generateWebpackConfig(context, workspaceRoot, projectRoot, source
63
63
  tsConfig,
64
64
  tsConfigPath,
65
65
  supportES2015,
66
+ differentialLoadingMode: differentialLoading && !utils_1.fullDifferential,
66
67
  };
67
68
  wco.buildOptions.progress = utils_1.defaultProgress(wco.buildOptions.progress);
68
69
  const partials = webpackPartialGenerator(wco);