rollup 2.20.0 → 2.21.0

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/dist/es/rollup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.20.0
4
- Mon, 06 Jul 2020 19:11:47 GMT - commit 974492f50d5051e671998ca21cba7ac939823e34
3
+ Rollup.js v2.21.0
4
+ Tue, 07 Jul 2020 19:25:24 GMT - commit b1aaedc37f1bf83ed410f4b5c4ea950b12b14e7a
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.20.0
4
- Mon, 06 Jul 2020 19:11:47 GMT - commit 974492f50d5051e671998ca21cba7ac939823e34
3
+ Rollup.js v2.21.0
4
+ Tue, 07 Jul 2020 19:25:24 GMT - commit b1aaedc37f1bf83ed410f4b5c4ea950b12b14e7a
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -13,7 +13,7 @@ import { createHash as createHash$1 } from 'crypto';
13
13
  import { writeFile as writeFile$1, readdirSync, mkdirSync, readFile as readFile$1, lstatSync, realpathSync } from 'fs';
14
14
  import { EventEmitter } from 'events';
15
15
 
16
- var version = "2.20.0";
16
+ var version = "2.21.0";
17
17
 
18
18
  var charToInteger = {};
19
19
  var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
@@ -9583,7 +9583,7 @@ class Module {
9583
9583
  }
9584
9584
  relevantDependencies.add(variable.module);
9585
9585
  }
9586
- if (this.options.treeshake) {
9586
+ if (this.options.treeshake && this.moduleSideEffects !== 'no-treeshake') {
9587
9587
  for (const dependency of possibleDependencies) {
9588
9588
  if (!(dependency.moduleSideEffects || additionalSideEffectModules.has(dependency)) ||
9589
9589
  relevantDependencies.has(dependency)) {
@@ -9722,7 +9722,8 @@ class Module {
9722
9722
  return null;
9723
9723
  }
9724
9724
  hasEffects() {
9725
- return this.ast.included && this.ast.hasEffects(createHasEffectsContext());
9725
+ return (this.moduleSideEffects === 'no-treeshake' ||
9726
+ (this.ast.included && this.ast.hasEffects(createHasEffectsContext())));
9726
9727
  }
9727
9728
  include() {
9728
9729
  const context = createInclusionContext();
@@ -9803,10 +9804,10 @@ class Module {
9803
9804
  }
9804
9805
  this.transformDependencies = transformDependencies;
9805
9806
  this.customTransformCache = customTransformCache;
9806
- if (typeof moduleSideEffects === 'boolean') {
9807
+ if (moduleSideEffects != null) {
9807
9808
  this.moduleSideEffects = moduleSideEffects;
9808
9809
  }
9809
- if (typeof syntheticNamedExports === 'boolean') {
9810
+ if (syntheticNamedExports != null) {
9810
9811
  this.syntheticNamedExports = syntheticNamedExports;
9811
9812
  }
9812
9813
  timeStart('generate ast', 3);
@@ -17459,10 +17460,10 @@ function transform(source, module, pluginDriver, warn) {
17459
17460
  if (typeof result.map === 'string') {
17460
17461
  result.map = JSON.parse(result.map);
17461
17462
  }
17462
- if (typeof result.moduleSideEffects === 'boolean') {
17463
+ if (result.moduleSideEffects != null) {
17463
17464
  moduleSideEffects = result.moduleSideEffects;
17464
17465
  }
17465
- if (typeof result.syntheticNamedExports === 'boolean') {
17466
+ if (result.syntheticNamedExports != null) {
17466
17467
  syntheticNamedExports = result.syntheticNamedExports;
17467
17468
  }
17468
17469
  }
@@ -17684,10 +17685,10 @@ class ModuleLoader {
17684
17685
  module.setSource(cachedModule);
17685
17686
  }
17686
17687
  else {
17687
- if (typeof sourceDescription.moduleSideEffects === 'boolean') {
17688
+ if (sourceDescription.moduleSideEffects != null) {
17688
17689
  module.moduleSideEffects = sourceDescription.moduleSideEffects;
17689
17690
  }
17690
- if (typeof sourceDescription.syntheticNamedExports === 'boolean') {
17691
+ if (sourceDescription.syntheticNamedExports != null) {
17691
17692
  module.syntheticNamedExports = sourceDescription.syntheticNamedExports;
17692
17693
  }
17693
17694
  module.setSource(await transform(sourceDescription, module, this.pluginDriver, this.options.onwarn));
@@ -17822,10 +17823,10 @@ class ModuleLoader {
17822
17823
  if (resolveIdResult.external) {
17823
17824
  external = true;
17824
17825
  }
17825
- if (typeof resolveIdResult.moduleSideEffects === 'boolean') {
17826
+ if (resolveIdResult.moduleSideEffects != null) {
17826
17827
  moduleSideEffects = resolveIdResult.moduleSideEffects;
17827
17828
  }
17828
- if (typeof resolveIdResult.syntheticNamedExports === 'boolean') {
17829
+ if (resolveIdResult.syntheticNamedExports != null) {
17829
17830
  syntheticNamedExports = resolveIdResult.syntheticNamedExports;
17830
17831
  }
17831
17832
  }
@@ -17846,9 +17847,7 @@ class ModuleLoader {
17846
17847
  return {
17847
17848
  external,
17848
17849
  id,
17849
- moduleSideEffects: typeof moduleSideEffects === 'boolean'
17850
- ? moduleSideEffects
17851
- : this.hasModuleSideEffects(id, external),
17850
+ moduleSideEffects: moduleSideEffects !== null && moduleSideEffects !== void 0 ? moduleSideEffects : this.hasModuleSideEffects(id, external),
17852
17851
  syntheticNamedExports
17853
17852
  };
17854
17853
  }
@@ -18338,8 +18337,14 @@ class Graph {
18338
18337
  timeStart(`treeshaking pass ${treeshakingPass}`, 3);
18339
18338
  this.needsTreeshakingPass = false;
18340
18339
  for (const module of this.modules) {
18341
- if (module.isExecuted)
18342
- module.include();
18340
+ if (module.isExecuted) {
18341
+ if (module.moduleSideEffects === 'no-treeshake') {
18342
+ module.includeAllInBundle();
18343
+ }
18344
+ else {
18345
+ module.include();
18346
+ }
18347
+ }
18343
18348
  }
18344
18349
  timeEnd(`treeshaking pass ${treeshakingPass++}`, 3);
18345
18350
  } while (this.needsTreeshakingPass);
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.20.0
4
- Mon, 06 Jul 2020 19:11:47 GMT - commit 974492f50d5051e671998ca21cba7ac939823e34
3
+ Rollup.js v2.21.0
4
+ Tue, 07 Jul 2020 19:25:24 GMT - commit b1aaedc37f1bf83ed410f4b5c4ea950b12b14e7a
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.20.0
4
- Mon, 06 Jul 2020 19:11:47 GMT - commit 974492f50d5051e671998ca21cba7ac939823e34
3
+ Rollup.js v2.21.0
4
+ Tue, 07 Jul 2020 19:25:24 GMT - commit b1aaedc37f1bf83ed410f4b5c4ea950b12b14e7a
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup