rollup 2.7.2 → 2.7.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 +36 -0
- package/dist/bin/rollup +26 -45
- package/dist/es/rollup.browser.js +3 -3
- package/dist/es/rollup.js +2 -2
- package/dist/es/shared/rollup.js +155 -130
- package/dist/es/shared/watch.js +88 -52
- package/dist/loadConfigFile.js +2 -2
- package/dist/rollup.browser.js +3 -3
- package/dist/rollup.js +2 -2
- package/dist/shared/index.js +246 -210
- package/dist/shared/loadConfigFile.js +3 -3
- package/dist/shared/mergeOptions.js +2 -2
- package/dist/shared/rollup.js +155 -130
- package/dist/shared/watch-cli.js +7 -8
- package/dist/shared/watch.js +7 -8
- package/package.json +12 -12
- package/dist/shared/_util_commonjs-external.js +0 -20
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v2.7.
|
|
4
|
-
|
|
3
|
+
Rollup.js v2.7.6
|
|
4
|
+
Thu, 30 Apr 2020 18:55:10 GMT - commit 468010ba801b1e59573b6aa7319461a449aa43df
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
https://github.com/rollup/rollup
|
|
@@ -552,7 +552,7 @@ async function getConfigList(configFileExport, commandOptions) {
|
|
|
552
552
|
|
|
553
553
|
exports.addCommandPluginsToInputOptions = addCommandPluginsToInputOptions;
|
|
554
554
|
exports.batchWarnings = batchWarnings;
|
|
555
|
-
exports.
|
|
555
|
+
exports.colorette = colorette;
|
|
556
556
|
exports.handleError = handleError;
|
|
557
557
|
exports.loadAndParseConfigFile = loadAndParseConfigFile;
|
|
558
558
|
exports.stderr = stderr;
|
package/dist/shared/rollup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v2.7.
|
|
4
|
-
|
|
3
|
+
Rollup.js v2.7.6
|
|
4
|
+
Thu, 30 Apr 2020 18:55:10 GMT - commit 468010ba801b1e59573b6aa7319461a449aa43df
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
https://github.com/rollup/rollup
|
|
@@ -28,7 +28,7 @@ var crypto = require('crypto');
|
|
|
28
28
|
var fs = require('fs');
|
|
29
29
|
var events = require('events');
|
|
30
30
|
|
|
31
|
-
var version = "2.7.
|
|
31
|
+
var version = "2.7.6";
|
|
32
32
|
|
|
33
33
|
function unwrapExports (x) {
|
|
34
34
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
@@ -5577,13 +5577,28 @@ var acorn = {
|
|
|
5577
5577
|
version: version$1
|
|
5578
5578
|
};
|
|
5579
5579
|
|
|
5580
|
-
var
|
|
5580
|
+
var require$$0 = getCjsExportFromNamespace(acorn);
|
|
5581
5581
|
|
|
5582
|
-
|
|
5583
|
-
|
|
5584
|
-
|
|
5585
|
-
|
|
5586
|
-
|
|
5582
|
+
const getPrototype = Object.getPrototypeOf || (o => o.__proto__);
|
|
5583
|
+
|
|
5584
|
+
const getAcorn = Parser => {
|
|
5585
|
+
if (Parser.acorn) return Parser.acorn
|
|
5586
|
+
|
|
5587
|
+
const acorn = require$$0;
|
|
5588
|
+
|
|
5589
|
+
if (acorn.version.indexOf("6.") != 0 && acorn.version.indexOf("6.0.") == 0 && acorn.version.indexOf("7.") != 0) {
|
|
5590
|
+
throw new Error(`acorn-private-class-elements requires acorn@^6.1.0 or acorn@7.0.0, not ${acorn.version}`)
|
|
5591
|
+
}
|
|
5592
|
+
|
|
5593
|
+
// Make sure `Parser` comes from the same acorn as we `require`d,
|
|
5594
|
+
// otherwise the comparisons fail.
|
|
5595
|
+
for (let cur = Parser; cur && cur !== acorn.Parser; cur = getPrototype(cur)) {
|
|
5596
|
+
if (cur !== acorn.Parser) {
|
|
5597
|
+
throw new Error("acorn-private-class-elements does not support mixing different acorn copies")
|
|
5598
|
+
}
|
|
5599
|
+
}
|
|
5600
|
+
return acorn
|
|
5601
|
+
};
|
|
5587
5602
|
|
|
5588
5603
|
var acornPrivateClassElements = function(Parser) {
|
|
5589
5604
|
// Only load this plugin once.
|
|
@@ -5591,15 +5606,7 @@ var acornPrivateClassElements = function(Parser) {
|
|
|
5591
5606
|
return Parser
|
|
5592
5607
|
}
|
|
5593
5608
|
|
|
5594
|
-
|
|
5595
|
-
// otherwise the comparisons fail.
|
|
5596
|
-
let cur = Parser;
|
|
5597
|
-
while (cur && cur !== acorn$1.Parser) {
|
|
5598
|
-
cur = cur.__proto__;
|
|
5599
|
-
}
|
|
5600
|
-
if (cur !== acorn$1.Parser) {
|
|
5601
|
-
throw new Error("acorn-private-class-elements does not support mixing different acorn copies")
|
|
5602
|
-
}
|
|
5609
|
+
const acorn = getAcorn(Parser);
|
|
5603
5610
|
|
|
5604
5611
|
Parser = class extends Parser {
|
|
5605
5612
|
_branch() {
|
|
@@ -5617,12 +5624,12 @@ var acornPrivateClassElements = function(Parser) {
|
|
|
5617
5624
|
element.key = this.parsePrivateName();
|
|
5618
5625
|
if (element.key.name == "constructor") this.raise(element.key.start, "Classes may not have a private element named constructor");
|
|
5619
5626
|
const accept = {get: "set", set: "get"}[element.kind];
|
|
5620
|
-
const privateBoundNames = this.
|
|
5627
|
+
const privateBoundNames = this._privateBoundNames;
|
|
5621
5628
|
if (Object.prototype.hasOwnProperty.call(privateBoundNames, element.key.name) && privateBoundNames[element.key.name] !== accept) {
|
|
5622
5629
|
this.raise(element.start, "Duplicate private element");
|
|
5623
5630
|
}
|
|
5624
5631
|
privateBoundNames[element.key.name] = element.kind || true;
|
|
5625
|
-
delete this.
|
|
5632
|
+
delete this._unresolvedPrivateNames[element.key.name];
|
|
5626
5633
|
return element.key
|
|
5627
5634
|
}
|
|
5628
5635
|
|
|
@@ -5647,37 +5654,60 @@ var acornPrivateClassElements = function(Parser) {
|
|
|
5647
5654
|
|
|
5648
5655
|
// Manage stacks and check for undeclared private names
|
|
5649
5656
|
parseClass(node, isStatement) {
|
|
5650
|
-
|
|
5651
|
-
|
|
5652
|
-
this.
|
|
5653
|
-
|
|
5654
|
-
|
|
5655
|
-
this.
|
|
5657
|
+
const oldOuterPrivateBoundNames = this._outerPrivateBoundNames;
|
|
5658
|
+
this._outerPrivateBoundNames = this._privateBoundNames;
|
|
5659
|
+
this._privateBoundNames = Object.create(this._privateBoundNames || null);
|
|
5660
|
+
const oldOuterUnresolvedPrivateNames = this._outerUnresolvedPrivateNames;
|
|
5661
|
+
this._outerUnresolvedPrivateNames = this._unresolvedPrivateNames;
|
|
5662
|
+
this._unresolvedPrivateNames = Object.create(null);
|
|
5663
|
+
|
|
5656
5664
|
const _return = super.parseClass(node, isStatement);
|
|
5657
|
-
|
|
5658
|
-
this.
|
|
5659
|
-
|
|
5665
|
+
|
|
5666
|
+
const unresolvedPrivateNames = this._unresolvedPrivateNames;
|
|
5667
|
+
this._privateBoundNames = this._outerPrivateBoundNames;
|
|
5668
|
+
this._outerPrivateBoundNames = oldOuterPrivateBoundNames;
|
|
5669
|
+
this._unresolvedPrivateNames = this._outerUnresolvedPrivateNames;
|
|
5670
|
+
this._outerUnresolvedPrivateNames = oldOuterUnresolvedPrivateNames;
|
|
5671
|
+
if (!this._unresolvedPrivateNames) {
|
|
5660
5672
|
const names = Object.keys(unresolvedPrivateNames);
|
|
5661
5673
|
if (names.length) {
|
|
5662
5674
|
names.sort((n1, n2) => unresolvedPrivateNames[n1] - unresolvedPrivateNames[n2]);
|
|
5663
5675
|
this.raise(unresolvedPrivateNames[names[0]], "Usage of undeclared private name");
|
|
5664
5676
|
}
|
|
5665
|
-
} else Object.assign(this.
|
|
5677
|
+
} else Object.assign(this._unresolvedPrivateNames, unresolvedPrivateNames);
|
|
5678
|
+
return _return
|
|
5679
|
+
}
|
|
5680
|
+
|
|
5681
|
+
// Class heritage is evaluated with outer private environment
|
|
5682
|
+
parseClassSuper(node) {
|
|
5683
|
+
const privateBoundNames = this._privateBoundNames;
|
|
5684
|
+
this._privateBoundNames = this._outerPrivateBoundNames;
|
|
5685
|
+
const unresolvedPrivateNames = this._unresolvedPrivateNames;
|
|
5686
|
+
this._unresolvedPrivateNames = this._outerUnresolvedPrivateNames;
|
|
5687
|
+
const _return = super.parseClassSuper(node);
|
|
5688
|
+
this._privateBoundNames = privateBoundNames;
|
|
5689
|
+
this._unresolvedPrivateNames = unresolvedPrivateNames;
|
|
5666
5690
|
return _return
|
|
5667
5691
|
}
|
|
5668
5692
|
|
|
5669
5693
|
// Parse private element access
|
|
5670
5694
|
parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow) {
|
|
5671
|
-
if (!this.eat(
|
|
5695
|
+
if (!this.eat(acorn.tokTypes.dot)) {
|
|
5672
5696
|
return super.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow)
|
|
5673
5697
|
}
|
|
5674
5698
|
let node = this.startNodeAt(startPos, startLoc);
|
|
5675
5699
|
node.object = base;
|
|
5676
5700
|
node.computed = false;
|
|
5677
5701
|
if (this.type == this.privateNameToken) {
|
|
5702
|
+
if (base.type == "Super") {
|
|
5703
|
+
this.raise(this.start, "Cannot access private element on super");
|
|
5704
|
+
}
|
|
5678
5705
|
node.property = this.parsePrivateName();
|
|
5679
|
-
if (!this.
|
|
5680
|
-
this.
|
|
5706
|
+
if (!this._privateBoundNames || !this._privateBoundNames[node.property.name]) {
|
|
5707
|
+
if (!this._unresolvedPrivateNames) {
|
|
5708
|
+
this.raise(node.property.start, "Usage of undeclared private name");
|
|
5709
|
+
}
|
|
5710
|
+
this._unresolvedPrivateNames[node.property.name] = node.property.start;
|
|
5681
5711
|
}
|
|
5682
5712
|
} else {
|
|
5683
5713
|
node.property = this.parseIdent(true);
|
|
@@ -5696,38 +5726,38 @@ var acornPrivateClassElements = function(Parser) {
|
|
|
5696
5726
|
return _return
|
|
5697
5727
|
}
|
|
5698
5728
|
};
|
|
5699
|
-
Parser.prototype.privateNameToken = new TokenType
|
|
5729
|
+
Parser.prototype.privateNameToken = new acorn.TokenType("privateName");
|
|
5700
5730
|
return Parser
|
|
5701
5731
|
};
|
|
5702
5732
|
|
|
5703
|
-
const tt$1 = acorn$1.tokTypes;
|
|
5704
|
-
|
|
5705
|
-
|
|
5706
|
-
function maybeParseFieldValue(field) {
|
|
5707
|
-
if (this.eat(tt$1.eq)) {
|
|
5708
|
-
const oldInFieldValue = this._inFieldValue;
|
|
5709
|
-
this._inFieldValue = true;
|
|
5710
|
-
field.value = this.parseExpression();
|
|
5711
|
-
this._inFieldValue = oldInFieldValue;
|
|
5712
|
-
} else field.value = null;
|
|
5713
|
-
}
|
|
5714
|
-
|
|
5715
5733
|
var acornClassFields = function(Parser) {
|
|
5734
|
+
const acorn = Parser.acorn || require$$0;
|
|
5735
|
+
const tt = acorn.tokTypes;
|
|
5736
|
+
|
|
5716
5737
|
Parser = acornPrivateClassElements(Parser);
|
|
5717
5738
|
return class extends Parser {
|
|
5739
|
+
_maybeParseFieldValue(field) {
|
|
5740
|
+
if (this.eat(tt.eq)) {
|
|
5741
|
+
const oldInFieldValue = this._inFieldValue;
|
|
5742
|
+
this._inFieldValue = true;
|
|
5743
|
+
field.value = this.parseExpression();
|
|
5744
|
+
this._inFieldValue = oldInFieldValue;
|
|
5745
|
+
} else field.value = null;
|
|
5746
|
+
}
|
|
5747
|
+
|
|
5718
5748
|
// Parse fields
|
|
5719
5749
|
parseClassElement(_constructorAllowsSuper) {
|
|
5720
|
-
if (this.options.ecmaVersion >= 8 && (this.type == tt
|
|
5750
|
+
if (this.options.ecmaVersion >= 8 && (this.type == tt.name || this.type == this.privateNameToken || this.type == tt.bracketL || this.type == tt.string)) {
|
|
5721
5751
|
const branch = this._branch();
|
|
5722
|
-
if (branch.type == tt
|
|
5752
|
+
if (branch.type == tt.bracketL) {
|
|
5723
5753
|
let count = 0;
|
|
5724
5754
|
do {
|
|
5725
|
-
if (branch.eat(tt
|
|
5726
|
-
else if (branch.eat(tt
|
|
5755
|
+
if (branch.eat(tt.bracketL)) ++count;
|
|
5756
|
+
else if (branch.eat(tt.bracketR)) --count;
|
|
5727
5757
|
else branch.next();
|
|
5728
5758
|
} while (count > 0)
|
|
5729
5759
|
} else branch.next();
|
|
5730
|
-
if (branch.type == tt
|
|
5760
|
+
if (branch.type == tt.eq || branch.canInsertSemicolon() || branch.type == tt.semi) {
|
|
5731
5761
|
const node = this.startNode();
|
|
5732
5762
|
if (this.type == this.privateNameToken) {
|
|
5733
5763
|
this.parsePrivateClassElementName(node);
|
|
@@ -5738,8 +5768,8 @@ var acornClassFields = function(Parser) {
|
|
|
5738
5768
|
(node.key.type === "Literal" && node.key.value === "constructor")) {
|
|
5739
5769
|
this.raise(node.key.start, "Classes may not have a field called constructor");
|
|
5740
5770
|
}
|
|
5741
|
-
this.enterScope(
|
|
5742
|
-
|
|
5771
|
+
this.enterScope(64 | 2 | 1); // See acorn's scopeflags.js
|
|
5772
|
+
this._maybeParseFieldValue(node);
|
|
5743
5773
|
this.exitScope();
|
|
5744
5774
|
this.finishNode(node, "FieldDefinition");
|
|
5745
5775
|
this.semicolon();
|
|
@@ -5761,7 +5791,7 @@ var acornClassFields = function(Parser) {
|
|
|
5761
5791
|
|
|
5762
5792
|
const skipWhiteSpace$1 = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;
|
|
5763
5793
|
|
|
5764
|
-
const tt
|
|
5794
|
+
const tt = require$$0.tokTypes;
|
|
5765
5795
|
|
|
5766
5796
|
var acornExportNsFrom = function(Parser) {
|
|
5767
5797
|
return class extends Parser {
|
|
@@ -5773,7 +5803,7 @@ var acornExportNsFrom = function(Parser) {
|
|
|
5773
5803
|
|
|
5774
5804
|
this.next();
|
|
5775
5805
|
const specifier = this.startNode();
|
|
5776
|
-
this.expect(tt
|
|
5806
|
+
this.expect(tt.star);
|
|
5777
5807
|
if (this.eatContextual("as")) {
|
|
5778
5808
|
node.declaration = null;
|
|
5779
5809
|
specifier.exported = this.parseIdent(true);
|
|
@@ -5781,7 +5811,7 @@ var acornExportNsFrom = function(Parser) {
|
|
|
5781
5811
|
node.specifiers = [this.finishNode(specifier, "ExportNamespaceSpecifier")];
|
|
5782
5812
|
}
|
|
5783
5813
|
this.expectContextual("from");
|
|
5784
|
-
if (this.type !== tt
|
|
5814
|
+
if (this.type !== tt.string) this.unexpected();
|
|
5785
5815
|
node.source = this.parseExprAtom();
|
|
5786
5816
|
this.semicolon();
|
|
5787
5817
|
return this.finishNode(node, node.specifiers ? "ExportNamedDeclaration" : "ExportAllDeclaration")
|
|
@@ -5789,7 +5819,7 @@ var acornExportNsFrom = function(Parser) {
|
|
|
5789
5819
|
}
|
|
5790
5820
|
};
|
|
5791
5821
|
|
|
5792
|
-
const tt$
|
|
5822
|
+
const tt$1 = require$$0.tokTypes;
|
|
5793
5823
|
|
|
5794
5824
|
const skipWhiteSpace$2 = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;
|
|
5795
5825
|
|
|
@@ -5803,7 +5833,7 @@ const nextTokenIsDot = parser => {
|
|
|
5803
5833
|
var acornImportMeta = function(Parser) {
|
|
5804
5834
|
return class extends Parser {
|
|
5805
5835
|
parseExprAtom(refDestructuringErrors) {
|
|
5806
|
-
if (this.type !== tt$
|
|
5836
|
+
if (this.type !== tt$1._import || !nextTokenIsDot(this)) return super.parseExprAtom(refDestructuringErrors)
|
|
5807
5837
|
|
|
5808
5838
|
if (!this.options.allowImportExportEverywhere && !this.inModule) {
|
|
5809
5839
|
this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'");
|
|
@@ -5812,7 +5842,7 @@ var acornImportMeta = function(Parser) {
|
|
|
5812
5842
|
let node = this.startNode();
|
|
5813
5843
|
if (this.containsEsc) this.raiseRecoverable(this.start, "Escape sequence in keyword import");
|
|
5814
5844
|
node.meta = this.parseIdent(true);
|
|
5815
|
-
this.expect(tt$
|
|
5845
|
+
this.expect(tt$1.dot);
|
|
5816
5846
|
node.property = this.parseIdent(true);
|
|
5817
5847
|
if (node.property.name !== "meta") {
|
|
5818
5848
|
this.raiseRecoverable(node.property.start, "The only valid meta property for import is import.meta");
|
|
@@ -5824,7 +5854,7 @@ var acornImportMeta = function(Parser) {
|
|
|
5824
5854
|
}
|
|
5825
5855
|
|
|
5826
5856
|
parseStatement(context, topLevel, exports) {
|
|
5827
|
-
if (this.type !== tt$
|
|
5857
|
+
if (this.type !== tt$1._import || !nextTokenIsDot(this)) {
|
|
5828
5858
|
return super.parseStatement(context, topLevel, exports)
|
|
5829
5859
|
}
|
|
5830
5860
|
|
|
@@ -5835,23 +5865,22 @@ var acornImportMeta = function(Parser) {
|
|
|
5835
5865
|
}
|
|
5836
5866
|
};
|
|
5837
5867
|
|
|
5838
|
-
const tt$4 = acorn$1.tokTypes;
|
|
5839
|
-
|
|
5840
|
-
function maybeParseFieldValue$1(field) {
|
|
5841
|
-
if (this.eat(tt$4.eq)) {
|
|
5842
|
-
const oldInFieldValue = this._inStaticFieldValue;
|
|
5843
|
-
this._inStaticFieldValue = true;
|
|
5844
|
-
field.value = this.parseExpression();
|
|
5845
|
-
this._inStaticFieldValue = oldInFieldValue;
|
|
5846
|
-
} else field.value = null;
|
|
5847
|
-
}
|
|
5848
|
-
|
|
5849
|
-
|
|
5850
|
-
|
|
5851
5868
|
var acornStaticClassFeatures = function(Parser) {
|
|
5852
5869
|
const ExtendedParser = acornPrivateClassElements(Parser);
|
|
5853
5870
|
|
|
5871
|
+
const acorn = Parser.acorn || require$$0;
|
|
5872
|
+
const tt = acorn.tokTypes;
|
|
5873
|
+
|
|
5854
5874
|
return class extends ExtendedParser {
|
|
5875
|
+
_maybeParseFieldValue(field) {
|
|
5876
|
+
if (this.eat(tt.eq)) {
|
|
5877
|
+
const oldInFieldValue = this._inStaticFieldValue;
|
|
5878
|
+
this._inStaticFieldValue = true;
|
|
5879
|
+
field.value = this.parseExpression();
|
|
5880
|
+
this._inStaticFieldValue = oldInFieldValue;
|
|
5881
|
+
} else field.value = null;
|
|
5882
|
+
}
|
|
5883
|
+
|
|
5855
5884
|
// Parse fields
|
|
5856
5885
|
parseClassElement(_constructorAllowsSuper) {
|
|
5857
5886
|
if (this.options.ecmaVersion < 8 || !this.isContextual("static")) {
|
|
@@ -5860,18 +5889,18 @@ var acornStaticClassFeatures = function(Parser) {
|
|
|
5860
5889
|
|
|
5861
5890
|
const branch = this._branch();
|
|
5862
5891
|
branch.next();
|
|
5863
|
-
if ([tt
|
|
5892
|
+
if ([tt.name, tt.bracketL, tt.string, this.privateNameToken].indexOf(branch.type) == -1) {
|
|
5864
5893
|
return super.parseClassElement.apply(this, arguments)
|
|
5865
5894
|
}
|
|
5866
|
-
if (branch.type == tt
|
|
5895
|
+
if (branch.type == tt.bracketL) {
|
|
5867
5896
|
let count = 0;
|
|
5868
5897
|
do {
|
|
5869
|
-
if (branch.eat(tt
|
|
5870
|
-
else if (branch.eat(tt
|
|
5898
|
+
if (branch.eat(tt.bracketL)) ++count;
|
|
5899
|
+
else if (branch.eat(tt.bracketR)) --count;
|
|
5871
5900
|
else branch.next();
|
|
5872
5901
|
} while (count > 0)
|
|
5873
5902
|
} else branch.next();
|
|
5874
|
-
if (branch.type != tt
|
|
5903
|
+
if (branch.type != tt.eq && !branch.canInsertSemicolon() && branch.type != tt.semi) {
|
|
5875
5904
|
return super.parseClassElement.apply(this, arguments)
|
|
5876
5905
|
}
|
|
5877
5906
|
|
|
@@ -5890,7 +5919,7 @@ var acornStaticClassFeatures = function(Parser) {
|
|
|
5890
5919
|
this.raise(node.key.start, "Classes may not have a static property named prototype");
|
|
5891
5920
|
}
|
|
5892
5921
|
|
|
5893
|
-
|
|
5922
|
+
this._maybeParseFieldValue(node);
|
|
5894
5923
|
this.finishNode(node, "FieldDefinition");
|
|
5895
5924
|
this.semicolon();
|
|
5896
5925
|
return node
|
|
@@ -10075,15 +10104,15 @@ class FunctionDeclaration extends FunctionNode {
|
|
|
10075
10104
|
|
|
10076
10105
|
const WHITESPACE = /\s/;
|
|
10077
10106
|
// The header ends at the first non-white-space after "default"
|
|
10078
|
-
function getDeclarationStart(code, start
|
|
10107
|
+
function getDeclarationStart(code, start) {
|
|
10079
10108
|
start = findFirstOccurrenceOutsideComment(code, 'default', start) + 7;
|
|
10080
10109
|
while (WHITESPACE.test(code[start]))
|
|
10081
10110
|
start++;
|
|
10082
10111
|
return start;
|
|
10083
10112
|
}
|
|
10084
|
-
function getIdInsertPosition(code, declarationKeyword, start
|
|
10113
|
+
function getIdInsertPosition(code, declarationKeyword, endMarker, start) {
|
|
10085
10114
|
const declarationEnd = findFirstOccurrenceOutsideComment(code, declarationKeyword, start) + declarationKeyword.length;
|
|
10086
|
-
code = code.slice(declarationEnd, findFirstOccurrenceOutsideComment(code,
|
|
10115
|
+
code = code.slice(declarationEnd, findFirstOccurrenceOutsideComment(code, endMarker, declarationEnd));
|
|
10087
10116
|
const generatorStarPos = findFirstOccurrenceOutsideComment(code, '*');
|
|
10088
10117
|
if (generatorStarPos === -1) {
|
|
10089
10118
|
return declarationEnd;
|
|
@@ -10108,19 +10137,14 @@ class ExportDefaultDeclaration extends NodeBase {
|
|
|
10108
10137
|
const { start, end } = nodeRenderOptions;
|
|
10109
10138
|
const declarationStart = getDeclarationStart(code.original, this.start);
|
|
10110
10139
|
if (this.declaration instanceof FunctionDeclaration) {
|
|
10111
|
-
this.renderNamedDeclaration(code, declarationStart, 'function', this.declaration.id === null, options);
|
|
10140
|
+
this.renderNamedDeclaration(code, declarationStart, 'function', '(', this.declaration.id === null, options);
|
|
10112
10141
|
}
|
|
10113
10142
|
else if (this.declaration instanceof ClassDeclaration) {
|
|
10114
|
-
this.renderNamedDeclaration(code, declarationStart, 'class', this.declaration.id === null, options);
|
|
10143
|
+
this.renderNamedDeclaration(code, declarationStart, 'class', '{', this.declaration.id === null, options);
|
|
10115
10144
|
}
|
|
10116
10145
|
else if (this.variable.getOriginalVariable() !== this.variable) {
|
|
10117
10146
|
// Remove altogether to prevent re-declaring the same variable
|
|
10118
|
-
|
|
10119
|
-
code.overwrite(start, end, `exports('${this.variable.exportName}', ${this.variable.getName()});`);
|
|
10120
|
-
}
|
|
10121
|
-
else {
|
|
10122
|
-
treeshakeNode(this, code, start, end);
|
|
10123
|
-
}
|
|
10147
|
+
treeshakeNode(this, code, start, end);
|
|
10124
10148
|
return;
|
|
10125
10149
|
}
|
|
10126
10150
|
else if (this.variable.included) {
|
|
@@ -10139,12 +10163,12 @@ class ExportDefaultDeclaration extends NodeBase {
|
|
|
10139
10163
|
}
|
|
10140
10164
|
this.declaration.render(code, options);
|
|
10141
10165
|
}
|
|
10142
|
-
renderNamedDeclaration(code, declarationStart, declarationKeyword, needsId, options) {
|
|
10166
|
+
renderNamedDeclaration(code, declarationStart, declarationKeyword, endMarker, needsId, options) {
|
|
10143
10167
|
const name = this.variable.getName();
|
|
10144
10168
|
// Remove `export default`
|
|
10145
10169
|
code.remove(this.start, declarationStart);
|
|
10146
10170
|
if (needsId) {
|
|
10147
|
-
code.appendLeft(getIdInsertPosition(code.original, declarationKeyword, declarationStart), ` ${name}`);
|
|
10171
|
+
code.appendLeft(getIdInsertPosition(code.original, declarationKeyword, endMarker, declarationStart), ` ${name}`);
|
|
10148
10172
|
}
|
|
10149
10173
|
if (options.format === 'system' &&
|
|
10150
10174
|
this.declaration instanceof ClassDeclaration &&
|
|
@@ -10226,24 +10250,6 @@ class ExportDefaultVariable extends LocalVariable {
|
|
|
10226
10250
|
}
|
|
10227
10251
|
return this.originalVariable;
|
|
10228
10252
|
}
|
|
10229
|
-
setRenderNames(baseName, name) {
|
|
10230
|
-
const original = this.getOriginalVariable();
|
|
10231
|
-
if (original === this) {
|
|
10232
|
-
super.setRenderNames(baseName, name);
|
|
10233
|
-
}
|
|
10234
|
-
else {
|
|
10235
|
-
original.setRenderNames(baseName, name);
|
|
10236
|
-
}
|
|
10237
|
-
}
|
|
10238
|
-
setSafeName(name) {
|
|
10239
|
-
const original = this.getOriginalVariable();
|
|
10240
|
-
if (original === this) {
|
|
10241
|
-
super.setSafeName(name);
|
|
10242
|
-
}
|
|
10243
|
-
else {
|
|
10244
|
-
original.setSafeName(name);
|
|
10245
|
-
}
|
|
10246
|
-
}
|
|
10247
10253
|
}
|
|
10248
10254
|
|
|
10249
10255
|
const MISSING_EXPORT_SHIM_VARIABLE = '_missingExportShim';
|
|
@@ -10363,14 +10369,16 @@ class SyntheticNamedExportVariable extends Variable {
|
|
|
10363
10369
|
this.module = context.module;
|
|
10364
10370
|
this.defaultVariable = defaultVariable;
|
|
10365
10371
|
}
|
|
10372
|
+
getBaseVariable() {
|
|
10373
|
+
return this.defaultVariable instanceof SyntheticNamedExportVariable
|
|
10374
|
+
? this.defaultVariable.getBaseVariable()
|
|
10375
|
+
: this.defaultVariable;
|
|
10376
|
+
}
|
|
10366
10377
|
getName() {
|
|
10367
10378
|
const name = this.name;
|
|
10368
10379
|
const renderBaseName = this.defaultVariable.getName();
|
|
10369
10380
|
return `${renderBaseName}${getPropertyAccess(name)}`;
|
|
10370
10381
|
}
|
|
10371
|
-
getOriginalVariable() {
|
|
10372
|
-
return this.defaultVariable.getOriginalVariable();
|
|
10373
|
-
}
|
|
10374
10382
|
include() {
|
|
10375
10383
|
if (!this.included) {
|
|
10376
10384
|
this.included = true;
|
|
@@ -15026,17 +15034,29 @@ class Module {
|
|
|
15026
15034
|
if (this.relevantDependencies)
|
|
15027
15035
|
return this.relevantDependencies;
|
|
15028
15036
|
const relevantDependencies = new Set();
|
|
15029
|
-
for (
|
|
15030
|
-
|
|
15031
|
-
|
|
15032
|
-
|
|
15037
|
+
for (let variable of this.imports) {
|
|
15038
|
+
if (variable instanceof SyntheticNamedExportVariable) {
|
|
15039
|
+
variable = variable.getBaseVariable();
|
|
15040
|
+
}
|
|
15041
|
+
else if (variable instanceof ExportDefaultVariable) {
|
|
15042
|
+
variable = variable.getOriginalVariable();
|
|
15043
|
+
}
|
|
15044
|
+
if (variable.module) {
|
|
15045
|
+
relevantDependencies.add(variable.module);
|
|
15046
|
+
}
|
|
15033
15047
|
}
|
|
15034
15048
|
if (this.isEntryPoint || this.dynamicallyImportedBy.length > 0 || this.graph.preserveModules) {
|
|
15035
15049
|
for (const exportName of [...this.getReexports(), ...this.getExports()]) {
|
|
15036
|
-
|
|
15037
|
-
|
|
15038
|
-
|
|
15039
|
-
|
|
15050
|
+
let variable = this.getVariableForExportName(exportName);
|
|
15051
|
+
if (variable instanceof SyntheticNamedExportVariable) {
|
|
15052
|
+
variable = variable.getBaseVariable();
|
|
15053
|
+
}
|
|
15054
|
+
else if (variable instanceof ExportDefaultVariable) {
|
|
15055
|
+
variable = variable.getOriginalVariable();
|
|
15056
|
+
}
|
|
15057
|
+
if (variable.module) {
|
|
15058
|
+
relevantDependencies.add(variable.module);
|
|
15059
|
+
}
|
|
15040
15060
|
}
|
|
15041
15061
|
}
|
|
15042
15062
|
if (this.graph.treeshakingOptions) {
|
|
@@ -15082,7 +15102,10 @@ class Module {
|
|
|
15082
15102
|
}
|
|
15083
15103
|
const exportNamesByVariable = new Map();
|
|
15084
15104
|
for (const exportName of this.getAllExportNames()) {
|
|
15085
|
-
|
|
15105
|
+
let tracedVariable = this.getVariableForExportName(exportName);
|
|
15106
|
+
if (tracedVariable instanceof ExportDefaultVariable) {
|
|
15107
|
+
tracedVariable = tracedVariable.getOriginalVariable();
|
|
15108
|
+
}
|
|
15086
15109
|
if (!tracedVariable ||
|
|
15087
15110
|
!(tracedVariable.included || tracedVariable instanceof ExternalVariable)) {
|
|
15088
15111
|
continue;
|
|
@@ -16493,12 +16516,11 @@ class Chunk$1 {
|
|
|
16493
16516
|
for (const dep of this.dependencies) {
|
|
16494
16517
|
const imports = [];
|
|
16495
16518
|
for (const variable of this.imports) {
|
|
16496
|
-
const renderedVariable = variable instanceof ExportDefaultVariable ? variable.getOriginalVariable() : variable;
|
|
16497
16519
|
if ((variable.module instanceof Module
|
|
16498
16520
|
? variable.module.chunk === dep
|
|
16499
16521
|
: variable.module === dep) &&
|
|
16500
|
-
!renderedImports.has(
|
|
16501
|
-
renderedImports.add(
|
|
16522
|
+
!renderedImports.has(variable)) {
|
|
16523
|
+
renderedImports.add(variable);
|
|
16502
16524
|
imports.push({
|
|
16503
16525
|
imported: variable.module instanceof ExternalModule
|
|
16504
16526
|
? variable.name
|
|
@@ -16702,10 +16724,13 @@ class Chunk$1 {
|
|
|
16702
16724
|
}
|
|
16703
16725
|
setUpChunkImportsAndExportsForModule(module) {
|
|
16704
16726
|
for (let variable of module.imports) {
|
|
16705
|
-
if (variable
|
|
16706
|
-
|
|
16707
|
-
|
|
16708
|
-
|
|
16727
|
+
if (variable instanceof SyntheticNamedExportVariable) {
|
|
16728
|
+
variable = variable.getBaseVariable();
|
|
16729
|
+
}
|
|
16730
|
+
else if (variable instanceof ExportDefaultVariable) {
|
|
16731
|
+
variable = variable.getOriginalVariable();
|
|
16732
|
+
}
|
|
16733
|
+
if (variable.module && variable.module.chunk !== this) {
|
|
16709
16734
|
this.imports.add(variable);
|
|
16710
16735
|
if (!(variable instanceof NamespaceVariable && this.graph.preserveModules) &&
|
|
16711
16736
|
variable.module instanceof Module) {
|
|
@@ -16720,7 +16745,7 @@ class Chunk$1 {
|
|
|
16720
16745
|
this.exports.add(exportedVariable);
|
|
16721
16746
|
const isSynthetic = exportedVariable instanceof SyntheticNamedExportVariable;
|
|
16722
16747
|
const importedVariable = isSynthetic
|
|
16723
|
-
? exportedVariable.
|
|
16748
|
+
? exportedVariable.getBaseVariable()
|
|
16724
16749
|
: exportedVariable;
|
|
16725
16750
|
const exportingModule = importedVariable.module;
|
|
16726
16751
|
if (exportingModule &&
|
package/dist/shared/watch-cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v2.7.
|
|
4
|
-
|
|
3
|
+
Rollup.js v2.7.6
|
|
4
|
+
Thu, 30 Apr 2020 18:55:10 GMT - commit 468010ba801b1e59573b6aa7319461a449aa43df
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
https://github.com/rollup/rollup
|
|
@@ -14,12 +14,11 @@ var cli = require('../bin/rollup');
|
|
|
14
14
|
var rollup_js = require('./rollup.js');
|
|
15
15
|
require('path');
|
|
16
16
|
require('util');
|
|
17
|
-
require('./_util_commonjs-external.js');
|
|
18
17
|
require('./mergeOptions.js');
|
|
19
18
|
var loadConfigFile_js = require('./loadConfigFile.js');
|
|
20
19
|
require('crypto');
|
|
21
20
|
var fs = require('fs');
|
|
22
|
-
require('events');
|
|
21
|
+
var events = require('events');
|
|
23
22
|
require('module');
|
|
24
23
|
require('url');
|
|
25
24
|
var index = require('./index.js');
|
|
@@ -136,7 +135,7 @@ if (process.platform === 'linux') {
|
|
|
136
135
|
var signals$1 = signals;
|
|
137
136
|
var isWin = /^win/i.test(process.platform);
|
|
138
137
|
|
|
139
|
-
var EE =
|
|
138
|
+
var EE = events;
|
|
140
139
|
/* istanbul ignore if */
|
|
141
140
|
if (typeof EE !== 'function') {
|
|
142
141
|
EE = EE.EventEmitter;
|
|
@@ -388,7 +387,7 @@ async function watch(command) {
|
|
|
388
387
|
break;
|
|
389
388
|
case 'START':
|
|
390
389
|
if (!silent) {
|
|
391
|
-
resetScreen(loadConfigFile_js.
|
|
390
|
+
resetScreen(loadConfigFile_js.colorette.underline(`rollup v${rollup_js.version}`));
|
|
392
391
|
}
|
|
393
392
|
break;
|
|
394
393
|
case 'BUNDLE_START':
|
|
@@ -401,13 +400,13 @@ async function watch(command) {
|
|
|
401
400
|
.map(key => input[key])
|
|
402
401
|
.join(', ');
|
|
403
402
|
}
|
|
404
|
-
loadConfigFile_js.stderr(loadConfigFile_js.
|
|
403
|
+
loadConfigFile_js.stderr(loadConfigFile_js.colorette.cyan(`bundles ${loadConfigFile_js.colorette.bold(input)} → ${loadConfigFile_js.colorette.bold(event.output.map(rollup_js.relativeId).join(', '))}...`));
|
|
405
404
|
}
|
|
406
405
|
break;
|
|
407
406
|
case 'BUNDLE_END':
|
|
408
407
|
warnings.flush();
|
|
409
408
|
if (!silent)
|
|
410
|
-
loadConfigFile_js.stderr(loadConfigFile_js.
|
|
409
|
+
loadConfigFile_js.stderr(loadConfigFile_js.colorette.green(`created ${loadConfigFile_js.colorette.bold(event.output.map(rollup_js.relativeId).join(', '))} in ${loadConfigFile_js.colorette.bold(cli.prettyMs(event.duration))}`));
|
|
411
410
|
if (event.result && event.result.getTimings) {
|
|
412
411
|
cli.printTimings(event.result.getTimings());
|
|
413
412
|
}
|