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/CHANGELOG.md +20 -0
- package/README.md +0 -5
- package/bin/rollup +7 -7
- package/dist/rollup.browser.js +3 -3
- package/dist/rollup.es.js +214 -218
- package/dist/rollup.js +214 -218
- package/package.json +3 -3
package/dist/rollup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v0.66.
|
|
4
|
-
|
|
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
|
|
@@ -661,17 +661,17 @@ function decode(mappings) {
|
|
|
661
661
|
var decoded = [];
|
|
662
662
|
var line = [];
|
|
663
663
|
var segment = [];
|
|
664
|
-
for (var i = 0, j = 0, shift = 0, value = 0
|
|
664
|
+
for (var i = 0, j = 0, shift = 0, value = 0, len = mappings.length; i < len; i++) {
|
|
665
665
|
var c = mappings.charCodeAt(i);
|
|
666
|
-
if (c === 44) {
|
|
666
|
+
if (c === 44) { // ","
|
|
667
667
|
if (segment.length)
|
|
668
|
-
line.push(segment);
|
|
668
|
+
line.push(new Int16Array(segment));
|
|
669
669
|
segment = [];
|
|
670
670
|
j = 0;
|
|
671
671
|
}
|
|
672
|
-
else if (c === 59) {
|
|
672
|
+
else if (c === 59) { // ";"
|
|
673
673
|
if (segment.length)
|
|
674
|
-
line.push(segment);
|
|
674
|
+
line.push(new Int16Array(segment));
|
|
675
675
|
segment = [];
|
|
676
676
|
j = 0;
|
|
677
677
|
decoded.push(line);
|
|
@@ -719,7 +719,7 @@ function decode(mappings) {
|
|
|
719
719
|
}
|
|
720
720
|
}
|
|
721
721
|
if (segment.length)
|
|
722
|
-
line.push(segment);
|
|
722
|
+
line.push(new Int16Array(segment));
|
|
723
723
|
decoded.push(line);
|
|
724
724
|
return decoded;
|
|
725
725
|
}
|
|
@@ -2322,10 +2322,9 @@ var UNKNOWN_LITERAL_STRING = {
|
|
|
2322
2322
|
},
|
|
2323
2323
|
hasEffectsWhenAccessedAtPath: function (path$$1) { return path$$1.length > 1; },
|
|
2324
2324
|
hasEffectsWhenAssignedAtPath: function (path$$1) { return path$$1.length > 0; },
|
|
2325
|
-
hasEffectsWhenCalledAtPath: function (path$$1) {
|
|
2325
|
+
hasEffectsWhenCalledAtPath: function (path$$1, callOptions, options) {
|
|
2326
2326
|
if (path$$1.length === 1) {
|
|
2327
|
-
|
|
2328
|
-
return typeof subPath !== 'string' || !literalStringMembers[subPath];
|
|
2327
|
+
return hasMemberEffectWhenCalled(literalStringMembers, path$$1[0], true, callOptions, options);
|
|
2329
2328
|
}
|
|
2330
2329
|
return true;
|
|
2331
2330
|
},
|
|
@@ -2689,36 +2688,36 @@ var ExportDefaultVariable = /** @class */ (function (_super) {
|
|
|
2689
2688
|
function ExportDefaultVariable(name, exportDefaultDeclaration, deoptimizationTracker) {
|
|
2690
2689
|
var _this = _super.call(this, name, exportDefaultDeclaration, exportDefaultDeclaration.declaration, deoptimizationTracker) || this;
|
|
2691
2690
|
// Not initialised during construction
|
|
2692
|
-
_this.
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2691
|
+
_this.originalId = null;
|
|
2692
|
+
var declaration = exportDefaultDeclaration.declaration;
|
|
2693
|
+
if ((declaration.type === FunctionDeclaration ||
|
|
2694
|
+
declaration.type === ClassDeclaration) &&
|
|
2695
|
+
declaration.id) {
|
|
2696
|
+
_this.hasId = true;
|
|
2697
|
+
_this.originalId = declaration.id;
|
|
2698
|
+
}
|
|
2699
|
+
else if (declaration.type === Identifier) {
|
|
2700
|
+
_this.originalId = declaration;
|
|
2701
|
+
}
|
|
2697
2702
|
return _this;
|
|
2698
2703
|
}
|
|
2699
2704
|
ExportDefaultVariable.prototype.addReference = function (identifier) {
|
|
2700
2705
|
if (!this.hasId) {
|
|
2701
2706
|
this.name = identifier.name;
|
|
2702
|
-
if (this.original !== null) {
|
|
2703
|
-
this.original.addReference(identifier);
|
|
2704
|
-
}
|
|
2705
2707
|
}
|
|
2706
2708
|
};
|
|
2707
2709
|
ExportDefaultVariable.prototype.getName = function (reset) {
|
|
2708
2710
|
if (!reset && this.safeName)
|
|
2709
2711
|
return this.safeName;
|
|
2710
|
-
if (this.
|
|
2711
|
-
return this.
|
|
2712
|
+
if (this.referencesOriginal())
|
|
2713
|
+
return this.originalId.variable.getName();
|
|
2712
2714
|
return this.name;
|
|
2713
2715
|
};
|
|
2714
2716
|
ExportDefaultVariable.prototype.referencesOriginal = function () {
|
|
2715
|
-
return this.
|
|
2717
|
+
return this.originalId && (this.hasId || !this.originalId.variable.isReassigned);
|
|
2716
2718
|
};
|
|
2717
2719
|
ExportDefaultVariable.prototype.getOriginalVariableName = function () {
|
|
2718
|
-
return this.
|
|
2719
|
-
};
|
|
2720
|
-
ExportDefaultVariable.prototype.setOriginalVariable = function (original) {
|
|
2721
|
-
this.original = original;
|
|
2720
|
+
return (this.originalId && this.originalId.name) || null;
|
|
2722
2721
|
};
|
|
2723
2722
|
return ExportDefaultVariable;
|
|
2724
2723
|
}(LocalVariable));
|
|
@@ -9623,151 +9622,6 @@ var FunctionDeclaration$1 = /** @class */ (function (_super) {
|
|
|
9623
9622
|
return FunctionDeclaration$$1;
|
|
9624
9623
|
}(FunctionNode));
|
|
9625
9624
|
|
|
9626
|
-
function isReference(node, parent) {
|
|
9627
|
-
if (node.type === 'MemberExpression') {
|
|
9628
|
-
return !node.computed && isReference(node.object, node);
|
|
9629
|
-
}
|
|
9630
|
-
if (node.type === 'Identifier') {
|
|
9631
|
-
// the only time we could have an identifier node without a parent is
|
|
9632
|
-
// if it's the entire body of a function without a block statement –
|
|
9633
|
-
// i.e. an arrow function expression like `a => a`
|
|
9634
|
-
if (!parent)
|
|
9635
|
-
return true;
|
|
9636
|
-
// TODO is this right?
|
|
9637
|
-
if (parent.type === 'MemberExpression' || parent.type === 'MethodDefinition') {
|
|
9638
|
-
return parent.computed || node === parent.object;
|
|
9639
|
-
}
|
|
9640
|
-
// disregard the `bar` in `{ bar: foo }`, but keep it in `{ [bar]: foo }`
|
|
9641
|
-
if (parent.type === 'Property')
|
|
9642
|
-
return parent.computed || node === parent.value;
|
|
9643
|
-
// disregard the `bar` in `export { foo as bar }`
|
|
9644
|
-
if (parent.type === 'ExportSpecifier' && node !== parent.local)
|
|
9645
|
-
return false;
|
|
9646
|
-
return true;
|
|
9647
|
-
}
|
|
9648
|
-
return false;
|
|
9649
|
-
}
|
|
9650
|
-
|
|
9651
|
-
function isIdentifier(node) {
|
|
9652
|
-
return node.type === Identifier;
|
|
9653
|
-
}
|
|
9654
|
-
var Identifier$1 = /** @class */ (function (_super) {
|
|
9655
|
-
__extends(Identifier$$1, _super);
|
|
9656
|
-
function Identifier$$1() {
|
|
9657
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
9658
|
-
}
|
|
9659
|
-
Identifier$$1.prototype.bind = function () {
|
|
9660
|
-
if (this.bound)
|
|
9661
|
-
return;
|
|
9662
|
-
this.bound = true;
|
|
9663
|
-
if (this.variable === null && isReference(this, this.parent)) {
|
|
9664
|
-
this.variable = this.scope.findVariable(this.name);
|
|
9665
|
-
this.variable.addReference(this);
|
|
9666
|
-
}
|
|
9667
|
-
if (this.variable !== null &&
|
|
9668
|
-
this.variable.isLocal &&
|
|
9669
|
-
this.variable.additionalInitializers !== null) {
|
|
9670
|
-
this.variable.consolidateInitializers();
|
|
9671
|
-
}
|
|
9672
|
-
};
|
|
9673
|
-
Identifier$$1.prototype.declare = function (kind, init) {
|
|
9674
|
-
switch (kind) {
|
|
9675
|
-
case 'var':
|
|
9676
|
-
case 'function':
|
|
9677
|
-
this.variable = this.scope.addDeclaration(this, this.context.deoptimizationTracker, init, true);
|
|
9678
|
-
break;
|
|
9679
|
-
case 'let':
|
|
9680
|
-
case 'const':
|
|
9681
|
-
case 'class':
|
|
9682
|
-
this.variable = this.scope.addDeclaration(this, this.context.deoptimizationTracker, init, false);
|
|
9683
|
-
break;
|
|
9684
|
-
case 'parameter':
|
|
9685
|
-
this.variable = this.scope.addParameterDeclaration(this);
|
|
9686
|
-
break;
|
|
9687
|
-
default:
|
|
9688
|
-
throw new Error("Unexpected identifier kind " + kind + ".");
|
|
9689
|
-
}
|
|
9690
|
-
};
|
|
9691
|
-
Identifier$$1.prototype.getLiteralValueAtPath = function (path$$1, recursionTracker, origin) {
|
|
9692
|
-
if (this.variable !== null) {
|
|
9693
|
-
return this.variable.getLiteralValueAtPath(path$$1, recursionTracker, origin);
|
|
9694
|
-
}
|
|
9695
|
-
return UNKNOWN_VALUE;
|
|
9696
|
-
};
|
|
9697
|
-
Identifier$$1.prototype.getReturnExpressionWhenCalledAtPath = function (path$$1, recursionTracker, origin) {
|
|
9698
|
-
if (this.variable !== null) {
|
|
9699
|
-
return this.variable.getReturnExpressionWhenCalledAtPath(path$$1, recursionTracker, origin);
|
|
9700
|
-
}
|
|
9701
|
-
return UNKNOWN_EXPRESSION;
|
|
9702
|
-
};
|
|
9703
|
-
Identifier$$1.prototype.hasEffectsWhenAccessedAtPath = function (path$$1, options) {
|
|
9704
|
-
return this.variable && this.variable.hasEffectsWhenAccessedAtPath(path$$1, options);
|
|
9705
|
-
};
|
|
9706
|
-
Identifier$$1.prototype.hasEffectsWhenAssignedAtPath = function (path$$1, options) {
|
|
9707
|
-
return !this.variable || this.variable.hasEffectsWhenAssignedAtPath(path$$1, options);
|
|
9708
|
-
};
|
|
9709
|
-
Identifier$$1.prototype.hasEffectsWhenCalledAtPath = function (path$$1, callOptions, options) {
|
|
9710
|
-
return !this.variable || this.variable.hasEffectsWhenCalledAtPath(path$$1, callOptions, options);
|
|
9711
|
-
};
|
|
9712
|
-
Identifier$$1.prototype.include = function () {
|
|
9713
|
-
if (!this.included) {
|
|
9714
|
-
this.included = true;
|
|
9715
|
-
if (this.variable !== null && !this.variable.included) {
|
|
9716
|
-
this.variable.include();
|
|
9717
|
-
this.context.requestTreeshakingPass();
|
|
9718
|
-
}
|
|
9719
|
-
}
|
|
9720
|
-
};
|
|
9721
|
-
Identifier$$1.prototype.initialise = function () {
|
|
9722
|
-
this.included = false;
|
|
9723
|
-
this.bound = false;
|
|
9724
|
-
// To avoid later shape mutations
|
|
9725
|
-
if (!this.variable) {
|
|
9726
|
-
this.variable = null;
|
|
9727
|
-
}
|
|
9728
|
-
};
|
|
9729
|
-
Identifier$$1.prototype.deoptimizePath = function (path$$1) {
|
|
9730
|
-
if (!this.bound)
|
|
9731
|
-
this.bind();
|
|
9732
|
-
if (this.variable !== null) {
|
|
9733
|
-
if (path$$1.length === 0 &&
|
|
9734
|
-
this.name in this.context.imports &&
|
|
9735
|
-
!this.scope.contains(this.name)) {
|
|
9736
|
-
this.disallowImportReassignment();
|
|
9737
|
-
}
|
|
9738
|
-
this.variable.deoptimizePath(path$$1);
|
|
9739
|
-
}
|
|
9740
|
-
};
|
|
9741
|
-
Identifier$$1.prototype.render = function (code, _options, _a) {
|
|
9742
|
-
var _b = _a === void 0 ? BLANK : _a, renderedParentType = _b.renderedParentType, isCalleeOfRenderedParent = _b.isCalleeOfRenderedParent, isShorthandProperty = _b.isShorthandProperty;
|
|
9743
|
-
if (this.variable) {
|
|
9744
|
-
var name = this.variable.getName();
|
|
9745
|
-
if (name !== this.name) {
|
|
9746
|
-
code.overwrite(this.start, this.end, name, {
|
|
9747
|
-
storeName: true,
|
|
9748
|
-
contentOnly: true
|
|
9749
|
-
});
|
|
9750
|
-
if (isShorthandProperty) {
|
|
9751
|
-
code.prependRight(this.start, this.name + ": ");
|
|
9752
|
-
}
|
|
9753
|
-
}
|
|
9754
|
-
// In strict mode, any variable named "eval" must be the actual "eval" function
|
|
9755
|
-
if (name === 'eval' &&
|
|
9756
|
-
renderedParentType === CallExpression &&
|
|
9757
|
-
isCalleeOfRenderedParent) {
|
|
9758
|
-
code.appendRight(this.start, '0, ');
|
|
9759
|
-
}
|
|
9760
|
-
}
|
|
9761
|
-
};
|
|
9762
|
-
Identifier$$1.prototype.disallowImportReassignment = function () {
|
|
9763
|
-
this.context.error({
|
|
9764
|
-
code: 'ILLEGAL_REASSIGNMENT',
|
|
9765
|
-
message: "Illegal reassignment to import '" + this.name + "'"
|
|
9766
|
-
}, this.start);
|
|
9767
|
-
};
|
|
9768
|
-
return Identifier$$1;
|
|
9769
|
-
}(NodeBase));
|
|
9770
|
-
|
|
9771
9625
|
var WHITESPACE = /\s/;
|
|
9772
9626
|
// The header ends at the first non-white-space after "default"
|
|
9773
9627
|
function getDeclarationStart(code, start) {
|
|
@@ -9795,16 +9649,6 @@ var ExportDefaultDeclaration$1 = /** @class */ (function (_super) {
|
|
|
9795
9649
|
function ExportDefaultDeclaration$$1() {
|
|
9796
9650
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
9797
9651
|
}
|
|
9798
|
-
ExportDefaultDeclaration$$1.prototype.bind = function () {
|
|
9799
|
-
_super.prototype.bind.call(this);
|
|
9800
|
-
if (this.declarationName &&
|
|
9801
|
-
// Do not set it for Class and FunctionExpressions otherwise they get treeshaken away
|
|
9802
|
-
(isFunctionDeclaration(this.declaration) ||
|
|
9803
|
-
isClassDeclaration(this.declaration) ||
|
|
9804
|
-
isIdentifier(this.declaration))) {
|
|
9805
|
-
this.variable.setOriginalVariable(this.scope.findVariable(this.declarationName));
|
|
9806
|
-
}
|
|
9807
|
-
};
|
|
9808
9652
|
ExportDefaultDeclaration$$1.prototype.initialise = function () {
|
|
9809
9653
|
this.included = false;
|
|
9810
9654
|
this.declarationName =
|
|
@@ -10226,6 +10070,151 @@ var ImmutableEntityPathTracker = /** @class */ (function () {
|
|
|
10226
10070
|
}());
|
|
10227
10071
|
var EMPTY_IMMUTABLE_TRACKER = new ImmutableEntityPathTracker();
|
|
10228
10072
|
|
|
10073
|
+
function isReference(node, parent) {
|
|
10074
|
+
if (node.type === 'MemberExpression') {
|
|
10075
|
+
return !node.computed && isReference(node.object, node);
|
|
10076
|
+
}
|
|
10077
|
+
if (node.type === 'Identifier') {
|
|
10078
|
+
// the only time we could have an identifier node without a parent is
|
|
10079
|
+
// if it's the entire body of a function without a block statement –
|
|
10080
|
+
// i.e. an arrow function expression like `a => a`
|
|
10081
|
+
if (!parent)
|
|
10082
|
+
return true;
|
|
10083
|
+
// TODO is this right?
|
|
10084
|
+
if (parent.type === 'MemberExpression' || parent.type === 'MethodDefinition') {
|
|
10085
|
+
return parent.computed || node === parent.object;
|
|
10086
|
+
}
|
|
10087
|
+
// disregard the `bar` in `{ bar: foo }`, but keep it in `{ [bar]: foo }`
|
|
10088
|
+
if (parent.type === 'Property')
|
|
10089
|
+
return parent.computed || node === parent.value;
|
|
10090
|
+
// disregard the `bar` in `export { foo as bar }`
|
|
10091
|
+
if (parent.type === 'ExportSpecifier' && node !== parent.local)
|
|
10092
|
+
return false;
|
|
10093
|
+
return true;
|
|
10094
|
+
}
|
|
10095
|
+
return false;
|
|
10096
|
+
}
|
|
10097
|
+
|
|
10098
|
+
function isIdentifier(node) {
|
|
10099
|
+
return node.type === Identifier;
|
|
10100
|
+
}
|
|
10101
|
+
var Identifier$1 = /** @class */ (function (_super) {
|
|
10102
|
+
__extends(Identifier$$1, _super);
|
|
10103
|
+
function Identifier$$1() {
|
|
10104
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
10105
|
+
}
|
|
10106
|
+
Identifier$$1.prototype.bind = function () {
|
|
10107
|
+
if (this.bound)
|
|
10108
|
+
return;
|
|
10109
|
+
this.bound = true;
|
|
10110
|
+
if (this.variable === null && isReference(this, this.parent)) {
|
|
10111
|
+
this.variable = this.scope.findVariable(this.name);
|
|
10112
|
+
this.variable.addReference(this);
|
|
10113
|
+
}
|
|
10114
|
+
if (this.variable !== null &&
|
|
10115
|
+
this.variable.isLocal &&
|
|
10116
|
+
this.variable.additionalInitializers !== null) {
|
|
10117
|
+
this.variable.consolidateInitializers();
|
|
10118
|
+
}
|
|
10119
|
+
};
|
|
10120
|
+
Identifier$$1.prototype.declare = function (kind, init) {
|
|
10121
|
+
switch (kind) {
|
|
10122
|
+
case 'var':
|
|
10123
|
+
case 'function':
|
|
10124
|
+
this.variable = this.scope.addDeclaration(this, this.context.deoptimizationTracker, init, true);
|
|
10125
|
+
break;
|
|
10126
|
+
case 'let':
|
|
10127
|
+
case 'const':
|
|
10128
|
+
case 'class':
|
|
10129
|
+
this.variable = this.scope.addDeclaration(this, this.context.deoptimizationTracker, init, false);
|
|
10130
|
+
break;
|
|
10131
|
+
case 'parameter':
|
|
10132
|
+
this.variable = this.scope.addParameterDeclaration(this);
|
|
10133
|
+
break;
|
|
10134
|
+
default:
|
|
10135
|
+
throw new Error("Unexpected identifier kind " + kind + ".");
|
|
10136
|
+
}
|
|
10137
|
+
};
|
|
10138
|
+
Identifier$$1.prototype.getLiteralValueAtPath = function (path$$1, recursionTracker, origin) {
|
|
10139
|
+
if (this.variable !== null) {
|
|
10140
|
+
return this.variable.getLiteralValueAtPath(path$$1, recursionTracker, origin);
|
|
10141
|
+
}
|
|
10142
|
+
return UNKNOWN_VALUE;
|
|
10143
|
+
};
|
|
10144
|
+
Identifier$$1.prototype.getReturnExpressionWhenCalledAtPath = function (path$$1, recursionTracker, origin) {
|
|
10145
|
+
if (this.variable !== null) {
|
|
10146
|
+
return this.variable.getReturnExpressionWhenCalledAtPath(path$$1, recursionTracker, origin);
|
|
10147
|
+
}
|
|
10148
|
+
return UNKNOWN_EXPRESSION;
|
|
10149
|
+
};
|
|
10150
|
+
Identifier$$1.prototype.hasEffectsWhenAccessedAtPath = function (path$$1, options) {
|
|
10151
|
+
return this.variable && this.variable.hasEffectsWhenAccessedAtPath(path$$1, options);
|
|
10152
|
+
};
|
|
10153
|
+
Identifier$$1.prototype.hasEffectsWhenAssignedAtPath = function (path$$1, options) {
|
|
10154
|
+
return !this.variable || this.variable.hasEffectsWhenAssignedAtPath(path$$1, options);
|
|
10155
|
+
};
|
|
10156
|
+
Identifier$$1.prototype.hasEffectsWhenCalledAtPath = function (path$$1, callOptions, options) {
|
|
10157
|
+
return !this.variable || this.variable.hasEffectsWhenCalledAtPath(path$$1, callOptions, options);
|
|
10158
|
+
};
|
|
10159
|
+
Identifier$$1.prototype.include = function () {
|
|
10160
|
+
if (!this.included) {
|
|
10161
|
+
this.included = true;
|
|
10162
|
+
if (this.variable !== null && !this.variable.included) {
|
|
10163
|
+
this.variable.include();
|
|
10164
|
+
this.context.requestTreeshakingPass();
|
|
10165
|
+
}
|
|
10166
|
+
}
|
|
10167
|
+
};
|
|
10168
|
+
Identifier$$1.prototype.initialise = function () {
|
|
10169
|
+
this.included = false;
|
|
10170
|
+
this.bound = false;
|
|
10171
|
+
// To avoid later shape mutations
|
|
10172
|
+
if (!this.variable) {
|
|
10173
|
+
this.variable = null;
|
|
10174
|
+
}
|
|
10175
|
+
};
|
|
10176
|
+
Identifier$$1.prototype.deoptimizePath = function (path$$1) {
|
|
10177
|
+
if (!this.bound)
|
|
10178
|
+
this.bind();
|
|
10179
|
+
if (this.variable !== null) {
|
|
10180
|
+
if (path$$1.length === 0 &&
|
|
10181
|
+
this.name in this.context.imports &&
|
|
10182
|
+
!this.scope.contains(this.name)) {
|
|
10183
|
+
this.disallowImportReassignment();
|
|
10184
|
+
}
|
|
10185
|
+
this.variable.deoptimizePath(path$$1);
|
|
10186
|
+
}
|
|
10187
|
+
};
|
|
10188
|
+
Identifier$$1.prototype.render = function (code, _options, _a) {
|
|
10189
|
+
var _b = _a === void 0 ? BLANK : _a, renderedParentType = _b.renderedParentType, isCalleeOfRenderedParent = _b.isCalleeOfRenderedParent, isShorthandProperty = _b.isShorthandProperty;
|
|
10190
|
+
if (this.variable) {
|
|
10191
|
+
var name = this.variable.getName();
|
|
10192
|
+
if (name !== this.name) {
|
|
10193
|
+
code.overwrite(this.start, this.end, name, {
|
|
10194
|
+
storeName: true,
|
|
10195
|
+
contentOnly: true
|
|
10196
|
+
});
|
|
10197
|
+
if (isShorthandProperty) {
|
|
10198
|
+
code.prependRight(this.start, this.name + ": ");
|
|
10199
|
+
}
|
|
10200
|
+
}
|
|
10201
|
+
// In strict mode, any variable named "eval" must be the actual "eval" function
|
|
10202
|
+
if (name === 'eval' &&
|
|
10203
|
+
renderedParentType === CallExpression &&
|
|
10204
|
+
isCalleeOfRenderedParent) {
|
|
10205
|
+
code.appendRight(this.start, '0, ');
|
|
10206
|
+
}
|
|
10207
|
+
}
|
|
10208
|
+
};
|
|
10209
|
+
Identifier$$1.prototype.disallowImportReassignment = function () {
|
|
10210
|
+
this.context.error({
|
|
10211
|
+
code: 'ILLEGAL_REASSIGNMENT',
|
|
10212
|
+
message: "Illegal reassignment to import '" + this.name + "'"
|
|
10213
|
+
}, this.start);
|
|
10214
|
+
};
|
|
10215
|
+
return Identifier$$1;
|
|
10216
|
+
}(NodeBase));
|
|
10217
|
+
|
|
10229
10218
|
var CallExpression$1 = /** @class */ (function (_super) {
|
|
10230
10219
|
__extends(CallExpression, _super);
|
|
10231
10220
|
function CallExpression() {
|
|
@@ -10245,7 +10234,7 @@ var CallExpression$1 = /** @class */ (function (_super) {
|
|
|
10245
10234
|
this.context.warn({
|
|
10246
10235
|
code: 'EVAL',
|
|
10247
10236
|
message: "Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification",
|
|
10248
|
-
url: 'https://
|
|
10237
|
+
url: 'https://rollupjs.org/guide/en#avoiding-eval'
|
|
10249
10238
|
}, this.start);
|
|
10250
10239
|
}
|
|
10251
10240
|
}
|
|
@@ -11395,7 +11384,7 @@ var MemberExpression$1 = /** @class */ (function (_super) {
|
|
|
11395
11384
|
importer: relativeId(this.context.fileName),
|
|
11396
11385
|
exporter: relativeId(fileName),
|
|
11397
11386
|
message: "'" + exportName + "' is not exported by '" + relativeId(fileName) + "'",
|
|
11398
|
-
url: "https://
|
|
11387
|
+
url: "https://rollupjs.org/guide/en#error-name-is-not-exported-by-module-"
|
|
11399
11388
|
}, path$$1[0].pos);
|
|
11400
11389
|
return 'undefined';
|
|
11401
11390
|
}
|
|
@@ -12181,7 +12170,7 @@ var TaggedTemplateExpression$1 = /** @class */ (function (_super) {
|
|
|
12181
12170
|
this.context.warn({
|
|
12182
12171
|
code: 'EVAL',
|
|
12183
12172
|
message: "Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification",
|
|
12184
|
-
url: 'https://
|
|
12173
|
+
url: 'https://rollupjs.org/guide/en#avoiding-eval'
|
|
12185
12174
|
}, this.start);
|
|
12186
12175
|
}
|
|
12187
12176
|
}
|
|
@@ -12255,7 +12244,7 @@ var ThisExpression$1 = /** @class */ (function (_super) {
|
|
|
12255
12244
|
this.context.warn({
|
|
12256
12245
|
code: 'THIS_IS_UNDEFINED',
|
|
12257
12246
|
message: "The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten",
|
|
12258
|
-
url: "https://
|
|
12247
|
+
url: "https://rollupjs.org/guide/en#error-this-is-undefined"
|
|
12259
12248
|
}, this.start);
|
|
12260
12249
|
}
|
|
12261
12250
|
};
|
|
@@ -12394,14 +12383,11 @@ var VariableDeclaration$1 = /** @class */ (function (_super) {
|
|
|
12394
12383
|
return false;
|
|
12395
12384
|
};
|
|
12396
12385
|
VariableDeclaration$$1.prototype.includeWithAllDeclaredVariables = function () {
|
|
12397
|
-
var anotherPassNeeded = false;
|
|
12398
12386
|
this.included = true;
|
|
12399
12387
|
for (var _i = 0, _a = this.declarations; _i < _a.length; _i++) {
|
|
12400
12388
|
var declarator = _a[_i];
|
|
12401
|
-
|
|
12402
|
-
anotherPassNeeded = true;
|
|
12389
|
+
declarator.include();
|
|
12403
12390
|
}
|
|
12404
|
-
return anotherPassNeeded;
|
|
12405
12391
|
};
|
|
12406
12392
|
VariableDeclaration$$1.prototype.include = function () {
|
|
12407
12393
|
this.included = true;
|
|
@@ -12771,10 +12757,13 @@ var NamespaceVariable = /** @class */ (function (_super) {
|
|
|
12771
12757
|
_this.needsNamespaceBlock = false;
|
|
12772
12758
|
_this.referencedEarly = false;
|
|
12773
12759
|
_this.references = [];
|
|
12760
|
+
_this.containsExternalNamespace = false;
|
|
12774
12761
|
_this.context = context;
|
|
12775
12762
|
_this.module = module;
|
|
12776
12763
|
for (var _i = 0, _a = _this.context.getExports().concat(_this.context.getReexports()); _i < _a.length; _i++) {
|
|
12777
12764
|
var name = _a[_i];
|
|
12765
|
+
if (name[0] === '*' && name.length > 1)
|
|
12766
|
+
_this.containsExternalNamespace = true;
|
|
12778
12767
|
_this.originals[name] = _this.context.traceExport(name);
|
|
12779
12768
|
}
|
|
12780
12769
|
return _this;
|
|
@@ -12785,6 +12774,13 @@ var NamespaceVariable = /** @class */ (function (_super) {
|
|
|
12785
12774
|
};
|
|
12786
12775
|
NamespaceVariable.prototype.include = function () {
|
|
12787
12776
|
if (!this.included) {
|
|
12777
|
+
if (this.containsExternalNamespace) {
|
|
12778
|
+
this.context.error({
|
|
12779
|
+
code: 'NAMESPACE_CANNOT_CONTAIN_EXTERNAL',
|
|
12780
|
+
message: "Cannot create an explicit namespace object for module \"" + this.context.getModuleName() + "\" because it contains a reexported external namespace",
|
|
12781
|
+
id: this.module.id
|
|
12782
|
+
}, undefined);
|
|
12783
|
+
}
|
|
12788
12784
|
this.context.includeNamespace();
|
|
12789
12785
|
this.included = true;
|
|
12790
12786
|
this.needsNamespaceBlock = true;
|
|
@@ -13052,7 +13048,7 @@ function handleMissingExport(exportName, importingModule, importedModule, import
|
|
|
13052
13048
|
importingModule.error({
|
|
13053
13049
|
code: 'MISSING_EXPORT',
|
|
13054
13050
|
message: "'" + exportName + "' is not exported by " + relativeId(importedModule),
|
|
13055
|
-
url: "https://
|
|
13051
|
+
url: "https://rollupjs.org/guide/en#error-name-is-not-exported-by-module-"
|
|
13056
13052
|
}, importerStart);
|
|
13057
13053
|
}
|
|
13058
13054
|
var Module = /** @class */ (function () {
|
|
@@ -13180,9 +13176,6 @@ var Module = /** @class */ (function () {
|
|
|
13180
13176
|
// export default function foo () {}
|
|
13181
13177
|
// export default foo;
|
|
13182
13178
|
// export default 42;
|
|
13183
|
-
var identifier = (node.declaration.id &&
|
|
13184
|
-
node.declaration.id.name) ||
|
|
13185
|
-
node.declaration.name;
|
|
13186
13179
|
if (this.exports.default) {
|
|
13187
13180
|
this.error({
|
|
13188
13181
|
code: 'DUPLICATE_EXPORT',
|
|
@@ -13191,7 +13184,7 @@ var Module = /** @class */ (function () {
|
|
|
13191
13184
|
}
|
|
13192
13185
|
this.exports.default = {
|
|
13193
13186
|
localName: 'default',
|
|
13194
|
-
identifier:
|
|
13187
|
+
identifier: node.variable.getOriginalVariableName(),
|
|
13195
13188
|
node: node
|
|
13196
13189
|
};
|
|
13197
13190
|
}
|
|
@@ -13682,7 +13675,7 @@ function collapseSourcemaps(bundle, file, map, modules, bundleSourcemapChain) {
|
|
|
13682
13675
|
code: 'SOURCEMAP_BROKEN',
|
|
13683
13676
|
plugin: map.plugin,
|
|
13684
13677
|
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",
|
|
13685
|
-
url: "https://
|
|
13678
|
+
url: "https://rollupjs.org/guide/en#warning-sourcemap-is-likely-to-be-incorrect"
|
|
13686
13679
|
});
|
|
13687
13680
|
map = {
|
|
13688
13681
|
names: [],
|
|
@@ -13969,7 +13962,8 @@ var Chunk$1 = /** @class */ (function () {
|
|
|
13969
13962
|
for (var _i = 0, entryExportEntries_1 = entryExportEntries; _i < entryExportEntries_1.length; _i++) {
|
|
13970
13963
|
var _a = entryExportEntries_1[_i], index = _a[0], exportName = _a[1];
|
|
13971
13964
|
var traced = this.traceExport(exportName, this.entryModule);
|
|
13972
|
-
if (
|
|
13965
|
+
if (!traced ||
|
|
13966
|
+
(traced.variable && !traced.variable.included && !traced.variable.isExternal)) {
|
|
13973
13967
|
continue;
|
|
13974
13968
|
}
|
|
13975
13969
|
tracedExports[index] = traced;
|
|
@@ -14056,7 +14050,7 @@ var Chunk$1 = /** @class */ (function () {
|
|
|
14056
14050
|
// trace a module export to its exposed chunk module export
|
|
14057
14051
|
// either in this chunk or in another
|
|
14058
14052
|
Chunk.prototype.traceExport = function (name, module) {
|
|
14059
|
-
if (name === '*' || module instanceof ExternalModule) {
|
|
14053
|
+
if (name[0] === '*' || module instanceof ExternalModule) {
|
|
14060
14054
|
return { variable: module.traceExport(name), module: module };
|
|
14061
14055
|
}
|
|
14062
14056
|
if (module.chunk !== this) {
|
|
@@ -14083,10 +14077,6 @@ var Chunk$1 = /** @class */ (function () {
|
|
|
14083
14077
|
if (name === 'default') {
|
|
14084
14078
|
return;
|
|
14085
14079
|
}
|
|
14086
|
-
// external star exports
|
|
14087
|
-
if (name[0] === '*') {
|
|
14088
|
-
return { variable: undefined, module: this.graph.moduleById.get(name.substr(1)) };
|
|
14089
|
-
}
|
|
14090
14080
|
// resolve known star exports
|
|
14091
14081
|
for (var i = 0; i < module.exportAllModules.length; i++) {
|
|
14092
14082
|
var exportAllModule = module.exportAllModules[i];
|
|
@@ -20624,7 +20614,7 @@ function Uint8ArrayEqual(bufferA, bufferB) {
|
|
|
20624
20614
|
return true;
|
|
20625
20615
|
}
|
|
20626
20616
|
|
|
20627
|
-
var version$1 = "0.66.
|
|
20617
|
+
var version$1 = "0.66.6";
|
|
20628
20618
|
|
|
20629
20619
|
function mkdirpath(path$$1) {
|
|
20630
20620
|
var dir = path.dirname(path$$1);
|
|
@@ -20703,7 +20693,7 @@ function createResolveId(options) {
|
|
|
20703
20693
|
error({
|
|
20704
20694
|
code: 'MISSING_PROCESS',
|
|
20705
20695
|
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",
|
|
20706
|
-
url: 'https://
|
|
20696
|
+
url: 'https://rollupjs.org/guide/en#a-simple-example'
|
|
20707
20697
|
});
|
|
20708
20698
|
}
|
|
20709
20699
|
// external modules (non-entry modules that start with neither '.' or '/')
|
|
@@ -21024,7 +21014,7 @@ function uncacheablePluginError(pluginName) {
|
|
|
21024
21014
|
else
|
|
21025
21015
|
error({
|
|
21026
21016
|
code: 'DUPLICATE_PLUGIN_NAME',
|
|
21027
|
-
message:
|
|
21017
|
+
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)."
|
|
21028
21018
|
});
|
|
21029
21019
|
}
|
|
21030
21020
|
var uncacheablePlugin = function (pluginName) { return ({
|
|
@@ -21868,7 +21858,7 @@ var Graph = /** @class */ (function () {
|
|
|
21868
21858
|
source: source,
|
|
21869
21859
|
importer: relativeId(module.id),
|
|
21870
21860
|
message: "'" + source + "' is imported by " + relativeId(module.id) + ", but could not be resolved \u2013 treating it as an external dependency",
|
|
21871
|
-
url: 'https://
|
|
21861
|
+
url: 'https://rollupjs.org/guide/en#warning-treating-module-as-external-dependency'
|
|
21872
21862
|
});
|
|
21873
21863
|
}
|
|
21874
21864
|
isExternal = true;
|
|
@@ -22003,8 +21993,8 @@ function getExportMode(chunk, _a) {
|
|
|
22003
21993
|
chunk.graph.warn({
|
|
22004
21994
|
code: 'MIXED_EXPORTS',
|
|
22005
21995
|
message: "Using named and default exports together. Consumers of your bundle will have to use " + (name ||
|
|
22006
|
-
'bundle') + "['default'] to access the default export, which may not be what you want. Use `exports: 'named'` to disable this warning",
|
|
22007
|
-
url: "https://rollupjs.org
|
|
21996
|
+
'bundle') + "['default'] to access the default export, which may not be what you want. Use `output.exports: 'named'` to disable this warning",
|
|
21997
|
+
url: "https://rollupjs.org/guide/en#output-exports-exports"
|
|
22008
21998
|
});
|
|
22009
21999
|
}
|
|
22010
22000
|
exportMode = 'named';
|
|
@@ -22013,7 +22003,8 @@ function getExportMode(chunk, _a) {
|
|
|
22013
22003
|
if (!/(?:default|named|none)/.test(exportMode)) {
|
|
22014
22004
|
error({
|
|
22015
22005
|
code: 'INVALID_EXPORT_OPTION',
|
|
22016
|
-
message: "output.exports must be 'default', 'named', 'none', 'auto', or left unspecified (defaults to 'auto')"
|
|
22006
|
+
message: "output.exports must be 'default', 'named', 'none', 'auto', or left unspecified (defaults to 'auto')",
|
|
22007
|
+
url: "https://rollupjs.org/guide/en#output-exports-exports"
|
|
22017
22008
|
});
|
|
22018
22009
|
}
|
|
22019
22010
|
return exportMode;
|
|
@@ -22363,20 +22354,20 @@ function addDeprecations(deprecations, warn) {
|
|
|
22363
22354
|
}
|
|
22364
22355
|
function checkInputOptions(options) {
|
|
22365
22356
|
if (options.transform || options.load || options.resolveId || options.resolveExternal) {
|
|
22366
|
-
throw new Error('The `transform`, `load`, `resolveId` and `resolveExternal` options are deprecated in favour of a unified plugin API. See https://
|
|
22357
|
+
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');
|
|
22367
22358
|
}
|
|
22368
22359
|
}
|
|
22369
22360
|
function checkOutputOptions(options) {
|
|
22370
22361
|
if (options.format === 'es6') {
|
|
22371
22362
|
error({
|
|
22372
22363
|
message: 'The `es6` output format is deprecated – use `es` instead',
|
|
22373
|
-
url: "https://rollupjs.org
|
|
22364
|
+
url: "https://rollupjs.org/guide/en#output-format-f-format"
|
|
22374
22365
|
});
|
|
22375
22366
|
}
|
|
22376
22367
|
if (!options.format) {
|
|
22377
22368
|
error({
|
|
22378
22369
|
message: "You must specify output.format, which can be one of 'amd', 'cjs', 'system', 'esm', 'iife' or 'umd'",
|
|
22379
|
-
url: "https://rollupjs.org
|
|
22370
|
+
url: "https://rollupjs.org/guide/en#output-format-f-format"
|
|
22380
22371
|
});
|
|
22381
22372
|
}
|
|
22382
22373
|
if (options.moduleId) {
|
|
@@ -22478,6 +22469,8 @@ function rollup(rawInputOptions) {
|
|
|
22478
22469
|
initialiseTimers(inputOptions_1);
|
|
22479
22470
|
var graph_1 = new Graph(inputOptions_1, curWatcher);
|
|
22480
22471
|
curWatcher = undefined;
|
|
22472
|
+
// remove the cache option from the memory after graph creation (cache is not used anymore)
|
|
22473
|
+
delete inputOptions_1.cache;
|
|
22481
22474
|
timeStart('BUILD', 1);
|
|
22482
22475
|
return graph_1.pluginDriver
|
|
22483
22476
|
.hookParallel('buildStart')
|
|
@@ -22572,11 +22565,9 @@ function rollup(rawInputOptions) {
|
|
|
22572
22565
|
optimized = true;
|
|
22573
22566
|
}
|
|
22574
22567
|
// name all chunks
|
|
22568
|
+
var usedIds = {};
|
|
22575
22569
|
for (var i = 0; i < chunks.length; i++) {
|
|
22576
22570
|
var chunk = chunks[i];
|
|
22577
|
-
var imports = chunk.getImportIds();
|
|
22578
|
-
var exports = chunk.getExportNames();
|
|
22579
|
-
var modules = chunk.renderedModules;
|
|
22580
22571
|
if (chunk === singleChunk) {
|
|
22581
22572
|
singleChunk.id = path.basename(outputOptions.file ||
|
|
22582
22573
|
(inputOptions_1.input instanceof Array
|
|
@@ -22596,14 +22587,19 @@ function rollup(rawInputOptions) {
|
|
|
22596
22587
|
pattern = outputOptions.chunkFileNames || '[name]-[hash].js';
|
|
22597
22588
|
patternName = 'output.chunkFileNames';
|
|
22598
22589
|
}
|
|
22599
|
-
chunk.generateId(pattern, patternName, addons, outputOptions,
|
|
22590
|
+
chunk.generateId(pattern, patternName, addons, outputOptions, usedIds);
|
|
22591
|
+
usedIds[chunk.id] = true;
|
|
22600
22592
|
}
|
|
22593
|
+
}
|
|
22594
|
+
// assign to outputBundle
|
|
22595
|
+
for (var i = 0; i < chunks.length; i++) {
|
|
22596
|
+
var chunk = chunks[i];
|
|
22601
22597
|
outputBundle[chunk.id] = {
|
|
22602
22598
|
fileName: chunk.id,
|
|
22603
22599
|
isEntry: chunk.entryModule !== undefined,
|
|
22604
|
-
imports:
|
|
22605
|
-
exports:
|
|
22606
|
-
modules:
|
|
22600
|
+
imports: chunk.getImportIds(),
|
|
22601
|
+
exports: chunk.getExportNames(),
|
|
22602
|
+
modules: chunk.renderedModules,
|
|
22607
22603
|
code: undefined,
|
|
22608
22604
|
map: undefined
|
|
22609
22605
|
};
|