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/es/rollup.js
CHANGED
package/dist/es/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
|
|
@@ -13,7 +13,7 @@ import { createHash as createHash$1 } from 'crypto';
|
|
|
13
13
|
import { writeFile as writeFile$1, readdirSync, mkdirSync, readFile as readFile$1, lstatSync, realpathSync } from 'fs';
|
|
14
14
|
import { EventEmitter } from 'events';
|
|
15
15
|
|
|
16
|
-
var version = "2.10.
|
|
16
|
+
var version = "2.10.9";
|
|
17
17
|
|
|
18
18
|
// Reserved word lists for various dialects of the language
|
|
19
19
|
|
|
@@ -9995,9 +9995,14 @@ class SyntheticNamedExportVariable extends Variable {
|
|
|
9995
9995
|
this.defaultVariable = defaultVariable;
|
|
9996
9996
|
}
|
|
9997
9997
|
getBaseVariable() {
|
|
9998
|
-
|
|
9999
|
-
|
|
10000
|
-
|
|
9998
|
+
let baseVariable = this.defaultVariable;
|
|
9999
|
+
if (baseVariable instanceof ExportDefaultVariable) {
|
|
10000
|
+
baseVariable = baseVariable.getOriginalVariable();
|
|
10001
|
+
}
|
|
10002
|
+
if (baseVariable instanceof SyntheticNamedExportVariable) {
|
|
10003
|
+
baseVariable = baseVariable.getBaseVariable();
|
|
10004
|
+
}
|
|
10005
|
+
return baseVariable;
|
|
10001
10006
|
}
|
|
10002
10007
|
getName() {
|
|
10003
10008
|
const name = this.name;
|
|
@@ -15998,11 +16003,12 @@ class Chunk$1 {
|
|
|
15998
16003
|
facadedModule.hasEffects()) {
|
|
15999
16004
|
chunk.dependencies.add(facadedModule.chunk);
|
|
16000
16005
|
}
|
|
16006
|
+
chunk.ensureReexportsAreAvailableForModule(facadedModule);
|
|
16001
16007
|
chunk.facadeModule = facadedModule;
|
|
16002
16008
|
chunk.strictFacade = true;
|
|
16003
16009
|
return chunk;
|
|
16004
16010
|
}
|
|
16005
|
-
canModuleBeFacade(module,
|
|
16011
|
+
canModuleBeFacade(module, exposedVariables) {
|
|
16006
16012
|
const moduleExportNamesByVariable = module.getExportNamesByVariable();
|
|
16007
16013
|
for (const exposedVariable of this.exports) {
|
|
16008
16014
|
if (!moduleExportNamesByVariable.has(exposedVariable)) {
|
|
@@ -16020,7 +16026,7 @@ class Chunk$1 {
|
|
|
16020
16026
|
return false;
|
|
16021
16027
|
}
|
|
16022
16028
|
}
|
|
16023
|
-
for (const exposedVariable of
|
|
16029
|
+
for (const exposedVariable of exposedVariables) {
|
|
16024
16030
|
if (!(moduleExportNamesByVariable.has(exposedVariable) || exposedVariable.module === module)) {
|
|
16025
16031
|
return false;
|
|
16026
16032
|
}
|
|
@@ -16054,7 +16060,14 @@ class Chunk$1 {
|
|
|
16054
16060
|
const facades = [];
|
|
16055
16061
|
const dynamicEntryModules = this.dynamicEntryModules.filter(module => module.includedDynamicImporters.some(importingModule => importingModule.chunk !== this));
|
|
16056
16062
|
this.isDynamicEntry = dynamicEntryModules.length > 0;
|
|
16057
|
-
const
|
|
16063
|
+
const exposedVariables = new Set(dynamicEntryModules.map(module => module.namespace));
|
|
16064
|
+
for (const module of this.entryModules) {
|
|
16065
|
+
if (module.preserveSignature) {
|
|
16066
|
+
for (const exportedVariable of module.getExportNamesByVariable().keys()) {
|
|
16067
|
+
exposedVariables.add(exportedVariable);
|
|
16068
|
+
}
|
|
16069
|
+
}
|
|
16070
|
+
}
|
|
16058
16071
|
for (const module of this.entryModules) {
|
|
16059
16072
|
const requiredFacades = [...module.userChunkNames].map(name => ({
|
|
16060
16073
|
name
|
|
@@ -16069,10 +16082,13 @@ class Chunk$1 {
|
|
|
16069
16082
|
if (!this.facadeModule &&
|
|
16070
16083
|
(this.graph.preserveModules ||
|
|
16071
16084
|
module.preserveSignature !== 'strict' ||
|
|
16072
|
-
this.canModuleBeFacade(module,
|
|
16085
|
+
this.canModuleBeFacade(module, exposedVariables))) {
|
|
16073
16086
|
this.facadeModule = module;
|
|
16074
16087
|
module.facadeChunk = this;
|
|
16075
|
-
|
|
16088
|
+
if (module.preserveSignature) {
|
|
16089
|
+
this.strictFacade = module.preserveSignature === 'strict';
|
|
16090
|
+
this.ensureReexportsAreAvailableForModule(module);
|
|
16091
|
+
}
|
|
16076
16092
|
this.assignFacadeName(requiredFacades.shift(), module);
|
|
16077
16093
|
}
|
|
16078
16094
|
for (const facadeName of requiredFacades) {
|
|
@@ -16080,7 +16096,7 @@ class Chunk$1 {
|
|
|
16080
16096
|
}
|
|
16081
16097
|
}
|
|
16082
16098
|
for (const module of dynamicEntryModules) {
|
|
16083
|
-
if (!this.facadeModule && this.canModuleBeFacade(module,
|
|
16099
|
+
if (!this.facadeModule && this.canModuleBeFacade(module, exposedVariables)) {
|
|
16084
16100
|
this.facadeModule = module;
|
|
16085
16101
|
module.facadeChunk = this;
|
|
16086
16102
|
this.strictFacade = true;
|
|
@@ -16088,7 +16104,7 @@ class Chunk$1 {
|
|
|
16088
16104
|
}
|
|
16089
16105
|
else if (this.facadeModule === module &&
|
|
16090
16106
|
!this.strictFacade &&
|
|
16091
|
-
this.canModuleBeFacade(module,
|
|
16107
|
+
this.canModuleBeFacade(module, exposedVariables)) {
|
|
16092
16108
|
this.strictFacade = true;
|
|
16093
16109
|
}
|
|
16094
16110
|
else if (!(module.facadeChunk && module.facadeChunk.strictFacade)) {
|
|
@@ -16420,6 +16436,25 @@ class Chunk$1 {
|
|
|
16420
16436
|
}
|
|
16421
16437
|
return hash.digest('hex').substr(0, 8);
|
|
16422
16438
|
}
|
|
16439
|
+
ensureReexportsAreAvailableForModule(module) {
|
|
16440
|
+
const map = module.getExportNamesByVariable();
|
|
16441
|
+
for (const exportedVariable of map.keys()) {
|
|
16442
|
+
const isSynthetic = exportedVariable instanceof SyntheticNamedExportVariable;
|
|
16443
|
+
const importedVariable = isSynthetic
|
|
16444
|
+
? exportedVariable.getBaseVariable()
|
|
16445
|
+
: exportedVariable;
|
|
16446
|
+
const exportingModule = importedVariable.module;
|
|
16447
|
+
if (exportingModule &&
|
|
16448
|
+
exportingModule.chunk &&
|
|
16449
|
+
exportingModule.chunk !== this &&
|
|
16450
|
+
!(importedVariable instanceof NamespaceVariable && this.graph.preserveModules)) {
|
|
16451
|
+
exportingModule.chunk.exports.add(importedVariable);
|
|
16452
|
+
if (isSynthetic) {
|
|
16453
|
+
this.imports.add(importedVariable);
|
|
16454
|
+
}
|
|
16455
|
+
}
|
|
16456
|
+
}
|
|
16457
|
+
}
|
|
16423
16458
|
finaliseDynamicImports(options) {
|
|
16424
16459
|
const stripKnownJsExtensions = options.format === 'amd';
|
|
16425
16460
|
for (const [module, code] of this.renderedModuleSources) {
|
|
@@ -16691,11 +16726,8 @@ class Chunk$1 {
|
|
|
16691
16726
|
if (variable instanceof ExportDefaultVariable) {
|
|
16692
16727
|
variable = variable.getOriginalVariable();
|
|
16693
16728
|
}
|
|
16694
|
-
|
|
16729
|
+
if (variable instanceof SyntheticNamedExportVariable) {
|
|
16695
16730
|
variable = variable.getBaseVariable();
|
|
16696
|
-
if (variable instanceof ExportDefaultVariable) {
|
|
16697
|
-
variable = variable.getOriginalVariable();
|
|
16698
|
-
}
|
|
16699
16731
|
}
|
|
16700
16732
|
if (variable.module && variable.module.chunk !== this) {
|
|
16701
16733
|
this.imports.add(variable);
|
|
@@ -16706,41 +16738,18 @@ class Chunk$1 {
|
|
|
16706
16738
|
}
|
|
16707
16739
|
}
|
|
16708
16740
|
if ((module.isEntryPoint && module.preserveSignature !== false) ||
|
|
16709
|
-
module.includedDynamicImporters.some(importer => importer.chunk !== this)
|
|
16710
|
-
|
|
16711
|
-
|
|
16712
|
-
if (module.isEntryPoint && module.preserveSignature !== false) {
|
|
16713
|
-
this.exports.add(exportedVariable);
|
|
16714
|
-
}
|
|
16715
|
-
const isSynthetic = exportedVariable instanceof SyntheticNamedExportVariable;
|
|
16716
|
-
const importedVariable = isSynthetic
|
|
16717
|
-
? exportedVariable.getBaseVariable()
|
|
16718
|
-
: exportedVariable;
|
|
16719
|
-
const exportingModule = importedVariable.module;
|
|
16720
|
-
if (exportingModule &&
|
|
16721
|
-
exportingModule.chunk &&
|
|
16722
|
-
exportingModule.chunk !== this &&
|
|
16723
|
-
!(importedVariable instanceof NamespaceVariable && this.graph.preserveModules)) {
|
|
16724
|
-
exportingModule.chunk.exports.add(importedVariable);
|
|
16725
|
-
if (isSynthetic) {
|
|
16726
|
-
this.imports.add(importedVariable);
|
|
16727
|
-
}
|
|
16728
|
-
}
|
|
16729
|
-
}
|
|
16730
|
-
}
|
|
16731
|
-
if (module.namespace.included) {
|
|
16732
|
-
for (const reexportName of Object.keys(module.reexportDescriptions)) {
|
|
16733
|
-
const reexport = module.reexportDescriptions[reexportName];
|
|
16734
|
-
const variable = reexport.module.getVariableForExportName(reexport.localName);
|
|
16735
|
-
if (variable.module.chunk && variable.module.chunk !== this) {
|
|
16736
|
-
this.imports.add(variable);
|
|
16737
|
-
variable.module.chunk.exports.add(variable);
|
|
16738
|
-
}
|
|
16739
|
-
}
|
|
16741
|
+
module.includedDynamicImporters.some(importer => importer.chunk !== this) ||
|
|
16742
|
+
module.namespace.included) {
|
|
16743
|
+
this.ensureReexportsAreAvailableForModule(module);
|
|
16740
16744
|
}
|
|
16741
16745
|
for (const { node, resolution } of module.dynamicImports) {
|
|
16742
|
-
if (node.included &&
|
|
16746
|
+
if (node.included &&
|
|
16747
|
+
resolution instanceof Module &&
|
|
16748
|
+
resolution.chunk === this &&
|
|
16749
|
+
!resolution.namespace.included) {
|
|
16743
16750
|
resolution.namespace.include();
|
|
16751
|
+
this.ensureReexportsAreAvailableForModule(resolution);
|
|
16752
|
+
}
|
|
16744
16753
|
}
|
|
16745
16754
|
}
|
|
16746
16755
|
}
|
package/dist/es/shared/watch.js
CHANGED
package/dist/loadConfigFile.js
CHANGED