rollup 0.66.2 → 0.66.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/dist/rollup.es.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v0.66.2
4
- Fri, 21 Sep 2018 04:18:59 GMT - commit d8a4d7ba8cb6fabce7a254acfa3b2d9486467510
3
+ Rollup.js v0.66.6
4
+ Wed, 10 Oct 2018 14:49:51 GMT - commit aa68a8cd6d363681ec1df60df63e05f6b53c4277
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -654,17 +654,17 @@ function decode(mappings) {
654
654
  var decoded = [];
655
655
  var line = [];
656
656
  var segment = [];
657
- for (var i = 0, j = 0, shift = 0, value = 0; i < mappings.length; i++) {
657
+ for (var i = 0, j = 0, shift = 0, value = 0, len = mappings.length; i < len; i++) {
658
658
  var c = mappings.charCodeAt(i);
659
- if (c === 44) {
659
+ if (c === 44) { // ","
660
660
  if (segment.length)
661
- line.push(segment);
661
+ line.push(new Int16Array(segment));
662
662
  segment = [];
663
663
  j = 0;
664
664
  }
665
- else if (c === 59) {
665
+ else if (c === 59) { // ";"
666
666
  if (segment.length)
667
- line.push(segment);
667
+ line.push(new Int16Array(segment));
668
668
  segment = [];
669
669
  j = 0;
670
670
  decoded.push(line);
@@ -712,7 +712,7 @@ function decode(mappings) {
712
712
  }
713
713
  }
714
714
  if (segment.length)
715
- line.push(segment);
715
+ line.push(new Int16Array(segment));
716
716
  decoded.push(line);
717
717
  return decoded;
718
718
  }
@@ -2315,10 +2315,9 @@ var UNKNOWN_LITERAL_STRING = {
2315
2315
  },
2316
2316
  hasEffectsWhenAccessedAtPath: function (path$$1) { return path$$1.length > 1; },
2317
2317
  hasEffectsWhenAssignedAtPath: function (path$$1) { return path$$1.length > 0; },
2318
- hasEffectsWhenCalledAtPath: function (path$$1) {
2318
+ hasEffectsWhenCalledAtPath: function (path$$1, callOptions, options) {
2319
2319
  if (path$$1.length === 1) {
2320
- var subPath = path$$1[0];
2321
- return typeof subPath !== 'string' || !literalStringMembers[subPath];
2320
+ return hasMemberEffectWhenCalled(literalStringMembers, path$$1[0], true, callOptions, options);
2322
2321
  }
2323
2322
  return true;
2324
2323
  },
@@ -2682,36 +2681,36 @@ var ExportDefaultVariable = /** @class */ (function (_super) {
2682
2681
  function ExportDefaultVariable(name, exportDefaultDeclaration, deoptimizationTracker) {
2683
2682
  var _this = _super.call(this, name, exportDefaultDeclaration, exportDefaultDeclaration.declaration, deoptimizationTracker) || this;
2684
2683
  // Not initialised during construction
2685
- _this.original = null;
2686
- _this.hasId =
2687
- (exportDefaultDeclaration.declaration.type === FunctionDeclaration ||
2688
- exportDefaultDeclaration.declaration.type === ClassDeclaration) &&
2689
- !!exportDefaultDeclaration.declaration.id;
2684
+ _this.originalId = null;
2685
+ var declaration = exportDefaultDeclaration.declaration;
2686
+ if ((declaration.type === FunctionDeclaration ||
2687
+ declaration.type === ClassDeclaration) &&
2688
+ declaration.id) {
2689
+ _this.hasId = true;
2690
+ _this.originalId = declaration.id;
2691
+ }
2692
+ else if (declaration.type === Identifier) {
2693
+ _this.originalId = declaration;
2694
+ }
2690
2695
  return _this;
2691
2696
  }
2692
2697
  ExportDefaultVariable.prototype.addReference = function (identifier) {
2693
2698
  if (!this.hasId) {
2694
2699
  this.name = identifier.name;
2695
- if (this.original !== null) {
2696
- this.original.addReference(identifier);
2697
- }
2698
2700
  }
2699
2701
  };
2700
2702
  ExportDefaultVariable.prototype.getName = function (reset) {
2701
2703
  if (!reset && this.safeName)
2702
2704
  return this.safeName;
2703
- if (this.original !== null && !this.original.isReassigned)
2704
- return this.original.getName();
2705
+ if (this.referencesOriginal())
2706
+ return this.originalId.variable.getName();
2705
2707
  return this.name;
2706
2708
  };
2707
2709
  ExportDefaultVariable.prototype.referencesOriginal = function () {
2708
- return this.original && !this.original.isReassigned;
2710
+ return this.originalId && (this.hasId || !this.originalId.variable.isReassigned);
2709
2711
  };
2710
2712
  ExportDefaultVariable.prototype.getOriginalVariableName = function () {
2711
- return this.original && this.original.getName();
2712
- };
2713
- ExportDefaultVariable.prototype.setOriginalVariable = function (original) {
2714
- this.original = original;
2713
+ return (this.originalId && this.originalId.name) || null;
2715
2714
  };
2716
2715
  return ExportDefaultVariable;
2717
2716
  }(LocalVariable));
@@ -9616,151 +9615,6 @@ var FunctionDeclaration$1 = /** @class */ (function (_super) {
9616
9615
  return FunctionDeclaration$$1;
9617
9616
  }(FunctionNode));
9618
9617
 
9619
- function isReference(node, parent) {
9620
- if (node.type === 'MemberExpression') {
9621
- return !node.computed && isReference(node.object, node);
9622
- }
9623
- if (node.type === 'Identifier') {
9624
- // the only time we could have an identifier node without a parent is
9625
- // if it's the entire body of a function without a block statement –
9626
- // i.e. an arrow function expression like `a => a`
9627
- if (!parent)
9628
- return true;
9629
- // TODO is this right?
9630
- if (parent.type === 'MemberExpression' || parent.type === 'MethodDefinition') {
9631
- return parent.computed || node === parent.object;
9632
- }
9633
- // disregard the `bar` in `{ bar: foo }`, but keep it in `{ [bar]: foo }`
9634
- if (parent.type === 'Property')
9635
- return parent.computed || node === parent.value;
9636
- // disregard the `bar` in `export { foo as bar }`
9637
- if (parent.type === 'ExportSpecifier' && node !== parent.local)
9638
- return false;
9639
- return true;
9640
- }
9641
- return false;
9642
- }
9643
-
9644
- function isIdentifier(node) {
9645
- return node.type === Identifier;
9646
- }
9647
- var Identifier$1 = /** @class */ (function (_super) {
9648
- __extends(Identifier$$1, _super);
9649
- function Identifier$$1() {
9650
- return _super !== null && _super.apply(this, arguments) || this;
9651
- }
9652
- Identifier$$1.prototype.bind = function () {
9653
- if (this.bound)
9654
- return;
9655
- this.bound = true;
9656
- if (this.variable === null && isReference(this, this.parent)) {
9657
- this.variable = this.scope.findVariable(this.name);
9658
- this.variable.addReference(this);
9659
- }
9660
- if (this.variable !== null &&
9661
- this.variable.isLocal &&
9662
- this.variable.additionalInitializers !== null) {
9663
- this.variable.consolidateInitializers();
9664
- }
9665
- };
9666
- Identifier$$1.prototype.declare = function (kind, init) {
9667
- switch (kind) {
9668
- case 'var':
9669
- case 'function':
9670
- this.variable = this.scope.addDeclaration(this, this.context.deoptimizationTracker, init, true);
9671
- break;
9672
- case 'let':
9673
- case 'const':
9674
- case 'class':
9675
- this.variable = this.scope.addDeclaration(this, this.context.deoptimizationTracker, init, false);
9676
- break;
9677
- case 'parameter':
9678
- this.variable = this.scope.addParameterDeclaration(this);
9679
- break;
9680
- default:
9681
- throw new Error("Unexpected identifier kind " + kind + ".");
9682
- }
9683
- };
9684
- Identifier$$1.prototype.getLiteralValueAtPath = function (path$$1, recursionTracker, origin) {
9685
- if (this.variable !== null) {
9686
- return this.variable.getLiteralValueAtPath(path$$1, recursionTracker, origin);
9687
- }
9688
- return UNKNOWN_VALUE;
9689
- };
9690
- Identifier$$1.prototype.getReturnExpressionWhenCalledAtPath = function (path$$1, recursionTracker, origin) {
9691
- if (this.variable !== null) {
9692
- return this.variable.getReturnExpressionWhenCalledAtPath(path$$1, recursionTracker, origin);
9693
- }
9694
- return UNKNOWN_EXPRESSION;
9695
- };
9696
- Identifier$$1.prototype.hasEffectsWhenAccessedAtPath = function (path$$1, options) {
9697
- return this.variable && this.variable.hasEffectsWhenAccessedAtPath(path$$1, options);
9698
- };
9699
- Identifier$$1.prototype.hasEffectsWhenAssignedAtPath = function (path$$1, options) {
9700
- return !this.variable || this.variable.hasEffectsWhenAssignedAtPath(path$$1, options);
9701
- };
9702
- Identifier$$1.prototype.hasEffectsWhenCalledAtPath = function (path$$1, callOptions, options) {
9703
- return !this.variable || this.variable.hasEffectsWhenCalledAtPath(path$$1, callOptions, options);
9704
- };
9705
- Identifier$$1.prototype.include = function () {
9706
- if (!this.included) {
9707
- this.included = true;
9708
- if (this.variable !== null && !this.variable.included) {
9709
- this.variable.include();
9710
- this.context.requestTreeshakingPass();
9711
- }
9712
- }
9713
- };
9714
- Identifier$$1.prototype.initialise = function () {
9715
- this.included = false;
9716
- this.bound = false;
9717
- // To avoid later shape mutations
9718
- if (!this.variable) {
9719
- this.variable = null;
9720
- }
9721
- };
9722
- Identifier$$1.prototype.deoptimizePath = function (path$$1) {
9723
- if (!this.bound)
9724
- this.bind();
9725
- if (this.variable !== null) {
9726
- if (path$$1.length === 0 &&
9727
- this.name in this.context.imports &&
9728
- !this.scope.contains(this.name)) {
9729
- this.disallowImportReassignment();
9730
- }
9731
- this.variable.deoptimizePath(path$$1);
9732
- }
9733
- };
9734
- Identifier$$1.prototype.render = function (code, _options, _a) {
9735
- var _b = _a === void 0 ? BLANK : _a, renderedParentType = _b.renderedParentType, isCalleeOfRenderedParent = _b.isCalleeOfRenderedParent, isShorthandProperty = _b.isShorthandProperty;
9736
- if (this.variable) {
9737
- var name = this.variable.getName();
9738
- if (name !== this.name) {
9739
- code.overwrite(this.start, this.end, name, {
9740
- storeName: true,
9741
- contentOnly: true
9742
- });
9743
- if (isShorthandProperty) {
9744
- code.prependRight(this.start, this.name + ": ");
9745
- }
9746
- }
9747
- // In strict mode, any variable named "eval" must be the actual "eval" function
9748
- if (name === 'eval' &&
9749
- renderedParentType === CallExpression &&
9750
- isCalleeOfRenderedParent) {
9751
- code.appendRight(this.start, '0, ');
9752
- }
9753
- }
9754
- };
9755
- Identifier$$1.prototype.disallowImportReassignment = function () {
9756
- this.context.error({
9757
- code: 'ILLEGAL_REASSIGNMENT',
9758
- message: "Illegal reassignment to import '" + this.name + "'"
9759
- }, this.start);
9760
- };
9761
- return Identifier$$1;
9762
- }(NodeBase));
9763
-
9764
9618
  var WHITESPACE = /\s/;
9765
9619
  // The header ends at the first non-white-space after "default"
9766
9620
  function getDeclarationStart(code, start) {
@@ -9788,16 +9642,6 @@ var ExportDefaultDeclaration$1 = /** @class */ (function (_super) {
9788
9642
  function ExportDefaultDeclaration$$1() {
9789
9643
  return _super !== null && _super.apply(this, arguments) || this;
9790
9644
  }
9791
- ExportDefaultDeclaration$$1.prototype.bind = function () {
9792
- _super.prototype.bind.call(this);
9793
- if (this.declarationName &&
9794
- // Do not set it for Class and FunctionExpressions otherwise they get treeshaken away
9795
- (isFunctionDeclaration(this.declaration) ||
9796
- isClassDeclaration(this.declaration) ||
9797
- isIdentifier(this.declaration))) {
9798
- this.variable.setOriginalVariable(this.scope.findVariable(this.declarationName));
9799
- }
9800
- };
9801
9645
  ExportDefaultDeclaration$$1.prototype.initialise = function () {
9802
9646
  this.included = false;
9803
9647
  this.declarationName =
@@ -10219,6 +10063,151 @@ var ImmutableEntityPathTracker = /** @class */ (function () {
10219
10063
  }());
10220
10064
  var EMPTY_IMMUTABLE_TRACKER = new ImmutableEntityPathTracker();
10221
10065
 
10066
+ function isReference(node, parent) {
10067
+ if (node.type === 'MemberExpression') {
10068
+ return !node.computed && isReference(node.object, node);
10069
+ }
10070
+ if (node.type === 'Identifier') {
10071
+ // the only time we could have an identifier node without a parent is
10072
+ // if it's the entire body of a function without a block statement –
10073
+ // i.e. an arrow function expression like `a => a`
10074
+ if (!parent)
10075
+ return true;
10076
+ // TODO is this right?
10077
+ if (parent.type === 'MemberExpression' || parent.type === 'MethodDefinition') {
10078
+ return parent.computed || node === parent.object;
10079
+ }
10080
+ // disregard the `bar` in `{ bar: foo }`, but keep it in `{ [bar]: foo }`
10081
+ if (parent.type === 'Property')
10082
+ return parent.computed || node === parent.value;
10083
+ // disregard the `bar` in `export { foo as bar }`
10084
+ if (parent.type === 'ExportSpecifier' && node !== parent.local)
10085
+ return false;
10086
+ return true;
10087
+ }
10088
+ return false;
10089
+ }
10090
+
10091
+ function isIdentifier(node) {
10092
+ return node.type === Identifier;
10093
+ }
10094
+ var Identifier$1 = /** @class */ (function (_super) {
10095
+ __extends(Identifier$$1, _super);
10096
+ function Identifier$$1() {
10097
+ return _super !== null && _super.apply(this, arguments) || this;
10098
+ }
10099
+ Identifier$$1.prototype.bind = function () {
10100
+ if (this.bound)
10101
+ return;
10102
+ this.bound = true;
10103
+ if (this.variable === null && isReference(this, this.parent)) {
10104
+ this.variable = this.scope.findVariable(this.name);
10105
+ this.variable.addReference(this);
10106
+ }
10107
+ if (this.variable !== null &&
10108
+ this.variable.isLocal &&
10109
+ this.variable.additionalInitializers !== null) {
10110
+ this.variable.consolidateInitializers();
10111
+ }
10112
+ };
10113
+ Identifier$$1.prototype.declare = function (kind, init) {
10114
+ switch (kind) {
10115
+ case 'var':
10116
+ case 'function':
10117
+ this.variable = this.scope.addDeclaration(this, this.context.deoptimizationTracker, init, true);
10118
+ break;
10119
+ case 'let':
10120
+ case 'const':
10121
+ case 'class':
10122
+ this.variable = this.scope.addDeclaration(this, this.context.deoptimizationTracker, init, false);
10123
+ break;
10124
+ case 'parameter':
10125
+ this.variable = this.scope.addParameterDeclaration(this);
10126
+ break;
10127
+ default:
10128
+ throw new Error("Unexpected identifier kind " + kind + ".");
10129
+ }
10130
+ };
10131
+ Identifier$$1.prototype.getLiteralValueAtPath = function (path$$1, recursionTracker, origin) {
10132
+ if (this.variable !== null) {
10133
+ return this.variable.getLiteralValueAtPath(path$$1, recursionTracker, origin);
10134
+ }
10135
+ return UNKNOWN_VALUE;
10136
+ };
10137
+ Identifier$$1.prototype.getReturnExpressionWhenCalledAtPath = function (path$$1, recursionTracker, origin) {
10138
+ if (this.variable !== null) {
10139
+ return this.variable.getReturnExpressionWhenCalledAtPath(path$$1, recursionTracker, origin);
10140
+ }
10141
+ return UNKNOWN_EXPRESSION;
10142
+ };
10143
+ Identifier$$1.prototype.hasEffectsWhenAccessedAtPath = function (path$$1, options) {
10144
+ return this.variable && this.variable.hasEffectsWhenAccessedAtPath(path$$1, options);
10145
+ };
10146
+ Identifier$$1.prototype.hasEffectsWhenAssignedAtPath = function (path$$1, options) {
10147
+ return !this.variable || this.variable.hasEffectsWhenAssignedAtPath(path$$1, options);
10148
+ };
10149
+ Identifier$$1.prototype.hasEffectsWhenCalledAtPath = function (path$$1, callOptions, options) {
10150
+ return !this.variable || this.variable.hasEffectsWhenCalledAtPath(path$$1, callOptions, options);
10151
+ };
10152
+ Identifier$$1.prototype.include = function () {
10153
+ if (!this.included) {
10154
+ this.included = true;
10155
+ if (this.variable !== null && !this.variable.included) {
10156
+ this.variable.include();
10157
+ this.context.requestTreeshakingPass();
10158
+ }
10159
+ }
10160
+ };
10161
+ Identifier$$1.prototype.initialise = function () {
10162
+ this.included = false;
10163
+ this.bound = false;
10164
+ // To avoid later shape mutations
10165
+ if (!this.variable) {
10166
+ this.variable = null;
10167
+ }
10168
+ };
10169
+ Identifier$$1.prototype.deoptimizePath = function (path$$1) {
10170
+ if (!this.bound)
10171
+ this.bind();
10172
+ if (this.variable !== null) {
10173
+ if (path$$1.length === 0 &&
10174
+ this.name in this.context.imports &&
10175
+ !this.scope.contains(this.name)) {
10176
+ this.disallowImportReassignment();
10177
+ }
10178
+ this.variable.deoptimizePath(path$$1);
10179
+ }
10180
+ };
10181
+ Identifier$$1.prototype.render = function (code, _options, _a) {
10182
+ var _b = _a === void 0 ? BLANK : _a, renderedParentType = _b.renderedParentType, isCalleeOfRenderedParent = _b.isCalleeOfRenderedParent, isShorthandProperty = _b.isShorthandProperty;
10183
+ if (this.variable) {
10184
+ var name = this.variable.getName();
10185
+ if (name !== this.name) {
10186
+ code.overwrite(this.start, this.end, name, {
10187
+ storeName: true,
10188
+ contentOnly: true
10189
+ });
10190
+ if (isShorthandProperty) {
10191
+ code.prependRight(this.start, this.name + ": ");
10192
+ }
10193
+ }
10194
+ // In strict mode, any variable named "eval" must be the actual "eval" function
10195
+ if (name === 'eval' &&
10196
+ renderedParentType === CallExpression &&
10197
+ isCalleeOfRenderedParent) {
10198
+ code.appendRight(this.start, '0, ');
10199
+ }
10200
+ }
10201
+ };
10202
+ Identifier$$1.prototype.disallowImportReassignment = function () {
10203
+ this.context.error({
10204
+ code: 'ILLEGAL_REASSIGNMENT',
10205
+ message: "Illegal reassignment to import '" + this.name + "'"
10206
+ }, this.start);
10207
+ };
10208
+ return Identifier$$1;
10209
+ }(NodeBase));
10210
+
10222
10211
  var CallExpression$1 = /** @class */ (function (_super) {
10223
10212
  __extends(CallExpression, _super);
10224
10213
  function CallExpression() {
@@ -10238,7 +10227,7 @@ var CallExpression$1 = /** @class */ (function (_super) {
10238
10227
  this.context.warn({
10239
10228
  code: 'EVAL',
10240
10229
  message: "Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification",
10241
- url: 'https://github.com/rollup/rollup/wiki/Troubleshooting#avoiding-eval'
10230
+ url: 'https://rollupjs.org/guide/en#avoiding-eval'
10242
10231
  }, this.start);
10243
10232
  }
10244
10233
  }
@@ -11388,7 +11377,7 @@ var MemberExpression$1 = /** @class */ (function (_super) {
11388
11377
  importer: relativeId(this.context.fileName),
11389
11378
  exporter: relativeId(fileName),
11390
11379
  message: "'" + exportName + "' is not exported by '" + relativeId(fileName) + "'",
11391
- url: "https://github.com/rollup/rollup/wiki/Troubleshooting#name-is-not-exported-by-module"
11380
+ url: "https://rollupjs.org/guide/en#error-name-is-not-exported-by-module-"
11392
11381
  }, path$$1[0].pos);
11393
11382
  return 'undefined';
11394
11383
  }
@@ -12174,7 +12163,7 @@ var TaggedTemplateExpression$1 = /** @class */ (function (_super) {
12174
12163
  this.context.warn({
12175
12164
  code: 'EVAL',
12176
12165
  message: "Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification",
12177
- url: 'https://github.com/rollup/rollup/wiki/Troubleshooting#avoiding-eval'
12166
+ url: 'https://rollupjs.org/guide/en#avoiding-eval'
12178
12167
  }, this.start);
12179
12168
  }
12180
12169
  }
@@ -12248,7 +12237,7 @@ var ThisExpression$1 = /** @class */ (function (_super) {
12248
12237
  this.context.warn({
12249
12238
  code: 'THIS_IS_UNDEFINED',
12250
12239
  message: "The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten",
12251
- url: "https://github.com/rollup/rollup/wiki/Troubleshooting#this-is-undefined"
12240
+ url: "https://rollupjs.org/guide/en#error-this-is-undefined"
12252
12241
  }, this.start);
12253
12242
  }
12254
12243
  };
@@ -12387,14 +12376,11 @@ var VariableDeclaration$1 = /** @class */ (function (_super) {
12387
12376
  return false;
12388
12377
  };
12389
12378
  VariableDeclaration$$1.prototype.includeWithAllDeclaredVariables = function () {
12390
- var anotherPassNeeded = false;
12391
12379
  this.included = true;
12392
12380
  for (var _i = 0, _a = this.declarations; _i < _a.length; _i++) {
12393
12381
  var declarator = _a[_i];
12394
- if (declarator.include())
12395
- anotherPassNeeded = true;
12382
+ declarator.include();
12396
12383
  }
12397
- return anotherPassNeeded;
12398
12384
  };
12399
12385
  VariableDeclaration$$1.prototype.include = function () {
12400
12386
  this.included = true;
@@ -12764,10 +12750,13 @@ var NamespaceVariable = /** @class */ (function (_super) {
12764
12750
  _this.needsNamespaceBlock = false;
12765
12751
  _this.referencedEarly = false;
12766
12752
  _this.references = [];
12753
+ _this.containsExternalNamespace = false;
12767
12754
  _this.context = context;
12768
12755
  _this.module = module;
12769
12756
  for (var _i = 0, _a = _this.context.getExports().concat(_this.context.getReexports()); _i < _a.length; _i++) {
12770
12757
  var name = _a[_i];
12758
+ if (name[0] === '*' && name.length > 1)
12759
+ _this.containsExternalNamespace = true;
12771
12760
  _this.originals[name] = _this.context.traceExport(name);
12772
12761
  }
12773
12762
  return _this;
@@ -12778,6 +12767,13 @@ var NamespaceVariable = /** @class */ (function (_super) {
12778
12767
  };
12779
12768
  NamespaceVariable.prototype.include = function () {
12780
12769
  if (!this.included) {
12770
+ if (this.containsExternalNamespace) {
12771
+ this.context.error({
12772
+ code: 'NAMESPACE_CANNOT_CONTAIN_EXTERNAL',
12773
+ message: "Cannot create an explicit namespace object for module \"" + this.context.getModuleName() + "\" because it contains a reexported external namespace",
12774
+ id: this.module.id
12775
+ }, undefined);
12776
+ }
12781
12777
  this.context.includeNamespace();
12782
12778
  this.included = true;
12783
12779
  this.needsNamespaceBlock = true;
@@ -13045,7 +13041,7 @@ function handleMissingExport(exportName, importingModule, importedModule, import
13045
13041
  importingModule.error({
13046
13042
  code: 'MISSING_EXPORT',
13047
13043
  message: "'" + exportName + "' is not exported by " + relativeId(importedModule),
13048
- url: "https://github.com/rollup/rollup/wiki/Troubleshooting#name-is-not-exported-by-module"
13044
+ url: "https://rollupjs.org/guide/en#error-name-is-not-exported-by-module-"
13049
13045
  }, importerStart);
13050
13046
  }
13051
13047
  var Module = /** @class */ (function () {
@@ -13173,9 +13169,6 @@ var Module = /** @class */ (function () {
13173
13169
  // export default function foo () {}
13174
13170
  // export default foo;
13175
13171
  // export default 42;
13176
- var identifier = (node.declaration.id &&
13177
- node.declaration.id.name) ||
13178
- node.declaration.name;
13179
13172
  if (this.exports.default) {
13180
13173
  this.error({
13181
13174
  code: 'DUPLICATE_EXPORT',
@@ -13184,7 +13177,7 @@ var Module = /** @class */ (function () {
13184
13177
  }
13185
13178
  this.exports.default = {
13186
13179
  localName: 'default',
13187
- identifier: identifier,
13180
+ identifier: node.variable.getOriginalVariableName(),
13188
13181
  node: node
13189
13182
  };
13190
13183
  }
@@ -13675,7 +13668,7 @@ function collapseSourcemaps(bundle, file, map, modules, bundleSourcemapChain) {
13675
13668
  code: 'SOURCEMAP_BROKEN',
13676
13669
  plugin: map.plugin,
13677
13670
  message: "Sourcemap is likely to be incorrect: a plugin" + (map.plugin ? " ('" + map.plugin + "')" : "") + " was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help",
13678
- url: "https://github.com/rollup/rollup/wiki/Troubleshooting#sourcemap-is-likely-to-be-incorrect"
13671
+ url: "https://rollupjs.org/guide/en#warning-sourcemap-is-likely-to-be-incorrect"
13679
13672
  });
13680
13673
  map = {
13681
13674
  names: [],
@@ -13962,7 +13955,8 @@ var Chunk$1 = /** @class */ (function () {
13962
13955
  for (var _i = 0, entryExportEntries_1 = entryExportEntries; _i < entryExportEntries_1.length; _i++) {
13963
13956
  var _a = entryExportEntries_1[_i], index = _a[0], exportName = _a[1];
13964
13957
  var traced = this.traceExport(exportName, this.entryModule);
13965
- if (traced.variable && !traced.variable.included && !traced.variable.isExternal) {
13958
+ if (!traced ||
13959
+ (traced.variable && !traced.variable.included && !traced.variable.isExternal)) {
13966
13960
  continue;
13967
13961
  }
13968
13962
  tracedExports[index] = traced;
@@ -14049,7 +14043,7 @@ var Chunk$1 = /** @class */ (function () {
14049
14043
  // trace a module export to its exposed chunk module export
14050
14044
  // either in this chunk or in another
14051
14045
  Chunk.prototype.traceExport = function (name, module) {
14052
- if (name === '*' || module instanceof ExternalModule) {
14046
+ if (name[0] === '*' || module instanceof ExternalModule) {
14053
14047
  return { variable: module.traceExport(name), module: module };
14054
14048
  }
14055
14049
  if (module.chunk !== this) {
@@ -14076,10 +14070,6 @@ var Chunk$1 = /** @class */ (function () {
14076
14070
  if (name === 'default') {
14077
14071
  return;
14078
14072
  }
14079
- // external star exports
14080
- if (name[0] === '*') {
14081
- return { variable: undefined, module: this.graph.moduleById.get(name.substr(1)) };
14082
- }
14083
14073
  // resolve known star exports
14084
14074
  for (var i = 0; i < module.exportAllModules.length; i++) {
14085
14075
  var exportAllModule = module.exportAllModules[i];
@@ -20617,7 +20607,7 @@ function Uint8ArrayEqual(bufferA, bufferB) {
20617
20607
  return true;
20618
20608
  }
20619
20609
 
20620
- var version$1 = "0.66.2";
20610
+ var version$1 = "0.66.6";
20621
20611
 
20622
20612
  function mkdirpath(path$$1) {
20623
20613
  var dir = dirname(path$$1);
@@ -20696,7 +20686,7 @@ function createResolveId(options) {
20696
20686
  error({
20697
20687
  code: 'MISSING_PROCESS',
20698
20688
  message: "It looks like you're using Rollup in a non-Node.js environment. This means you must supply a plugin with custom resolveId and load functions",
20699
- url: 'https://github.com/rollup/rollup/wiki/Plugins'
20689
+ url: 'https://rollupjs.org/guide/en#a-simple-example'
20700
20690
  });
20701
20691
  }
20702
20692
  // external modules (non-entry modules that start with neither '.' or '/')
@@ -21017,7 +21007,7 @@ function uncacheablePluginError(pluginName) {
21017
21007
  else
21018
21008
  error({
21019
21009
  code: 'DUPLICATE_PLUGIN_NAME',
21020
- message: 'The plugin name ${pluginName} is being used twice in the same build. Plugin names must be distinct or provide a cacheKey (please post an issue to the plugin if you are a plugin user).'
21010
+ message: "The plugin name " + pluginName + " is being used twice in the same build. Plugin names must be distinct or provide a cacheKey (please post an issue to the plugin if you are a plugin user)."
21021
21011
  });
21022
21012
  }
21023
21013
  var uncacheablePlugin = function (pluginName) { return ({
@@ -21861,7 +21851,7 @@ var Graph = /** @class */ (function () {
21861
21851
  source: source,
21862
21852
  importer: relativeId(module.id),
21863
21853
  message: "'" + source + "' is imported by " + relativeId(module.id) + ", but could not be resolved \u2013 treating it as an external dependency",
21864
- url: 'https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency'
21854
+ url: 'https://rollupjs.org/guide/en#warning-treating-module-as-external-dependency'
21865
21855
  });
21866
21856
  }
21867
21857
  isExternal = true;
@@ -21996,8 +21986,8 @@ function getExportMode(chunk, _a) {
21996
21986
  chunk.graph.warn({
21997
21987
  code: 'MIXED_EXPORTS',
21998
21988
  message: "Using named and default exports together. Consumers of your bundle will have to use " + (name ||
21999
- 'bundle') + "['default'] to access the default export, which may not be what you want. Use `exports: 'named'` to disable this warning",
22000
- url: "https://rollupjs.org/#exports"
21989
+ 'bundle') + "['default'] to access the default export, which may not be what you want. Use `output.exports: 'named'` to disable this warning",
21990
+ url: "https://rollupjs.org/guide/en#output-exports-exports"
22001
21991
  });
22002
21992
  }
22003
21993
  exportMode = 'named';
@@ -22006,7 +21996,8 @@ function getExportMode(chunk, _a) {
22006
21996
  if (!/(?:default|named|none)/.test(exportMode)) {
22007
21997
  error({
22008
21998
  code: 'INVALID_EXPORT_OPTION',
22009
- message: "output.exports must be 'default', 'named', 'none', 'auto', or left unspecified (defaults to 'auto')"
21999
+ message: "output.exports must be 'default', 'named', 'none', 'auto', or left unspecified (defaults to 'auto')",
22000
+ url: "https://rollupjs.org/guide/en#output-exports-exports"
22010
22001
  });
22011
22002
  }
22012
22003
  return exportMode;
@@ -22356,20 +22347,20 @@ function addDeprecations(deprecations, warn) {
22356
22347
  }
22357
22348
  function checkInputOptions(options) {
22358
22349
  if (options.transform || options.load || options.resolveId || options.resolveExternal) {
22359
- throw new Error('The `transform`, `load`, `resolveId` and `resolveExternal` options are deprecated in favour of a unified plugin API. See https://github.com/rollup/rollup/wiki/Plugins for details');
22350
+ throw new Error('The `transform`, `load`, `resolveId` and `resolveExternal` options are deprecated in favour of a unified plugin API. See https://rollupjs.org/guide/en#plugins');
22360
22351
  }
22361
22352
  }
22362
22353
  function checkOutputOptions(options) {
22363
22354
  if (options.format === 'es6') {
22364
22355
  error({
22365
22356
  message: 'The `es6` output format is deprecated – use `es` instead',
22366
- url: "https://rollupjs.org/#format-f-output-format-"
22357
+ url: "https://rollupjs.org/guide/en#output-format-f-format"
22367
22358
  });
22368
22359
  }
22369
22360
  if (!options.format) {
22370
22361
  error({
22371
22362
  message: "You must specify output.format, which can be one of 'amd', 'cjs', 'system', 'esm', 'iife' or 'umd'",
22372
- url: "https://rollupjs.org/#format-f-output-format-"
22363
+ url: "https://rollupjs.org/guide/en#output-format-f-format"
22373
22364
  });
22374
22365
  }
22375
22366
  if (options.moduleId) {
@@ -22471,6 +22462,8 @@ function rollup(rawInputOptions) {
22471
22462
  initialiseTimers(inputOptions_1);
22472
22463
  var graph_1 = new Graph(inputOptions_1, curWatcher);
22473
22464
  curWatcher = undefined;
22465
+ // remove the cache option from the memory after graph creation (cache is not used anymore)
22466
+ delete inputOptions_1.cache;
22474
22467
  timeStart('BUILD', 1);
22475
22468
  return graph_1.pluginDriver
22476
22469
  .hookParallel('buildStart')
@@ -22565,11 +22558,9 @@ function rollup(rawInputOptions) {
22565
22558
  optimized = true;
22566
22559
  }
22567
22560
  // name all chunks
22561
+ var usedIds = {};
22568
22562
  for (var i = 0; i < chunks.length; i++) {
22569
22563
  var chunk = chunks[i];
22570
- var imports = chunk.getImportIds();
22571
- var exports = chunk.getExportNames();
22572
- var modules = chunk.renderedModules;
22573
22564
  if (chunk === singleChunk) {
22574
22565
  singleChunk.id = basename(outputOptions.file ||
22575
22566
  (inputOptions_1.input instanceof Array
@@ -22589,14 +22580,19 @@ function rollup(rawInputOptions) {
22589
22580
  pattern = outputOptions.chunkFileNames || '[name]-[hash].js';
22590
22581
  patternName = 'output.chunkFileNames';
22591
22582
  }
22592
- chunk.generateId(pattern, patternName, addons, outputOptions, outputBundle);
22583
+ chunk.generateId(pattern, patternName, addons, outputOptions, usedIds);
22584
+ usedIds[chunk.id] = true;
22593
22585
  }
22586
+ }
22587
+ // assign to outputBundle
22588
+ for (var i = 0; i < chunks.length; i++) {
22589
+ var chunk = chunks[i];
22594
22590
  outputBundle[chunk.id] = {
22595
22591
  fileName: chunk.id,
22596
22592
  isEntry: chunk.entryModule !== undefined,
22597
- imports: imports,
22598
- exports: exports,
22599
- modules: modules,
22593
+ imports: chunk.getImportIds(),
22594
+ exports: chunk.getExportNames(),
22595
+ modules: chunk.renderedModules,
22600
22596
  code: undefined,
22601
22597
  map: undefined
22602
22598
  };