@angular-devkit/build-angular 0.900.6 → 0.900.7

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,20 +1,20 @@
1
1
  {
2
2
  "name": "@angular-devkit/build-angular",
3
- "version": "0.900.6",
3
+ "version": "0.900.7",
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.900.6",
11
- "@angular-devkit/build-optimizer": "0.900.6",
12
- "@angular-devkit/build-webpack": "0.900.6",
13
- "@angular-devkit/core": "9.0.6",
10
+ "@angular-devkit/architect": "0.900.7",
11
+ "@angular-devkit/build-optimizer": "0.900.7",
12
+ "@angular-devkit/build-webpack": "0.900.7",
13
+ "@angular-devkit/core": "9.0.7",
14
14
  "@babel/core": "7.7.7",
15
15
  "@babel/generator": "7.7.7",
16
16
  "@babel/preset-env": "7.7.7",
17
- "@ngtools/webpack": "9.0.6",
17
+ "@ngtools/webpack": "9.0.7",
18
18
  "ajv": "6.10.2",
19
19
  "autoprefixer": "9.7.1",
20
20
  "babel-loader": "8.0.6",
@@ -7,6 +7,7 @@
7
7
  * found in the LICENSE file at https://angular.io/license
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
+ const path = require("path");
10
11
  const schema_1 = require("../../../src/browser/schema");
11
12
  const bundle_calculator_1 = require("../utilities/bundle-calculator");
12
13
  const PLUGIN_NAME = 'AnyComponentStyleBudgetChecker';
@@ -27,8 +28,15 @@ class AnyComponentStyleBudgetChecker {
27
28
  if (!parentCompilation) {
28
29
  return;
29
30
  }
31
+ const cssExtensions = [
32
+ '.css',
33
+ '.scss',
34
+ '.less',
35
+ '.styl',
36
+ '.sass',
37
+ ];
30
38
  const componentStyles = Object.keys(compilation.assets)
31
- .filter((name) => name.endsWith('.css'))
39
+ .filter((name) => cssExtensions.includes(path.extname(name)))
32
40
  .map((name) => ({
33
41
  size: compilation.assets[name].size(),
34
42
  label: name,
@@ -120,16 +120,15 @@ class Calculator {
120
120
  else {
121
121
  // No differential builds, get the chunk size by summing its assets.
122
122
  return chunk.files
123
- .filter((file) => !file.endsWith('.map'))
124
- .map((file) => {
123
+ .filter(file => !file.endsWith('.map'))
124
+ .map(file => {
125
125
  const asset = this.assets.find((asset) => asset.name === file);
126
126
  if (!asset) {
127
127
  throw new Error(`Could not find asset for file: ${file}`);
128
128
  }
129
- return asset;
129
+ return asset.size;
130
130
  })
131
- .map((asset) => asset.size)
132
- .reduce((l, r) => l + r);
131
+ .reduce((l, r) => l + r, 0);
133
132
  }
134
133
  }
135
134
  }
@@ -147,8 +146,8 @@ class BundleCalculator extends Calculator {
147
146
  const buildSizes = Object.values(DifferentialBuildType).map((buildType) => {
148
147
  const size = this.chunks
149
148
  .filter(chunk => chunk.names.indexOf(budgetName) !== -1)
150
- .map((chunk) => this.calculateChunkSize(chunk, buildType))
151
- .reduce((l, r) => l + r);
149
+ .map(chunk => this.calculateChunkSize(chunk, buildType))
150
+ .reduce((l, r) => l + r, 0);
152
151
  return { size, label: `${this.budget.name}-${buildType}` };
153
152
  });
154
153
  // If this bundle was not actually generated by a differential build, then
@@ -171,8 +170,8 @@ class InitialCalculator extends Calculator {
171
170
  label: `initial-${buildType}`,
172
171
  size: this.chunks
173
172
  .filter(chunk => chunk.initial)
174
- .map((chunk) => this.calculateChunkSize(chunk, buildType))
175
- .reduce((l, r) => l + r),
173
+ .map(chunk => this.calculateChunkSize(chunk, buildType))
174
+ .reduce((l, r) => l + r, 0),
176
175
  };
177
176
  });
178
177
  // If this bundle was not actually generated by a differential build, then
@@ -191,7 +190,7 @@ class InitialCalculator extends Calculator {
191
190
  class AllScriptCalculator extends Calculator {
192
191
  calculate() {
193
192
  const size = this.assets
194
- .filter((asset) => asset.name.endsWith('.js'))
193
+ .filter(asset => asset.name.endsWith('.js'))
195
194
  .map(asset => asset.size)
196
195
  .reduce((total, size) => total + size, 0);
197
196
  return [{ size, label: 'total scripts' }];
@@ -211,7 +211,7 @@
211
211
  "minItems": 1,
212
212
  "items": {
213
213
  "type": "string",
214
- "pattern": "^[a-zA-Z]{2,3}(-[a-zA-Z]{4})?(-([a-zA-Z]{2}|[0-9]{3}))?(-[a-zA-Z]{5,8})?$"
214
+ "pattern": "^[a-zA-Z]{2,3}(-[a-zA-Z]{4})?(-([a-zA-Z]{2}|[0-9]{3}))?(-[a-zA-Z]{5,8})?(-x(-[a-zA-Z0-9]{1,8})+)?$"
215
215
  }
216
216
  }
217
217
  ]
@@ -175,7 +175,7 @@
175
175
  "minItems": 1,
176
176
  "items": {
177
177
  "type": "string",
178
- "pattern": "^[a-zA-Z]{2,3}(-[a-zA-Z]{4})?(-([a-zA-Z]{2}|[0-9]{3}))?(-[a-zA-Z]{5,8})?$"
178
+ "pattern": "^[a-zA-Z]{2,3}(-[a-zA-Z]{4})?(-([a-zA-Z]{2}|[0-9]{3}))?(-[a-zA-Z]{5,8})?(-x(-[a-zA-Z0-9]{1,8})+)?$"
179
179
  }
180
180
  }
181
181
  ]
@@ -242,9 +242,11 @@ function findLocaleDataBasePath(projectRoot) {
242
242
  }
243
243
  }
244
244
  function findLocaleDataPath(locale, basePath) {
245
- const localeDataPath = path.join(basePath, locale + '.js');
245
+ // Remove private use subtags
246
+ const scrubbedLocale = locale.replace(/-x(-[a-zA-Z0-9]{1,8})+$/, '');
247
+ const localeDataPath = path.join(basePath, scrubbedLocale + '.js');
246
248
  if (!fs.existsSync(localeDataPath)) {
247
- if (locale === 'en-US') {
249
+ if (scrubbedLocale === 'en-US') {
248
250
  // fallback to known existing en-US locale data as of 9.0
249
251
  return findLocaleDataPath('en-US-POSIX', basePath);
250
252
  }