rollup 2.26.1 → 2.26.5
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 +101 -68
- 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 +101 -68
- 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.26.
|
|
4
|
-
|
|
3
|
+
Rollup.js v2.26.5
|
|
4
|
+
Sat, 22 Aug 2020 04:50:56 GMT - commit b2bb960aa5969914e82fd4bcf289bd16eab4a381
|
|
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.26.
|
|
16
|
+
var version = "2.26.5";
|
|
17
17
|
|
|
18
18
|
var charToInteger = {};
|
|
19
19
|
var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
|
@@ -4498,26 +4498,19 @@ class NamespaceVariable extends Variable {
|
|
|
4498
4498
|
memberVariables[name] = this.context.traceExport(name);
|
|
4499
4499
|
}
|
|
4500
4500
|
}
|
|
4501
|
-
this.memberVariables = memberVariables;
|
|
4502
4501
|
return (this.memberVariables = memberVariables);
|
|
4503
4502
|
}
|
|
4504
4503
|
include() {
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
// We directly include the variables instead of context.include to not automatically
|
|
4516
|
-
// generate imports for members from other modules
|
|
4517
|
-
for (const memberName of Object.keys(memberVariables))
|
|
4518
|
-
memberVariables[memberName].include();
|
|
4519
|
-
if (typeof this.syntheticNamedExports === 'string') {
|
|
4520
|
-
this.context.traceExport(this.syntheticNamedExports).include();
|
|
4504
|
+
this.included = true;
|
|
4505
|
+
this.context.includeAllExports();
|
|
4506
|
+
}
|
|
4507
|
+
prepareNamespace(mergedNamespaces) {
|
|
4508
|
+
this.mergedNamespaces = mergedNamespaces;
|
|
4509
|
+
const moduleExecIndex = this.context.getModuleExecIndex();
|
|
4510
|
+
for (const identifier of this.references) {
|
|
4511
|
+
if (identifier.context.getModuleExecIndex() <= moduleExecIndex) {
|
|
4512
|
+
this.referencedEarly = true;
|
|
4513
|
+
break;
|
|
4521
4514
|
}
|
|
4522
4515
|
}
|
|
4523
4516
|
}
|
|
@@ -4789,7 +4782,9 @@ function getReexportedImportName(moduleVariableName, imported, depNamedExportsMo
|
|
|
4789
4782
|
return depNamedExportsMode ? `${moduleVariableName}['default']` : moduleVariableName;
|
|
4790
4783
|
}
|
|
4791
4784
|
if (imported === '*') {
|
|
4792
|
-
return
|
|
4785
|
+
return (isChunk
|
|
4786
|
+
? !depNamedExportsMode
|
|
4787
|
+
: namespaceInteropHelpersByInteropType[String(interop(moduleId))])
|
|
4793
4788
|
? namespaceVariableName
|
|
4794
4789
|
: moduleVariableName;
|
|
4795
4790
|
}
|
|
@@ -4799,8 +4794,25 @@ function getReexportedImportName(moduleVariableName, imported, depNamedExportsMo
|
|
|
4799
4794
|
function getInteropBlock(dependencies, varOrConst, interop, externalLiveBindings, freeze, accessedGlobals, _, n, s, t) {
|
|
4800
4795
|
const neededInteropHelpers = new Set();
|
|
4801
4796
|
const interopStatements = [];
|
|
4802
|
-
|
|
4803
|
-
|
|
4797
|
+
const addInteropStatement = (helperVariableName, helper, dependencyVariableName) => {
|
|
4798
|
+
neededInteropHelpers.add(helper);
|
|
4799
|
+
interopStatements.push(`${varOrConst} ${helperVariableName}${_}=${_}/*#__PURE__*/${helper}(${dependencyVariableName});`);
|
|
4800
|
+
};
|
|
4801
|
+
for (const { defaultVariableName, imports, id, isChunk, name, namedExportsMode, namespaceVariableName, reexports } of dependencies) {
|
|
4802
|
+
if (isChunk) {
|
|
4803
|
+
for (const { imported, reexported } of [
|
|
4804
|
+
...(imports || []),
|
|
4805
|
+
...(reexports || [])
|
|
4806
|
+
]) {
|
|
4807
|
+
if (imported === '*' && reexported !== '*') {
|
|
4808
|
+
if (!namedExportsMode) {
|
|
4809
|
+
addInteropStatement(namespaceVariableName, getDefaultOnlyHelper(), name);
|
|
4810
|
+
}
|
|
4811
|
+
break;
|
|
4812
|
+
}
|
|
4813
|
+
}
|
|
4814
|
+
}
|
|
4815
|
+
else {
|
|
4804
4816
|
const moduleInterop = String(interop(id));
|
|
4805
4817
|
let hasDefault = false;
|
|
4806
4818
|
let hasNamespace = false;
|
|
@@ -4808,7 +4820,7 @@ function getInteropBlock(dependencies, varOrConst, interop, externalLiveBindings
|
|
|
4808
4820
|
...(imports || []),
|
|
4809
4821
|
...(reexports || [])
|
|
4810
4822
|
]) {
|
|
4811
|
-
let helper
|
|
4823
|
+
let helper;
|
|
4812
4824
|
let variableName;
|
|
4813
4825
|
if (imported === 'default') {
|
|
4814
4826
|
if (!hasDefault) {
|
|
@@ -4827,8 +4839,7 @@ function getInteropBlock(dependencies, varOrConst, interop, externalLiveBindings
|
|
|
4827
4839
|
}
|
|
4828
4840
|
}
|
|
4829
4841
|
if (helper) {
|
|
4830
|
-
|
|
4831
|
-
interopStatements.push(`${varOrConst} ${variableName}${_}=${_}/*#__PURE__*/${helper}(${name});`);
|
|
4842
|
+
addInteropStatement(variableName, helper, name);
|
|
4832
4843
|
}
|
|
4833
4844
|
}
|
|
4834
4845
|
}
|
|
@@ -6941,6 +6952,7 @@ class ConditionalExpression extends NodeBase {
|
|
|
6941
6952
|
isCalleeOfRenderedParent: renderedParentType
|
|
6942
6953
|
? isCalleeOfRenderedParent
|
|
6943
6954
|
: this.parent.callee === this,
|
|
6955
|
+
preventASI: true,
|
|
6944
6956
|
renderedParentType: renderedParentType || this.parent.type
|
|
6945
6957
|
});
|
|
6946
6958
|
}
|
|
@@ -7630,11 +7642,13 @@ class LogicalExpression extends NodeBase {
|
|
|
7630
7642
|
isCalleeOfRenderedParent: renderedParentType
|
|
7631
7643
|
? isCalleeOfRenderedParent
|
|
7632
7644
|
: this.parent.callee === this,
|
|
7645
|
+
preventASI,
|
|
7633
7646
|
renderedParentType: renderedParentType || this.parent.type
|
|
7634
7647
|
});
|
|
7635
7648
|
}
|
|
7636
7649
|
else {
|
|
7637
|
-
|
|
7650
|
+
this.left.render(code, options, { preventASI });
|
|
7651
|
+
this.right.render(code, options);
|
|
7638
7652
|
}
|
|
7639
7653
|
}
|
|
7640
7654
|
getUsedBranch() {
|
|
@@ -8976,7 +8990,7 @@ class YieldExpression extends NodeBase {
|
|
|
8976
8990
|
}
|
|
8977
8991
|
render(code, options) {
|
|
8978
8992
|
if (this.argument) {
|
|
8979
|
-
this.argument.render(code, options);
|
|
8993
|
+
this.argument.render(code, options, { preventASI: true });
|
|
8980
8994
|
if (this.argument.start === this.start + 5 /* 'yield'.length */) {
|
|
8981
8995
|
code.prependLeft(this.start + 5, ' ');
|
|
8982
8996
|
}
|
|
@@ -9834,17 +9848,19 @@ class Module {
|
|
|
9834
9848
|
if (this.ast.shouldBeIncluded(context))
|
|
9835
9849
|
this.ast.include(context, false);
|
|
9836
9850
|
}
|
|
9837
|
-
includeAllExports() {
|
|
9851
|
+
includeAllExports(includeNamespaceMembers) {
|
|
9838
9852
|
if (!this.isExecuted) {
|
|
9839
9853
|
this.graph.needsTreeshakingPass = true;
|
|
9840
9854
|
markModuleAndImpureDependenciesAsExecuted(this);
|
|
9841
9855
|
}
|
|
9842
9856
|
for (const exportName of this.getExports()) {
|
|
9843
|
-
|
|
9844
|
-
|
|
9845
|
-
|
|
9846
|
-
variable.
|
|
9847
|
-
|
|
9857
|
+
if (includeNamespaceMembers || exportName !== this.syntheticNamedExports) {
|
|
9858
|
+
const variable = this.getVariableForExportName(exportName);
|
|
9859
|
+
variable.deoptimizePath(UNKNOWN_PATH);
|
|
9860
|
+
if (!variable.included) {
|
|
9861
|
+
variable.include();
|
|
9862
|
+
this.graph.needsTreeshakingPass = true;
|
|
9863
|
+
}
|
|
9848
9864
|
}
|
|
9849
9865
|
}
|
|
9850
9866
|
for (const name of this.getReexports()) {
|
|
@@ -9858,6 +9874,9 @@ class Module {
|
|
|
9858
9874
|
variable.module.reexported = true;
|
|
9859
9875
|
}
|
|
9860
9876
|
}
|
|
9877
|
+
if (includeNamespaceMembers) {
|
|
9878
|
+
this.namespace.prepareNamespace(this.includeAndGetAdditionalMergedNamespaces());
|
|
9879
|
+
}
|
|
9861
9880
|
}
|
|
9862
9881
|
includeAllInBundle() {
|
|
9863
9882
|
this.ast.include(createInclusionContext(), true);
|
|
@@ -9955,7 +9974,7 @@ class Module {
|
|
|
9955
9974
|
getModuleName: this.basename.bind(this),
|
|
9956
9975
|
getReexports: this.getReexports.bind(this),
|
|
9957
9976
|
importDescriptions: this.importDescriptions,
|
|
9958
|
-
|
|
9977
|
+
includeAllExports: () => this.includeAllExports(true),
|
|
9959
9978
|
includeDynamicImport: this.includeDynamicImport.bind(this),
|
|
9960
9979
|
includeVariable: this.includeVariable.bind(this),
|
|
9961
9980
|
magicString: this.magicString,
|
|
@@ -10167,7 +10186,7 @@ class Module {
|
|
|
10167
10186
|
const resolution = this.dynamicImports.find(dynamicImport => dynamicImport.node === node).resolution;
|
|
10168
10187
|
if (resolution instanceof Module) {
|
|
10169
10188
|
resolution.includedDynamicImporters.push(this);
|
|
10170
|
-
resolution.includeAllExports();
|
|
10189
|
+
resolution.includeAllExports(true);
|
|
10171
10190
|
}
|
|
10172
10191
|
}
|
|
10173
10192
|
includeVariable(variable) {
|
|
@@ -10359,27 +10378,28 @@ const DECONFLICT_IMPORTED_VARIABLES_BY_FORMAT = {
|
|
|
10359
10378
|
system: deconflictImportsEsmOrSystem,
|
|
10360
10379
|
umd: deconflictImportsOther
|
|
10361
10380
|
};
|
|
10362
|
-
function deconflictChunk(modules, dependenciesToBeDeconflicted, imports, usedNames, format, interop, preserveModules, externalLiveBindings, chunkByModule, syntheticExports, exportNamesByVariable, accessedGlobalsByScope) {
|
|
10381
|
+
function deconflictChunk(modules, dependenciesToBeDeconflicted, imports, usedNames, format, interop, preserveModules, externalLiveBindings, chunkByModule, syntheticExports, exportNamesByVariable, accessedGlobalsByScope, includedNamespaces) {
|
|
10363
10382
|
for (const module of modules) {
|
|
10364
10383
|
module.scope.addUsedOutsideNames(usedNames, format, exportNamesByVariable, accessedGlobalsByScope);
|
|
10365
10384
|
}
|
|
10366
|
-
deconflictTopLevelVariables(usedNames, modules);
|
|
10385
|
+
deconflictTopLevelVariables(usedNames, modules, includedNamespaces);
|
|
10367
10386
|
DECONFLICT_IMPORTED_VARIABLES_BY_FORMAT[format](usedNames, imports, dependenciesToBeDeconflicted, interop, preserveModules, externalLiveBindings, chunkByModule, syntheticExports);
|
|
10368
10387
|
for (const module of modules) {
|
|
10369
10388
|
module.scope.deconflict(format, exportNamesByVariable, accessedGlobalsByScope);
|
|
10370
10389
|
}
|
|
10371
10390
|
}
|
|
10372
|
-
function deconflictImportsEsmOrSystem(usedNames, imports, dependenciesToBeDeconflicted, _interop,
|
|
10373
|
-
//
|
|
10374
|
-
// this is needed for synthetic exports and namespace reexports
|
|
10391
|
+
function deconflictImportsEsmOrSystem(usedNames, imports, dependenciesToBeDeconflicted, _interop, preserveModules, _externalLiveBindings, chunkByModule, syntheticExports) {
|
|
10392
|
+
// This is needed for namespace reexports
|
|
10375
10393
|
for (const dependency of dependenciesToBeDeconflicted.dependencies) {
|
|
10376
|
-
|
|
10394
|
+
if (preserveModules || dependency instanceof ExternalModule) {
|
|
10395
|
+
dependency.variableName = getSafeName(dependency.suggestedVariableName, usedNames);
|
|
10396
|
+
}
|
|
10377
10397
|
}
|
|
10378
10398
|
for (const variable of imports) {
|
|
10379
10399
|
const module = variable.module;
|
|
10380
10400
|
const name = variable.name;
|
|
10381
|
-
if (
|
|
10382
|
-
variable.setRenderNames(null, module.variableName);
|
|
10401
|
+
if (variable.isNamespace && (preserveModules || module instanceof ExternalModule)) {
|
|
10402
|
+
variable.setRenderNames(null, (module instanceof ExternalModule ? module : chunkByModule.get(module)).variableName);
|
|
10383
10403
|
}
|
|
10384
10404
|
else if (module instanceof ExternalModule && name === 'default') {
|
|
10385
10405
|
variable.setRenderNames(null, getSafeName([...module.exportedVariables].some(([exportedVariable, exportedName]) => exportedName === '*' && exportedVariable.included)
|
|
@@ -10398,8 +10418,8 @@ function deconflictImportsOther(usedNames, imports, { deconflictedDefault, decon
|
|
|
10398
10418
|
for (const chunkOrExternalModule of dependencies) {
|
|
10399
10419
|
chunkOrExternalModule.variableName = getSafeName(chunkOrExternalModule.suggestedVariableName, usedNames);
|
|
10400
10420
|
}
|
|
10401
|
-
for (const
|
|
10402
|
-
|
|
10421
|
+
for (const externalModuleOrChunk of deconflictedNamespace) {
|
|
10422
|
+
externalModuleOrChunk.namespaceVariableName = getSafeName(`${externalModuleOrChunk.suggestedVariableName}__namespace`, usedNames);
|
|
10403
10423
|
}
|
|
10404
10424
|
for (const externalModule of deconflictedDefault) {
|
|
10405
10425
|
if (deconflictedNamespace.has(externalModule) &&
|
|
@@ -10438,7 +10458,10 @@ function deconflictImportsOther(usedNames, imports, { deconflictedDefault, decon
|
|
|
10438
10458
|
}
|
|
10439
10459
|
else {
|
|
10440
10460
|
const chunk = chunkByModule.get(module);
|
|
10441
|
-
if (
|
|
10461
|
+
if (preserveModules && variable.isNamespace) {
|
|
10462
|
+
variable.setRenderNames(null, chunk.exportMode === 'default' ? chunk.namespaceVariableName : chunk.variableName);
|
|
10463
|
+
}
|
|
10464
|
+
else if (chunk.exportMode === 'default') {
|
|
10442
10465
|
variable.setRenderNames(null, chunk.variableName);
|
|
10443
10466
|
}
|
|
10444
10467
|
else {
|
|
@@ -10447,7 +10470,7 @@ function deconflictImportsOther(usedNames, imports, { deconflictedDefault, decon
|
|
|
10447
10470
|
}
|
|
10448
10471
|
}
|
|
10449
10472
|
}
|
|
10450
|
-
function deconflictTopLevelVariables(usedNames, modules) {
|
|
10473
|
+
function deconflictTopLevelVariables(usedNames, modules, includedNamespaces) {
|
|
10451
10474
|
for (const module of modules) {
|
|
10452
10475
|
for (const variable of module.scope.variables.values()) {
|
|
10453
10476
|
if (variable.included &&
|
|
@@ -10457,8 +10480,8 @@ function deconflictTopLevelVariables(usedNames, modules) {
|
|
|
10457
10480
|
variable.setRenderNames(null, getSafeName(variable.name, usedNames));
|
|
10458
10481
|
}
|
|
10459
10482
|
}
|
|
10460
|
-
|
|
10461
|
-
|
|
10483
|
+
if (includedNamespaces.has(module)) {
|
|
10484
|
+
const namespace = module.namespace;
|
|
10462
10485
|
namespace.setRenderNames(null, getSafeName(namespace.name, usedNames));
|
|
10463
10486
|
}
|
|
10464
10487
|
}
|
|
@@ -10714,7 +10737,7 @@ function getGlobalName(module, globals, hasExports, warn) {
|
|
|
10714
10737
|
}
|
|
10715
10738
|
}
|
|
10716
10739
|
class Chunk$1 {
|
|
10717
|
-
constructor(orderedModules, inputOptions, outputOptions, unsetOptions, pluginDriver, modulesById, chunkByModule, facadeChunkByModule, manualChunkAlias) {
|
|
10740
|
+
constructor(orderedModules, inputOptions, outputOptions, unsetOptions, pluginDriver, modulesById, chunkByModule, facadeChunkByModule, includedNamespaces, manualChunkAlias) {
|
|
10718
10741
|
this.orderedModules = orderedModules;
|
|
10719
10742
|
this.inputOptions = inputOptions;
|
|
10720
10743
|
this.outputOptions = outputOptions;
|
|
@@ -10723,11 +10746,13 @@ class Chunk$1 {
|
|
|
10723
10746
|
this.modulesById = modulesById;
|
|
10724
10747
|
this.chunkByModule = chunkByModule;
|
|
10725
10748
|
this.facadeChunkByModule = facadeChunkByModule;
|
|
10749
|
+
this.includedNamespaces = includedNamespaces;
|
|
10726
10750
|
this.manualChunkAlias = manualChunkAlias;
|
|
10727
10751
|
this.entryModules = [];
|
|
10728
10752
|
this.exportMode = 'named';
|
|
10729
10753
|
this.facadeModule = null;
|
|
10730
10754
|
this.id = null;
|
|
10755
|
+
this.namespaceVariableName = '';
|
|
10731
10756
|
this.variableName = '';
|
|
10732
10757
|
this.accessedGlobalsByScope = new Map();
|
|
10733
10758
|
this.dependencies = new Set();
|
|
@@ -10756,6 +10781,9 @@ class Chunk$1 {
|
|
|
10756
10781
|
this.execIndex = orderedModules.length > 0 ? orderedModules[0].execIndex : Infinity;
|
|
10757
10782
|
const chunkModules = new Set(orderedModules);
|
|
10758
10783
|
for (const module of orderedModules) {
|
|
10784
|
+
if (module.namespace.included) {
|
|
10785
|
+
includedNamespaces.add(module);
|
|
10786
|
+
}
|
|
10759
10787
|
if (this.isEmpty && module.isIncluded()) {
|
|
10760
10788
|
this.isEmpty = false;
|
|
10761
10789
|
}
|
|
@@ -10766,8 +10794,8 @@ class Chunk$1 {
|
|
|
10766
10794
|
if (!chunkModules.has(importer)) {
|
|
10767
10795
|
this.dynamicEntryModules.push(module);
|
|
10768
10796
|
// Modules with synthetic exports need an artificial namespace for dynamic imports
|
|
10769
|
-
if (module.syntheticNamedExports) {
|
|
10770
|
-
|
|
10797
|
+
if (module.syntheticNamedExports && !outputOptions.preserveModules) {
|
|
10798
|
+
includedNamespaces.add(module);
|
|
10771
10799
|
this.exports.add(module.namespace);
|
|
10772
10800
|
}
|
|
10773
10801
|
}
|
|
@@ -10778,8 +10806,8 @@ class Chunk$1 {
|
|
|
10778
10806
|
}
|
|
10779
10807
|
this.suggestedVariableName = makeLegal(this.generateVariableName());
|
|
10780
10808
|
}
|
|
10781
|
-
static generateFacade(inputOptions, outputOptions, unsetOptions, pluginDriver, modulesById, chunkByModule, facadeChunkByModule, facadedModule, facadeName) {
|
|
10782
|
-
const chunk = new Chunk$1([], inputOptions, outputOptions, unsetOptions, pluginDriver, modulesById, chunkByModule, facadeChunkByModule, null);
|
|
10809
|
+
static generateFacade(inputOptions, outputOptions, unsetOptions, pluginDriver, modulesById, chunkByModule, facadeChunkByModule, includedNamespaces, facadedModule, facadeName) {
|
|
10810
|
+
const chunk = new Chunk$1([], inputOptions, outputOptions, unsetOptions, pluginDriver, modulesById, chunkByModule, facadeChunkByModule, includedNamespaces, null);
|
|
10783
10811
|
chunk.assignFacadeName(facadeName, facadedModule);
|
|
10784
10812
|
if (!facadeChunkByModule.has(facadedModule)) {
|
|
10785
10813
|
facadeChunkByModule.set(facadedModule, chunk);
|
|
@@ -10881,7 +10909,7 @@ class Chunk$1 {
|
|
|
10881
10909
|
this.assignFacadeName(requiredFacades.shift(), module);
|
|
10882
10910
|
}
|
|
10883
10911
|
for (const facadeName of requiredFacades) {
|
|
10884
|
-
facades.push(Chunk$1.generateFacade(this.inputOptions, this.outputOptions, this.unsetOptions, this.pluginDriver, this.modulesById, this.chunkByModule, this.facadeChunkByModule, module, facadeName));
|
|
10912
|
+
facades.push(Chunk$1.generateFacade(this.inputOptions, this.outputOptions, this.unsetOptions, this.pluginDriver, this.modulesById, this.chunkByModule, this.facadeChunkByModule, this.includedNamespaces, module, facadeName));
|
|
10885
10913
|
}
|
|
10886
10914
|
}
|
|
10887
10915
|
for (const module of this.dynamicEntryModules) {
|
|
@@ -10899,7 +10927,7 @@ class Chunk$1 {
|
|
|
10899
10927
|
this.strictFacade = true;
|
|
10900
10928
|
}
|
|
10901
10929
|
else if (!((_a = this.facadeChunkByModule.get(module)) === null || _a === void 0 ? void 0 : _a.strictFacade)) {
|
|
10902
|
-
|
|
10930
|
+
this.includedNamespaces.add(module);
|
|
10903
10931
|
this.exports.add(module.namespace);
|
|
10904
10932
|
}
|
|
10905
10933
|
}
|
|
@@ -11047,7 +11075,7 @@ class Chunk$1 {
|
|
|
11047
11075
|
const renderedModules = this.renderedModules;
|
|
11048
11076
|
for (const module of this.orderedModules) {
|
|
11049
11077
|
let renderedLength = 0;
|
|
11050
|
-
if (module.isIncluded()) {
|
|
11078
|
+
if (module.isIncluded() || this.includedNamespaces.has(module)) {
|
|
11051
11079
|
const source = module.render(renderOptions).trim();
|
|
11052
11080
|
renderedLength = source.length();
|
|
11053
11081
|
if (renderedLength) {
|
|
@@ -11058,7 +11086,7 @@ class Chunk$1 {
|
|
|
11058
11086
|
this.usedModules.push(module);
|
|
11059
11087
|
}
|
|
11060
11088
|
const namespace = module.namespace;
|
|
11061
|
-
if (
|
|
11089
|
+
if (this.includedNamespaces.has(module) && !this.outputOptions.preserveModules) {
|
|
11062
11090
|
const rendered = namespace.renderBlock(renderOptions);
|
|
11063
11091
|
if (namespace.renderFirst())
|
|
11064
11092
|
hoistedSource += n + rendered;
|
|
@@ -11404,6 +11432,11 @@ class Chunk$1 {
|
|
|
11404
11432
|
const chunk = this.chunkByModule.get(module);
|
|
11405
11433
|
if (chunk !== this) {
|
|
11406
11434
|
dependencies.add(chunk);
|
|
11435
|
+
if (addNonNamespacesAndInteropHelpers &&
|
|
11436
|
+
chunk.exportMode === 'default' &&
|
|
11437
|
+
variable.isNamespace) {
|
|
11438
|
+
deconflictedNamespace.add(chunk);
|
|
11439
|
+
}
|
|
11407
11440
|
}
|
|
11408
11441
|
}
|
|
11409
11442
|
}
|
|
@@ -11618,16 +11651,15 @@ class Chunk$1 {
|
|
|
11618
11651
|
usedNames.add(helper);
|
|
11619
11652
|
}
|
|
11620
11653
|
}
|
|
11621
|
-
deconflictChunk(this.orderedModules, this.getDependenciesToBeDeconflicted(format !== 'es' && format !== 'system', format !== 'system', format === 'amd' || format === 'umd' || format === 'iife', interop), this.imports, usedNames, format, interop, this.outputOptions.preserveModules, this.outputOptions.externalLiveBindings, this.chunkByModule, syntheticExports, this.exportNamesByVariable, this.accessedGlobalsByScope);
|
|
11654
|
+
deconflictChunk(this.orderedModules, this.getDependenciesToBeDeconflicted(format !== 'es' && format !== 'system', format !== 'system', format === 'amd' || format === 'umd' || format === 'iife', interop), this.imports, usedNames, format, interop, this.outputOptions.preserveModules, this.outputOptions.externalLiveBindings, this.chunkByModule, syntheticExports, this.exportNamesByVariable, this.accessedGlobalsByScope, this.includedNamespaces);
|
|
11622
11655
|
}
|
|
11623
11656
|
setUpChunkImportsAndExportsForModule(module) {
|
|
11624
11657
|
const moduleImports = new Set(module.imports);
|
|
11625
11658
|
// when we are not preserving modules, we need to make all namespace variables available for
|
|
11626
11659
|
// rendering the namespace object
|
|
11627
11660
|
if (!this.outputOptions.preserveModules) {
|
|
11628
|
-
|
|
11629
|
-
|
|
11630
|
-
const memberVariables = namespace.getMemberVariables();
|
|
11661
|
+
if (this.includedNamespaces.has(module)) {
|
|
11662
|
+
const memberVariables = module.namespace.getMemberVariables();
|
|
11631
11663
|
for (const name of Object.keys(memberVariables)) {
|
|
11632
11664
|
moduleImports.add(memberVariables[name]);
|
|
11633
11665
|
}
|
|
@@ -11649,7 +11681,7 @@ class Chunk$1 {
|
|
|
11649
11681
|
}
|
|
11650
11682
|
}
|
|
11651
11683
|
}
|
|
11652
|
-
if (
|
|
11684
|
+
if (this.includedNamespaces.has(module) ||
|
|
11653
11685
|
(module.isEntryPoint && module.preserveSignature !== false) ||
|
|
11654
11686
|
module.includedDynamicImporters.some(importer => this.chunkByModule.get(importer) !== this)) {
|
|
11655
11687
|
this.ensureReexportsAreAvailableForModule(module);
|
|
@@ -11658,8 +11690,8 @@ class Chunk$1 {
|
|
|
11658
11690
|
if (node.included &&
|
|
11659
11691
|
resolution instanceof Module &&
|
|
11660
11692
|
this.chunkByModule.get(resolution) === this &&
|
|
11661
|
-
!
|
|
11662
|
-
|
|
11693
|
+
!this.includedNamespaces.has(resolution)) {
|
|
11694
|
+
this.includedNamespaces.add(resolution);
|
|
11663
11695
|
this.ensureReexportsAreAvailableForModule(resolution);
|
|
11664
11696
|
}
|
|
11665
11697
|
}
|
|
@@ -12100,6 +12132,7 @@ class Bundle$1 {
|
|
|
12100
12132
|
this.pluginDriver = pluginDriver;
|
|
12101
12133
|
this.graph = graph;
|
|
12102
12134
|
this.facadeChunkByModule = new Map();
|
|
12135
|
+
this.includedNamespaces = new Set();
|
|
12103
12136
|
}
|
|
12104
12137
|
async generate(isWrite) {
|
|
12105
12138
|
timeStart('GENERATE', 1);
|
|
@@ -12223,7 +12256,7 @@ class Bundle$1 {
|
|
|
12223
12256
|
}))
|
|
12224
12257
|
: getChunkAssignments(this.graph.entryModules, manualChunkAliasByEntry)) {
|
|
12225
12258
|
sortByExecutionOrder(modules);
|
|
12226
|
-
const chunk = new Chunk$1(modules, this.inputOptions, this.outputOptions, this.unsetOptions, this.pluginDriver, this.graph.modulesById, chunkByModule, this.facadeChunkByModule, alias);
|
|
12259
|
+
const chunk = new Chunk$1(modules, this.inputOptions, this.outputOptions, this.unsetOptions, this.pluginDriver, this.graph.modulesById, chunkByModule, this.facadeChunkByModule, this.includedNamespaces, alias);
|
|
12227
12260
|
chunks.push(chunk);
|
|
12228
12261
|
for (const module of modules) {
|
|
12229
12262
|
chunkByModule.set(module, chunk);
|
|
@@ -18673,7 +18706,7 @@ class Graph {
|
|
|
18673
18706
|
includeStatements() {
|
|
18674
18707
|
for (const module of [...this.entryModules, ...this.implicitEntryModules]) {
|
|
18675
18708
|
if (module.preserveSignature !== false) {
|
|
18676
|
-
module.includeAllExports();
|
|
18709
|
+
module.includeAllExports(false);
|
|
18677
18710
|
}
|
|
18678
18711
|
else {
|
|
18679
18712
|
markModuleAndImpureDependenciesAsExecuted(module);
|
package/dist/es/shared/watch.js
CHANGED
package/dist/loadConfigFile.js
CHANGED