@angular-devkit/build-optimizer 0.1001.2 → 0.1001.3

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular-devkit/build-optimizer",
3
- "version": "0.1001.2",
3
+ "version": "0.1001.3",
4
4
  "description": "Angular Build Optimizer",
5
5
  "experimental": true,
6
6
  "main": "src/index.js",
@@ -15,7 +15,7 @@ const prefix_functions_1 = require("../transforms/prefix-functions");
15
15
  const scrub_file_1 = require("../transforms/scrub-file");
16
16
  const wrap_enums_1 = require("../transforms/wrap-enums");
17
17
  // Angular packages are known to have no side effects.
18
- const whitelistedAngularModules = [
18
+ const knownSideEffectFreeAngularModules = [
19
19
  /[\\/]node_modules[\\/]@angular[\\/]animations[\\/]/,
20
20
  /[\\/]node_modules[\\/]@angular[\\/]common[\\/]/,
21
21
  /[\\/]node_modules[\\/]@angular[\\/]compiler[\\/]/,
@@ -49,7 +49,7 @@ function isKnownCoreFile(filePath) {
49
49
  }
50
50
  function isKnownSideEffectFree(filePath) {
51
51
  return ngFactories.some((re) => re.test(filePath)) ||
52
- whitelistedAngularModules.some((re) => re.test(filePath));
52
+ knownSideEffectFreeAngularModules.some((re) => re.test(filePath));
53
53
  }
54
54
  function buildOptimizer(options) {
55
55
  const { inputFilePath, isAngularCoreFile } = options;
@@ -82,7 +82,7 @@ function buildOptimizer(options) {
82
82
  getTransforms.push(
83
83
  // getPrefixFunctionsTransformer is rather dangerous, apply only to known pure es5 modules.
84
84
  // It will mark both `require()` calls and `console.log(stuff)` as pure.
85
- // We only apply it to whitelisted modules, since we know they are safe.
85
+ // We only apply it to modules known to be side effect free, since we know they are safe.
86
86
  // getPrefixFunctionsTransformer needs to be before getFoldFileTransformer.
87
87
  prefix_functions_1.getPrefixFunctionsTransformer, selectedGetScrubFileTransformer);
88
88
  typeCheck = true;