rollup 2.10.8 → 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 +9 -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 +58 -49
- 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 +58 -49
- package/dist/shared/watch-cli.js +2 -2
- package/dist/shared/watch.js +2 -2
- package/package.json +1 -1
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;
|
|
@@ -10478,9 +10478,14 @@ class SyntheticNamedExportVariable extends Variable {
|
|
|
10478
10478
|
this.defaultVariable = defaultVariable;
|
|
10479
10479
|
}
|
|
10480
10480
|
getBaseVariable() {
|
|
10481
|
-
|
|
10482
|
-
|
|
10483
|
-
|
|
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;
|
|
10484
10489
|
}
|
|
10485
10490
|
getName() {
|
|
10486
10491
|
const name = this.name;
|
|
@@ -16209,11 +16214,12 @@ class Chunk$1 {
|
|
|
16209
16214
|
facadedModule.hasEffects()) {
|
|
16210
16215
|
chunk.dependencies.add(facadedModule.chunk);
|
|
16211
16216
|
}
|
|
16217
|
+
chunk.ensureReexportsAreAvailableForModule(facadedModule);
|
|
16212
16218
|
chunk.facadeModule = facadedModule;
|
|
16213
16219
|
chunk.strictFacade = true;
|
|
16214
16220
|
return chunk;
|
|
16215
16221
|
}
|
|
16216
|
-
canModuleBeFacade(module,
|
|
16222
|
+
canModuleBeFacade(module, exposedVariables) {
|
|
16217
16223
|
const moduleExportNamesByVariable = module.getExportNamesByVariable();
|
|
16218
16224
|
for (const exposedVariable of this.exports) {
|
|
16219
16225
|
if (!moduleExportNamesByVariable.has(exposedVariable)) {
|
|
@@ -16231,7 +16237,7 @@ class Chunk$1 {
|
|
|
16231
16237
|
return false;
|
|
16232
16238
|
}
|
|
16233
16239
|
}
|
|
16234
|
-
for (const exposedVariable of
|
|
16240
|
+
for (const exposedVariable of exposedVariables) {
|
|
16235
16241
|
if (!(moduleExportNamesByVariable.has(exposedVariable) || exposedVariable.module === module)) {
|
|
16236
16242
|
return false;
|
|
16237
16243
|
}
|
|
@@ -16265,7 +16271,14 @@ class Chunk$1 {
|
|
|
16265
16271
|
const facades = [];
|
|
16266
16272
|
const dynamicEntryModules = this.dynamicEntryModules.filter(module => module.includedDynamicImporters.some(importingModule => importingModule.chunk !== this));
|
|
16267
16273
|
this.isDynamicEntry = dynamicEntryModules.length > 0;
|
|
16268
|
-
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
|
+
}
|
|
16269
16282
|
for (const module of this.entryModules) {
|
|
16270
16283
|
const requiredFacades = [...module.userChunkNames].map(name => ({
|
|
16271
16284
|
name
|
|
@@ -16280,10 +16293,13 @@ class Chunk$1 {
|
|
|
16280
16293
|
if (!this.facadeModule &&
|
|
16281
16294
|
(this.graph.preserveModules ||
|
|
16282
16295
|
module.preserveSignature !== 'strict' ||
|
|
16283
|
-
this.canModuleBeFacade(module,
|
|
16296
|
+
this.canModuleBeFacade(module, exposedVariables))) {
|
|
16284
16297
|
this.facadeModule = module;
|
|
16285
16298
|
module.facadeChunk = this;
|
|
16286
|
-
|
|
16299
|
+
if (module.preserveSignature) {
|
|
16300
|
+
this.strictFacade = module.preserveSignature === 'strict';
|
|
16301
|
+
this.ensureReexportsAreAvailableForModule(module);
|
|
16302
|
+
}
|
|
16287
16303
|
this.assignFacadeName(requiredFacades.shift(), module);
|
|
16288
16304
|
}
|
|
16289
16305
|
for (const facadeName of requiredFacades) {
|
|
@@ -16291,7 +16307,7 @@ class Chunk$1 {
|
|
|
16291
16307
|
}
|
|
16292
16308
|
}
|
|
16293
16309
|
for (const module of dynamicEntryModules) {
|
|
16294
|
-
if (!this.facadeModule && this.canModuleBeFacade(module,
|
|
16310
|
+
if (!this.facadeModule && this.canModuleBeFacade(module, exposedVariables)) {
|
|
16295
16311
|
this.facadeModule = module;
|
|
16296
16312
|
module.facadeChunk = this;
|
|
16297
16313
|
this.strictFacade = true;
|
|
@@ -16299,7 +16315,7 @@ class Chunk$1 {
|
|
|
16299
16315
|
}
|
|
16300
16316
|
else if (this.facadeModule === module &&
|
|
16301
16317
|
!this.strictFacade &&
|
|
16302
|
-
this.canModuleBeFacade(module,
|
|
16318
|
+
this.canModuleBeFacade(module, exposedVariables)) {
|
|
16303
16319
|
this.strictFacade = true;
|
|
16304
16320
|
}
|
|
16305
16321
|
else if (!(module.facadeChunk && module.facadeChunk.strictFacade)) {
|
|
@@ -16631,6 +16647,25 @@ class Chunk$1 {
|
|
|
16631
16647
|
}
|
|
16632
16648
|
return hash.digest('hex').substr(0, 8);
|
|
16633
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
|
+
}
|
|
16634
16669
|
finaliseDynamicImports(options) {
|
|
16635
16670
|
const stripKnownJsExtensions = options.format === 'amd';
|
|
16636
16671
|
for (const [module, code] of this.renderedModuleSources) {
|
|
@@ -16902,11 +16937,8 @@ class Chunk$1 {
|
|
|
16902
16937
|
if (variable instanceof ExportDefaultVariable) {
|
|
16903
16938
|
variable = variable.getOriginalVariable();
|
|
16904
16939
|
}
|
|
16905
|
-
|
|
16940
|
+
if (variable instanceof SyntheticNamedExportVariable) {
|
|
16906
16941
|
variable = variable.getBaseVariable();
|
|
16907
|
-
if (variable instanceof ExportDefaultVariable) {
|
|
16908
|
-
variable = variable.getOriginalVariable();
|
|
16909
|
-
}
|
|
16910
16942
|
}
|
|
16911
16943
|
if (variable.module && variable.module.chunk !== this) {
|
|
16912
16944
|
this.imports.add(variable);
|
|
@@ -16917,41 +16949,18 @@ class Chunk$1 {
|
|
|
16917
16949
|
}
|
|
16918
16950
|
}
|
|
16919
16951
|
if ((module.isEntryPoint && module.preserveSignature !== false) ||
|
|
16920
|
-
module.includedDynamicImporters.some(importer => importer.chunk !== this)
|
|
16921
|
-
|
|
16922
|
-
|
|
16923
|
-
if (module.isEntryPoint && module.preserveSignature !== false) {
|
|
16924
|
-
this.exports.add(exportedVariable);
|
|
16925
|
-
}
|
|
16926
|
-
const isSynthetic = exportedVariable instanceof SyntheticNamedExportVariable;
|
|
16927
|
-
const importedVariable = isSynthetic
|
|
16928
|
-
? exportedVariable.getBaseVariable()
|
|
16929
|
-
: exportedVariable;
|
|
16930
|
-
const exportingModule = importedVariable.module;
|
|
16931
|
-
if (exportingModule &&
|
|
16932
|
-
exportingModule.chunk &&
|
|
16933
|
-
exportingModule.chunk !== this &&
|
|
16934
|
-
!(importedVariable instanceof NamespaceVariable && this.graph.preserveModules)) {
|
|
16935
|
-
exportingModule.chunk.exports.add(importedVariable);
|
|
16936
|
-
if (isSynthetic) {
|
|
16937
|
-
this.imports.add(importedVariable);
|
|
16938
|
-
}
|
|
16939
|
-
}
|
|
16940
|
-
}
|
|
16941
|
-
}
|
|
16942
|
-
if (module.namespace.included) {
|
|
16943
|
-
for (const reexportName of Object.keys(module.reexportDescriptions)) {
|
|
16944
|
-
const reexport = module.reexportDescriptions[reexportName];
|
|
16945
|
-
const variable = reexport.module.getVariableForExportName(reexport.localName);
|
|
16946
|
-
if (variable.module.chunk && variable.module.chunk !== this) {
|
|
16947
|
-
this.imports.add(variable);
|
|
16948
|
-
variable.module.chunk.exports.add(variable);
|
|
16949
|
-
}
|
|
16950
|
-
}
|
|
16952
|
+
module.includedDynamicImporters.some(importer => importer.chunk !== this) ||
|
|
16953
|
+
module.namespace.included) {
|
|
16954
|
+
this.ensureReexportsAreAvailableForModule(module);
|
|
16951
16955
|
}
|
|
16952
16956
|
for (const { node, resolution } of module.dynamicImports) {
|
|
16953
|
-
if (node.included &&
|
|
16957
|
+
if (node.included &&
|
|
16958
|
+
resolution instanceof Module &&
|
|
16959
|
+
resolution.chunk === this &&
|
|
16960
|
+
!resolution.namespace.included) {
|
|
16954
16961
|
resolution.namespace.include();
|
|
16962
|
+
this.ensureReexportsAreAvailableForModule(resolution);
|
|
16963
|
+
}
|
|
16955
16964
|
}
|
|
16956
16965
|
}
|
|
16957
16966
|
}
|
package/dist/shared/watch-cli.js
CHANGED
package/dist/shared/watch.js
CHANGED