rollup 2.10.5 → 2.10.9
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 +40 -0
- package/dist/bin/rollup +2 -2
- package/dist/es/rollup.browser.js +3 -3
- package/dist/es/rollup.js +2 -2
- package/dist/es/shared/rollup.js +72 -55
- package/dist/es/shared/watch.js +2 -2
- package/dist/loadConfigFile.js +2 -2
- package/dist/rollup.browser.js +3 -3
- package/dist/rollup.js +2 -2
- package/dist/shared/index.js +2 -2
- package/dist/shared/loadConfigFile.js +2 -2
- package/dist/shared/mergeOptions.js +2 -2
- package/dist/shared/rollup.js +72 -55
- package/dist/shared/watch-cli.js +2 -2
- package/dist/shared/watch.js +2 -2
- package/package.json +3 -3
package/dist/rollup.js
CHANGED
package/dist/shared/index.js
CHANGED
package/dist/shared/rollup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v2.10.
|
|
4
|
-
|
|
3
|
+
Rollup.js v2.10.9
|
|
4
|
+
Sun, 24 May 2020 05:27:58 GMT - commit 462bff7b1a0c384ecc3e278b1ea877e637c70f41
|
|
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.10.
|
|
31
|
+
var version = "2.10.9";
|
|
32
32
|
|
|
33
33
|
function unwrapExports (x) {
|
|
34
34
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
@@ -5829,7 +5829,7 @@ var acornClassFields = function(Parser) {
|
|
|
5829
5829
|
|
|
5830
5830
|
// Parse fields
|
|
5831
5831
|
parseClassElement(_constructorAllowsSuper) {
|
|
5832
|
-
if (this.options.ecmaVersion >= 8 && (this.type == tt.name || this.type == this.privateNameToken || this.type == tt.bracketL || this.type == tt.string)) {
|
|
5832
|
+
if (this.options.ecmaVersion >= 8 && (this.type == tt.name || this.type.keyword || this.type == this.privateNameToken || this.type == tt.bracketL || this.type == tt.string || this.type == tt.num)) {
|
|
5833
5833
|
const branch = this._branch();
|
|
5834
5834
|
if (branch.type == tt.bracketL) {
|
|
5835
5835
|
let count = 0;
|
|
@@ -5926,10 +5926,10 @@ var acornStaticClassFeatures = function(Parser) {
|
|
|
5926
5926
|
return class extends ExtendedParser {
|
|
5927
5927
|
_maybeParseFieldValue(field) {
|
|
5928
5928
|
if (this.eat(tt.eq)) {
|
|
5929
|
-
const oldInFieldValue = this.
|
|
5930
|
-
this.
|
|
5929
|
+
const oldInFieldValue = this._inStaticFieldScope;
|
|
5930
|
+
this._inStaticFieldScope = this.currentThisScope();
|
|
5931
5931
|
field.value = this.parseExpression();
|
|
5932
|
-
this.
|
|
5932
|
+
this._inStaticFieldScope = oldInFieldValue;
|
|
5933
5933
|
} else field.value = null;
|
|
5934
5934
|
}
|
|
5935
5935
|
|
|
@@ -5941,7 +5941,7 @@ var acornStaticClassFeatures = function(Parser) {
|
|
|
5941
5941
|
|
|
5942
5942
|
const branch = this._branch();
|
|
5943
5943
|
branch.next();
|
|
5944
|
-
if ([tt.name, tt.bracketL, tt.string, this.privateNameToken].indexOf(branch.type) == -1) {
|
|
5944
|
+
if ([tt.name, tt.bracketL, tt.string, tt.num, this.privateNameToken].indexOf(branch.type) == -1) {
|
|
5945
5945
|
return super.parseClassElement.apply(this, arguments)
|
|
5946
5946
|
}
|
|
5947
5947
|
if (branch.type == tt.bracketL) {
|
|
@@ -5989,7 +5989,9 @@ var acornStaticClassFeatures = function(Parser) {
|
|
|
5989
5989
|
// Prohibit arguments in class field initializers
|
|
5990
5990
|
parseIdent(liberal, isBinding) {
|
|
5991
5991
|
const ident = super.parseIdent(liberal, isBinding);
|
|
5992
|
-
if (this.
|
|
5992
|
+
if (this._inStaticFieldScope && this.currentThisScope() === this._inStaticFieldScope && ident.name == "arguments") {
|
|
5993
|
+
this.raise(ident.start, "A static class field initializer may not contain arguments");
|
|
5994
|
+
}
|
|
5993
5995
|
return ident
|
|
5994
5996
|
}
|
|
5995
5997
|
}
|
|
@@ -7537,6 +7539,7 @@ const BROKEN_FLOW_ERROR_RETURN_LABEL = 2;
|
|
|
7537
7539
|
function createInclusionContext() {
|
|
7538
7540
|
return {
|
|
7539
7541
|
brokenFlow: BROKEN_FLOW_NONE,
|
|
7542
|
+
includedCallArguments: new Set(),
|
|
7540
7543
|
includedLabels: new Set()
|
|
7541
7544
|
};
|
|
7542
7545
|
}
|
|
@@ -7712,13 +7715,15 @@ class LocalVariable extends Variable {
|
|
|
7712
7715
|
}
|
|
7713
7716
|
}
|
|
7714
7717
|
includeCallArguments(context, args) {
|
|
7715
|
-
if (this.isReassigned) {
|
|
7718
|
+
if (this.isReassigned || (this.init && context.includedCallArguments.has(this.init))) {
|
|
7716
7719
|
for (const arg of args) {
|
|
7717
7720
|
arg.include(context, false);
|
|
7718
7721
|
}
|
|
7719
7722
|
}
|
|
7720
7723
|
else if (this.init) {
|
|
7724
|
+
context.includedCallArguments.add(this.init);
|
|
7721
7725
|
this.init.includeCallArguments(context, args);
|
|
7726
|
+
context.includedCallArguments.delete(this.init);
|
|
7722
7727
|
}
|
|
7723
7728
|
}
|
|
7724
7729
|
markCalledFromTryStatement() {
|
|
@@ -10473,9 +10478,14 @@ class SyntheticNamedExportVariable extends Variable {
|
|
|
10473
10478
|
this.defaultVariable = defaultVariable;
|
|
10474
10479
|
}
|
|
10475
10480
|
getBaseVariable() {
|
|
10476
|
-
|
|
10477
|
-
|
|
10478
|
-
|
|
10481
|
+
let baseVariable = this.defaultVariable;
|
|
10482
|
+
if (baseVariable instanceof ExportDefaultVariable) {
|
|
10483
|
+
baseVariable = baseVariable.getOriginalVariable();
|
|
10484
|
+
}
|
|
10485
|
+
if (baseVariable instanceof SyntheticNamedExportVariable) {
|
|
10486
|
+
baseVariable = baseVariable.getBaseVariable();
|
|
10487
|
+
}
|
|
10488
|
+
return baseVariable;
|
|
10479
10489
|
}
|
|
10480
10490
|
getName() {
|
|
10481
10491
|
const name = this.name;
|
|
@@ -16204,11 +16214,12 @@ class Chunk$1 {
|
|
|
16204
16214
|
facadedModule.hasEffects()) {
|
|
16205
16215
|
chunk.dependencies.add(facadedModule.chunk);
|
|
16206
16216
|
}
|
|
16217
|
+
chunk.ensureReexportsAreAvailableForModule(facadedModule);
|
|
16207
16218
|
chunk.facadeModule = facadedModule;
|
|
16208
16219
|
chunk.strictFacade = true;
|
|
16209
16220
|
return chunk;
|
|
16210
16221
|
}
|
|
16211
|
-
canModuleBeFacade(module,
|
|
16222
|
+
canModuleBeFacade(module, exposedVariables) {
|
|
16212
16223
|
const moduleExportNamesByVariable = module.getExportNamesByVariable();
|
|
16213
16224
|
for (const exposedVariable of this.exports) {
|
|
16214
16225
|
if (!moduleExportNamesByVariable.has(exposedVariable)) {
|
|
@@ -16226,7 +16237,7 @@ class Chunk$1 {
|
|
|
16226
16237
|
return false;
|
|
16227
16238
|
}
|
|
16228
16239
|
}
|
|
16229
|
-
for (const exposedVariable of
|
|
16240
|
+
for (const exposedVariable of exposedVariables) {
|
|
16230
16241
|
if (!(moduleExportNamesByVariable.has(exposedVariable) || exposedVariable.module === module)) {
|
|
16231
16242
|
return false;
|
|
16232
16243
|
}
|
|
@@ -16260,7 +16271,14 @@ class Chunk$1 {
|
|
|
16260
16271
|
const facades = [];
|
|
16261
16272
|
const dynamicEntryModules = this.dynamicEntryModules.filter(module => module.includedDynamicImporters.some(importingModule => importingModule.chunk !== this));
|
|
16262
16273
|
this.isDynamicEntry = dynamicEntryModules.length > 0;
|
|
16263
|
-
const
|
|
16274
|
+
const exposedVariables = new Set(dynamicEntryModules.map(module => module.namespace));
|
|
16275
|
+
for (const module of this.entryModules) {
|
|
16276
|
+
if (module.preserveSignature) {
|
|
16277
|
+
for (const exportedVariable of module.getExportNamesByVariable().keys()) {
|
|
16278
|
+
exposedVariables.add(exportedVariable);
|
|
16279
|
+
}
|
|
16280
|
+
}
|
|
16281
|
+
}
|
|
16264
16282
|
for (const module of this.entryModules) {
|
|
16265
16283
|
const requiredFacades = [...module.userChunkNames].map(name => ({
|
|
16266
16284
|
name
|
|
@@ -16275,10 +16293,13 @@ class Chunk$1 {
|
|
|
16275
16293
|
if (!this.facadeModule &&
|
|
16276
16294
|
(this.graph.preserveModules ||
|
|
16277
16295
|
module.preserveSignature !== 'strict' ||
|
|
16278
|
-
this.canModuleBeFacade(module,
|
|
16296
|
+
this.canModuleBeFacade(module, exposedVariables))) {
|
|
16279
16297
|
this.facadeModule = module;
|
|
16280
16298
|
module.facadeChunk = this;
|
|
16281
|
-
|
|
16299
|
+
if (module.preserveSignature) {
|
|
16300
|
+
this.strictFacade = module.preserveSignature === 'strict';
|
|
16301
|
+
this.ensureReexportsAreAvailableForModule(module);
|
|
16302
|
+
}
|
|
16282
16303
|
this.assignFacadeName(requiredFacades.shift(), module);
|
|
16283
16304
|
}
|
|
16284
16305
|
for (const facadeName of requiredFacades) {
|
|
@@ -16286,7 +16307,7 @@ class Chunk$1 {
|
|
|
16286
16307
|
}
|
|
16287
16308
|
}
|
|
16288
16309
|
for (const module of dynamicEntryModules) {
|
|
16289
|
-
if (!this.facadeModule && this.canModuleBeFacade(module,
|
|
16310
|
+
if (!this.facadeModule && this.canModuleBeFacade(module, exposedVariables)) {
|
|
16290
16311
|
this.facadeModule = module;
|
|
16291
16312
|
module.facadeChunk = this;
|
|
16292
16313
|
this.strictFacade = true;
|
|
@@ -16294,7 +16315,7 @@ class Chunk$1 {
|
|
|
16294
16315
|
}
|
|
16295
16316
|
else if (this.facadeModule === module &&
|
|
16296
16317
|
!this.strictFacade &&
|
|
16297
|
-
this.canModuleBeFacade(module,
|
|
16318
|
+
this.canModuleBeFacade(module, exposedVariables)) {
|
|
16298
16319
|
this.strictFacade = true;
|
|
16299
16320
|
}
|
|
16300
16321
|
else if (!(module.facadeChunk && module.facadeChunk.strictFacade)) {
|
|
@@ -16626,6 +16647,25 @@ class Chunk$1 {
|
|
|
16626
16647
|
}
|
|
16627
16648
|
return hash.digest('hex').substr(0, 8);
|
|
16628
16649
|
}
|
|
16650
|
+
ensureReexportsAreAvailableForModule(module) {
|
|
16651
|
+
const map = module.getExportNamesByVariable();
|
|
16652
|
+
for (const exportedVariable of map.keys()) {
|
|
16653
|
+
const isSynthetic = exportedVariable instanceof SyntheticNamedExportVariable;
|
|
16654
|
+
const importedVariable = isSynthetic
|
|
16655
|
+
? exportedVariable.getBaseVariable()
|
|
16656
|
+
: exportedVariable;
|
|
16657
|
+
const exportingModule = importedVariable.module;
|
|
16658
|
+
if (exportingModule &&
|
|
16659
|
+
exportingModule.chunk &&
|
|
16660
|
+
exportingModule.chunk !== this &&
|
|
16661
|
+
!(importedVariable instanceof NamespaceVariable && this.graph.preserveModules)) {
|
|
16662
|
+
exportingModule.chunk.exports.add(importedVariable);
|
|
16663
|
+
if (isSynthetic) {
|
|
16664
|
+
this.imports.add(importedVariable);
|
|
16665
|
+
}
|
|
16666
|
+
}
|
|
16667
|
+
}
|
|
16668
|
+
}
|
|
16629
16669
|
finaliseDynamicImports(options) {
|
|
16630
16670
|
const stripKnownJsExtensions = options.format === 'amd';
|
|
16631
16671
|
for (const [module, code] of this.renderedModuleSources) {
|
|
@@ -16894,12 +16934,12 @@ class Chunk$1 {
|
|
|
16894
16934
|
}
|
|
16895
16935
|
setUpChunkImportsAndExportsForModule(module) {
|
|
16896
16936
|
for (let variable of module.imports) {
|
|
16937
|
+
if (variable instanceof ExportDefaultVariable) {
|
|
16938
|
+
variable = variable.getOriginalVariable();
|
|
16939
|
+
}
|
|
16897
16940
|
if (variable instanceof SyntheticNamedExportVariable) {
|
|
16898
16941
|
variable = variable.getBaseVariable();
|
|
16899
16942
|
}
|
|
16900
|
-
else if (variable instanceof ExportDefaultVariable) {
|
|
16901
|
-
variable = variable.getOriginalVariable();
|
|
16902
|
-
}
|
|
16903
16943
|
if (variable.module && variable.module.chunk !== this) {
|
|
16904
16944
|
this.imports.add(variable);
|
|
16905
16945
|
if (!(variable instanceof NamespaceVariable && this.graph.preserveModules) &&
|
|
@@ -16909,41 +16949,18 @@ class Chunk$1 {
|
|
|
16909
16949
|
}
|
|
16910
16950
|
}
|
|
16911
16951
|
if ((module.isEntryPoint && module.preserveSignature !== false) ||
|
|
16912
|
-
module.includedDynamicImporters.some(importer => importer.chunk !== this)
|
|
16913
|
-
|
|
16914
|
-
|
|
16915
|
-
if (module.isEntryPoint && module.preserveSignature !== false) {
|
|
16916
|
-
this.exports.add(exportedVariable);
|
|
16917
|
-
}
|
|
16918
|
-
const isSynthetic = exportedVariable instanceof SyntheticNamedExportVariable;
|
|
16919
|
-
const importedVariable = isSynthetic
|
|
16920
|
-
? exportedVariable.getBaseVariable()
|
|
16921
|
-
: exportedVariable;
|
|
16922
|
-
const exportingModule = importedVariable.module;
|
|
16923
|
-
if (exportingModule &&
|
|
16924
|
-
exportingModule.chunk &&
|
|
16925
|
-
exportingModule.chunk !== this &&
|
|
16926
|
-
!(importedVariable instanceof NamespaceVariable && this.graph.preserveModules)) {
|
|
16927
|
-
exportingModule.chunk.exports.add(importedVariable);
|
|
16928
|
-
if (isSynthetic) {
|
|
16929
|
-
this.imports.add(importedVariable);
|
|
16930
|
-
}
|
|
16931
|
-
}
|
|
16932
|
-
}
|
|
16933
|
-
}
|
|
16934
|
-
if (module.namespace.included) {
|
|
16935
|
-
for (const reexportName of Object.keys(module.reexportDescriptions)) {
|
|
16936
|
-
const reexport = module.reexportDescriptions[reexportName];
|
|
16937
|
-
const variable = reexport.module.getVariableForExportName(reexport.localName);
|
|
16938
|
-
if (variable.module.chunk !== this) {
|
|
16939
|
-
this.imports.add(variable);
|
|
16940
|
-
variable.module.chunk.exports.add(variable);
|
|
16941
|
-
}
|
|
16942
|
-
}
|
|
16952
|
+
module.includedDynamicImporters.some(importer => importer.chunk !== this) ||
|
|
16953
|
+
module.namespace.included) {
|
|
16954
|
+
this.ensureReexportsAreAvailableForModule(module);
|
|
16943
16955
|
}
|
|
16944
16956
|
for (const { node, resolution } of module.dynamicImports) {
|
|
16945
|
-
if (node.included &&
|
|
16957
|
+
if (node.included &&
|
|
16958
|
+
resolution instanceof Module &&
|
|
16959
|
+
resolution.chunk === this &&
|
|
16960
|
+
!resolution.namespace.included) {
|
|
16946
16961
|
resolution.namespace.include();
|
|
16962
|
+
this.ensureReexportsAreAvailableForModule(resolution);
|
|
16963
|
+
}
|
|
16947
16964
|
}
|
|
16948
16965
|
}
|
|
16949
16966
|
}
|
package/dist/shared/watch-cli.js
CHANGED
package/dist/shared/watch.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rollup",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.9",
|
|
4
4
|
"description": "Next-generation ES module bundler",
|
|
5
5
|
"main": "dist/rollup.js",
|
|
6
6
|
"module": "dist/es/rollup.js",
|
|
@@ -76,10 +76,10 @@
|
|
|
76
76
|
"@types/signal-exit": "^3.0.0",
|
|
77
77
|
"@types/yargs-parser": "^15.0.0",
|
|
78
78
|
"acorn": "^7.2.0",
|
|
79
|
-
"acorn-class-fields": "^0.3.
|
|
79
|
+
"acorn-class-fields": "^0.3.4",
|
|
80
80
|
"acorn-import-meta": "^1.1.0",
|
|
81
81
|
"acorn-jsx": "^5.2.0",
|
|
82
|
-
"acorn-static-class-features": "^0.2.
|
|
82
|
+
"acorn-static-class-features": "^0.2.2",
|
|
83
83
|
"acorn-walk": "^7.1.1",
|
|
84
84
|
"buble": "^0.20.0",
|
|
85
85
|
"chokidar": "^3.4.0",
|