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/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.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
|
|
@@ -19,7 +19,7 @@ function _interopNamespaceDefaultOnly(e) {
|
|
|
19
19
|
return {__proto__: null, 'default': e};
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
var version = "2.26.
|
|
22
|
+
var version = "2.26.5";
|
|
23
23
|
|
|
24
24
|
function ensureArray(items) {
|
|
25
25
|
if (Array.isArray(items)) {
|
|
@@ -4575,26 +4575,19 @@ class NamespaceVariable extends Variable {
|
|
|
4575
4575
|
memberVariables[name] = this.context.traceExport(name);
|
|
4576
4576
|
}
|
|
4577
4577
|
}
|
|
4578
|
-
this.memberVariables = memberVariables;
|
|
4579
4578
|
return (this.memberVariables = memberVariables);
|
|
4580
4579
|
}
|
|
4581
4580
|
include() {
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
4585
|
-
|
|
4586
|
-
|
|
4587
|
-
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4591
|
-
|
|
4592
|
-
// We directly include the variables instead of context.include to not automatically
|
|
4593
|
-
// generate imports for members from other modules
|
|
4594
|
-
for (const memberName of Object.keys(memberVariables))
|
|
4595
|
-
memberVariables[memberName].include();
|
|
4596
|
-
if (typeof this.syntheticNamedExports === 'string') {
|
|
4597
|
-
this.context.traceExport(this.syntheticNamedExports).include();
|
|
4581
|
+
this.included = true;
|
|
4582
|
+
this.context.includeAllExports();
|
|
4583
|
+
}
|
|
4584
|
+
prepareNamespace(mergedNamespaces) {
|
|
4585
|
+
this.mergedNamespaces = mergedNamespaces;
|
|
4586
|
+
const moduleExecIndex = this.context.getModuleExecIndex();
|
|
4587
|
+
for (const identifier of this.references) {
|
|
4588
|
+
if (identifier.context.getModuleExecIndex() <= moduleExecIndex) {
|
|
4589
|
+
this.referencedEarly = true;
|
|
4590
|
+
break;
|
|
4598
4591
|
}
|
|
4599
4592
|
}
|
|
4600
4593
|
}
|
|
@@ -4866,7 +4859,9 @@ function getReexportedImportName(moduleVariableName, imported, depNamedExportsMo
|
|
|
4866
4859
|
return depNamedExportsMode ? `${moduleVariableName}['default']` : moduleVariableName;
|
|
4867
4860
|
}
|
|
4868
4861
|
if (imported === '*') {
|
|
4869
|
-
return
|
|
4862
|
+
return (isChunk
|
|
4863
|
+
? !depNamedExportsMode
|
|
4864
|
+
: namespaceInteropHelpersByInteropType[String(interop(moduleId))])
|
|
4870
4865
|
? namespaceVariableName
|
|
4871
4866
|
: moduleVariableName;
|
|
4872
4867
|
}
|
|
@@ -4876,8 +4871,25 @@ function getReexportedImportName(moduleVariableName, imported, depNamedExportsMo
|
|
|
4876
4871
|
function getInteropBlock(dependencies, varOrConst, interop, externalLiveBindings, freeze, accessedGlobals, _, n, s, t) {
|
|
4877
4872
|
const neededInteropHelpers = new Set();
|
|
4878
4873
|
const interopStatements = [];
|
|
4879
|
-
|
|
4880
|
-
|
|
4874
|
+
const addInteropStatement = (helperVariableName, helper, dependencyVariableName) => {
|
|
4875
|
+
neededInteropHelpers.add(helper);
|
|
4876
|
+
interopStatements.push(`${varOrConst} ${helperVariableName}${_}=${_}/*#__PURE__*/${helper}(${dependencyVariableName});`);
|
|
4877
|
+
};
|
|
4878
|
+
for (const { defaultVariableName, imports, id, isChunk, name, namedExportsMode, namespaceVariableName, reexports } of dependencies) {
|
|
4879
|
+
if (isChunk) {
|
|
4880
|
+
for (const { imported, reexported } of [
|
|
4881
|
+
...(imports || []),
|
|
4882
|
+
...(reexports || [])
|
|
4883
|
+
]) {
|
|
4884
|
+
if (imported === '*' && reexported !== '*') {
|
|
4885
|
+
if (!namedExportsMode) {
|
|
4886
|
+
addInteropStatement(namespaceVariableName, getDefaultOnlyHelper(), name);
|
|
4887
|
+
}
|
|
4888
|
+
break;
|
|
4889
|
+
}
|
|
4890
|
+
}
|
|
4891
|
+
}
|
|
4892
|
+
else {
|
|
4881
4893
|
const moduleInterop = String(interop(id));
|
|
4882
4894
|
let hasDefault = false;
|
|
4883
4895
|
let hasNamespace = false;
|
|
@@ -4885,7 +4897,7 @@ function getInteropBlock(dependencies, varOrConst, interop, externalLiveBindings
|
|
|
4885
4897
|
...(imports || []),
|
|
4886
4898
|
...(reexports || [])
|
|
4887
4899
|
]) {
|
|
4888
|
-
let helper
|
|
4900
|
+
let helper;
|
|
4889
4901
|
let variableName;
|
|
4890
4902
|
if (imported === 'default') {
|
|
4891
4903
|
if (!hasDefault) {
|
|
@@ -4904,8 +4916,7 @@ function getInteropBlock(dependencies, varOrConst, interop, externalLiveBindings
|
|
|
4904
4916
|
}
|
|
4905
4917
|
}
|
|
4906
4918
|
if (helper) {
|
|
4907
|
-
|
|
4908
|
-
interopStatements.push(`${varOrConst} ${variableName}${_}=${_}/*#__PURE__*/${helper}(${name});`);
|
|
4919
|
+
addInteropStatement(variableName, helper, name);
|
|
4909
4920
|
}
|
|
4910
4921
|
}
|
|
4911
4922
|
}
|
|
@@ -6997,6 +7008,7 @@ class ConditionalExpression extends NodeBase {
|
|
|
6997
7008
|
isCalleeOfRenderedParent: renderedParentType
|
|
6998
7009
|
? isCalleeOfRenderedParent
|
|
6999
7010
|
: this.parent.callee === this,
|
|
7011
|
+
preventASI: true,
|
|
7000
7012
|
renderedParentType: renderedParentType || this.parent.type
|
|
7001
7013
|
});
|
|
7002
7014
|
}
|
|
@@ -7686,11 +7698,13 @@ class LogicalExpression extends NodeBase {
|
|
|
7686
7698
|
isCalleeOfRenderedParent: renderedParentType
|
|
7687
7699
|
? isCalleeOfRenderedParent
|
|
7688
7700
|
: this.parent.callee === this,
|
|
7701
|
+
preventASI,
|
|
7689
7702
|
renderedParentType: renderedParentType || this.parent.type
|
|
7690
7703
|
});
|
|
7691
7704
|
}
|
|
7692
7705
|
else {
|
|
7693
|
-
|
|
7706
|
+
this.left.render(code, options, { preventASI });
|
|
7707
|
+
this.right.render(code, options);
|
|
7694
7708
|
}
|
|
7695
7709
|
}
|
|
7696
7710
|
getUsedBranch() {
|
|
@@ -9032,7 +9046,7 @@ class YieldExpression extends NodeBase {
|
|
|
9032
9046
|
}
|
|
9033
9047
|
render(code, options) {
|
|
9034
9048
|
if (this.argument) {
|
|
9035
|
-
this.argument.render(code, options);
|
|
9049
|
+
this.argument.render(code, options, { preventASI: true });
|
|
9036
9050
|
if (this.argument.start === this.start + 5 /* 'yield'.length */) {
|
|
9037
9051
|
code.prependLeft(this.start + 5, ' ');
|
|
9038
9052
|
}
|
|
@@ -9890,17 +9904,19 @@ class Module {
|
|
|
9890
9904
|
if (this.ast.shouldBeIncluded(context))
|
|
9891
9905
|
this.ast.include(context, false);
|
|
9892
9906
|
}
|
|
9893
|
-
includeAllExports() {
|
|
9907
|
+
includeAllExports(includeNamespaceMembers) {
|
|
9894
9908
|
if (!this.isExecuted) {
|
|
9895
9909
|
this.graph.needsTreeshakingPass = true;
|
|
9896
9910
|
markModuleAndImpureDependenciesAsExecuted(this);
|
|
9897
9911
|
}
|
|
9898
9912
|
for (const exportName of this.getExports()) {
|
|
9899
|
-
|
|
9900
|
-
|
|
9901
|
-
|
|
9902
|
-
variable.
|
|
9903
|
-
|
|
9913
|
+
if (includeNamespaceMembers || exportName !== this.syntheticNamedExports) {
|
|
9914
|
+
const variable = this.getVariableForExportName(exportName);
|
|
9915
|
+
variable.deoptimizePath(UNKNOWN_PATH);
|
|
9916
|
+
if (!variable.included) {
|
|
9917
|
+
variable.include();
|
|
9918
|
+
this.graph.needsTreeshakingPass = true;
|
|
9919
|
+
}
|
|
9904
9920
|
}
|
|
9905
9921
|
}
|
|
9906
9922
|
for (const name of this.getReexports()) {
|
|
@@ -9914,6 +9930,9 @@ class Module {
|
|
|
9914
9930
|
variable.module.reexported = true;
|
|
9915
9931
|
}
|
|
9916
9932
|
}
|
|
9933
|
+
if (includeNamespaceMembers) {
|
|
9934
|
+
this.namespace.prepareNamespace(this.includeAndGetAdditionalMergedNamespaces());
|
|
9935
|
+
}
|
|
9917
9936
|
}
|
|
9918
9937
|
includeAllInBundle() {
|
|
9919
9938
|
this.ast.include(createInclusionContext(), true);
|
|
@@ -10011,7 +10030,7 @@ class Module {
|
|
|
10011
10030
|
getModuleName: this.basename.bind(this),
|
|
10012
10031
|
getReexports: this.getReexports.bind(this),
|
|
10013
10032
|
importDescriptions: this.importDescriptions,
|
|
10014
|
-
|
|
10033
|
+
includeAllExports: () => this.includeAllExports(true),
|
|
10015
10034
|
includeDynamicImport: this.includeDynamicImport.bind(this),
|
|
10016
10035
|
includeVariable: this.includeVariable.bind(this),
|
|
10017
10036
|
magicString: this.magicString,
|
|
@@ -10223,7 +10242,7 @@ class Module {
|
|
|
10223
10242
|
const resolution = this.dynamicImports.find(dynamicImport => dynamicImport.node === node).resolution;
|
|
10224
10243
|
if (resolution instanceof Module) {
|
|
10225
10244
|
resolution.includedDynamicImporters.push(this);
|
|
10226
|
-
resolution.includeAllExports();
|
|
10245
|
+
resolution.includeAllExports(true);
|
|
10227
10246
|
}
|
|
10228
10247
|
}
|
|
10229
10248
|
includeVariable(variable) {
|
|
@@ -10415,27 +10434,28 @@ const DECONFLICT_IMPORTED_VARIABLES_BY_FORMAT = {
|
|
|
10415
10434
|
system: deconflictImportsEsmOrSystem,
|
|
10416
10435
|
umd: deconflictImportsOther
|
|
10417
10436
|
};
|
|
10418
|
-
function deconflictChunk(modules, dependenciesToBeDeconflicted, imports, usedNames, format, interop, preserveModules, externalLiveBindings, chunkByModule, syntheticExports, exportNamesByVariable, accessedGlobalsByScope) {
|
|
10437
|
+
function deconflictChunk(modules, dependenciesToBeDeconflicted, imports, usedNames, format, interop, preserveModules, externalLiveBindings, chunkByModule, syntheticExports, exportNamesByVariable, accessedGlobalsByScope, includedNamespaces) {
|
|
10419
10438
|
for (const module of modules) {
|
|
10420
10439
|
module.scope.addUsedOutsideNames(usedNames, format, exportNamesByVariable, accessedGlobalsByScope);
|
|
10421
10440
|
}
|
|
10422
|
-
deconflictTopLevelVariables(usedNames, modules);
|
|
10441
|
+
deconflictTopLevelVariables(usedNames, modules, includedNamespaces);
|
|
10423
10442
|
DECONFLICT_IMPORTED_VARIABLES_BY_FORMAT[format](usedNames, imports, dependenciesToBeDeconflicted, interop, preserveModules, externalLiveBindings, chunkByModule, syntheticExports);
|
|
10424
10443
|
for (const module of modules) {
|
|
10425
10444
|
module.scope.deconflict(format, exportNamesByVariable, accessedGlobalsByScope);
|
|
10426
10445
|
}
|
|
10427
10446
|
}
|
|
10428
|
-
function deconflictImportsEsmOrSystem(usedNames, imports, dependenciesToBeDeconflicted, _interop,
|
|
10429
|
-
//
|
|
10430
|
-
// this is needed for synthetic exports and namespace reexports
|
|
10447
|
+
function deconflictImportsEsmOrSystem(usedNames, imports, dependenciesToBeDeconflicted, _interop, preserveModules, _externalLiveBindings, chunkByModule, syntheticExports) {
|
|
10448
|
+
// This is needed for namespace reexports
|
|
10431
10449
|
for (const dependency of dependenciesToBeDeconflicted.dependencies) {
|
|
10432
|
-
|
|
10450
|
+
if (preserveModules || dependency instanceof ExternalModule) {
|
|
10451
|
+
dependency.variableName = getSafeName(dependency.suggestedVariableName, usedNames);
|
|
10452
|
+
}
|
|
10433
10453
|
}
|
|
10434
10454
|
for (const variable of imports) {
|
|
10435
10455
|
const module = variable.module;
|
|
10436
10456
|
const name = variable.name;
|
|
10437
|
-
if (
|
|
10438
|
-
variable.setRenderNames(null, module.variableName);
|
|
10457
|
+
if (variable.isNamespace && (preserveModules || module instanceof ExternalModule)) {
|
|
10458
|
+
variable.setRenderNames(null, (module instanceof ExternalModule ? module : chunkByModule.get(module)).variableName);
|
|
10439
10459
|
}
|
|
10440
10460
|
else if (module instanceof ExternalModule && name === 'default') {
|
|
10441
10461
|
variable.setRenderNames(null, getSafeName([...module.exportedVariables].some(([exportedVariable, exportedName]) => exportedName === '*' && exportedVariable.included)
|
|
@@ -10454,8 +10474,8 @@ function deconflictImportsOther(usedNames, imports, { deconflictedDefault, decon
|
|
|
10454
10474
|
for (const chunkOrExternalModule of dependencies) {
|
|
10455
10475
|
chunkOrExternalModule.variableName = getSafeName(chunkOrExternalModule.suggestedVariableName, usedNames);
|
|
10456
10476
|
}
|
|
10457
|
-
for (const
|
|
10458
|
-
|
|
10477
|
+
for (const externalModuleOrChunk of deconflictedNamespace) {
|
|
10478
|
+
externalModuleOrChunk.namespaceVariableName = getSafeName(`${externalModuleOrChunk.suggestedVariableName}__namespace`, usedNames);
|
|
10459
10479
|
}
|
|
10460
10480
|
for (const externalModule of deconflictedDefault) {
|
|
10461
10481
|
if (deconflictedNamespace.has(externalModule) &&
|
|
@@ -10494,7 +10514,10 @@ function deconflictImportsOther(usedNames, imports, { deconflictedDefault, decon
|
|
|
10494
10514
|
}
|
|
10495
10515
|
else {
|
|
10496
10516
|
const chunk = chunkByModule.get(module);
|
|
10497
|
-
if (
|
|
10517
|
+
if (preserveModules && variable.isNamespace) {
|
|
10518
|
+
variable.setRenderNames(null, chunk.exportMode === 'default' ? chunk.namespaceVariableName : chunk.variableName);
|
|
10519
|
+
}
|
|
10520
|
+
else if (chunk.exportMode === 'default') {
|
|
10498
10521
|
variable.setRenderNames(null, chunk.variableName);
|
|
10499
10522
|
}
|
|
10500
10523
|
else {
|
|
@@ -10503,7 +10526,7 @@ function deconflictImportsOther(usedNames, imports, { deconflictedDefault, decon
|
|
|
10503
10526
|
}
|
|
10504
10527
|
}
|
|
10505
10528
|
}
|
|
10506
|
-
function deconflictTopLevelVariables(usedNames, modules) {
|
|
10529
|
+
function deconflictTopLevelVariables(usedNames, modules, includedNamespaces) {
|
|
10507
10530
|
for (const module of modules) {
|
|
10508
10531
|
for (const variable of module.scope.variables.values()) {
|
|
10509
10532
|
if (variable.included &&
|
|
@@ -10513,8 +10536,8 @@ function deconflictTopLevelVariables(usedNames, modules) {
|
|
|
10513
10536
|
variable.setRenderNames(null, getSafeName(variable.name, usedNames));
|
|
10514
10537
|
}
|
|
10515
10538
|
}
|
|
10516
|
-
|
|
10517
|
-
|
|
10539
|
+
if (includedNamespaces.has(module)) {
|
|
10540
|
+
const namespace = module.namespace;
|
|
10518
10541
|
namespace.setRenderNames(null, getSafeName(namespace.name, usedNames));
|
|
10519
10542
|
}
|
|
10520
10543
|
}
|
|
@@ -10770,7 +10793,7 @@ function getGlobalName(module, globals, hasExports, warn) {
|
|
|
10770
10793
|
}
|
|
10771
10794
|
}
|
|
10772
10795
|
class Chunk$1 {
|
|
10773
|
-
constructor(orderedModules, inputOptions, outputOptions, unsetOptions, pluginDriver, modulesById, chunkByModule, facadeChunkByModule, manualChunkAlias) {
|
|
10796
|
+
constructor(orderedModules, inputOptions, outputOptions, unsetOptions, pluginDriver, modulesById, chunkByModule, facadeChunkByModule, includedNamespaces, manualChunkAlias) {
|
|
10774
10797
|
this.orderedModules = orderedModules;
|
|
10775
10798
|
this.inputOptions = inputOptions;
|
|
10776
10799
|
this.outputOptions = outputOptions;
|
|
@@ -10779,11 +10802,13 @@ class Chunk$1 {
|
|
|
10779
10802
|
this.modulesById = modulesById;
|
|
10780
10803
|
this.chunkByModule = chunkByModule;
|
|
10781
10804
|
this.facadeChunkByModule = facadeChunkByModule;
|
|
10805
|
+
this.includedNamespaces = includedNamespaces;
|
|
10782
10806
|
this.manualChunkAlias = manualChunkAlias;
|
|
10783
10807
|
this.entryModules = [];
|
|
10784
10808
|
this.exportMode = 'named';
|
|
10785
10809
|
this.facadeModule = null;
|
|
10786
10810
|
this.id = null;
|
|
10811
|
+
this.namespaceVariableName = '';
|
|
10787
10812
|
this.variableName = '';
|
|
10788
10813
|
this.accessedGlobalsByScope = new Map();
|
|
10789
10814
|
this.dependencies = new Set();
|
|
@@ -10812,6 +10837,9 @@ class Chunk$1 {
|
|
|
10812
10837
|
this.execIndex = orderedModules.length > 0 ? orderedModules[0].execIndex : Infinity;
|
|
10813
10838
|
const chunkModules = new Set(orderedModules);
|
|
10814
10839
|
for (const module of orderedModules) {
|
|
10840
|
+
if (module.namespace.included) {
|
|
10841
|
+
includedNamespaces.add(module);
|
|
10842
|
+
}
|
|
10815
10843
|
if (this.isEmpty && module.isIncluded()) {
|
|
10816
10844
|
this.isEmpty = false;
|
|
10817
10845
|
}
|
|
@@ -10822,8 +10850,8 @@ class Chunk$1 {
|
|
|
10822
10850
|
if (!chunkModules.has(importer)) {
|
|
10823
10851
|
this.dynamicEntryModules.push(module);
|
|
10824
10852
|
// Modules with synthetic exports need an artificial namespace for dynamic imports
|
|
10825
|
-
if (module.syntheticNamedExports) {
|
|
10826
|
-
|
|
10853
|
+
if (module.syntheticNamedExports && !outputOptions.preserveModules) {
|
|
10854
|
+
includedNamespaces.add(module);
|
|
10827
10855
|
this.exports.add(module.namespace);
|
|
10828
10856
|
}
|
|
10829
10857
|
}
|
|
@@ -10834,8 +10862,8 @@ class Chunk$1 {
|
|
|
10834
10862
|
}
|
|
10835
10863
|
this.suggestedVariableName = makeLegal(this.generateVariableName());
|
|
10836
10864
|
}
|
|
10837
|
-
static generateFacade(inputOptions, outputOptions, unsetOptions, pluginDriver, modulesById, chunkByModule, facadeChunkByModule, facadedModule, facadeName) {
|
|
10838
|
-
const chunk = new Chunk$1([], inputOptions, outputOptions, unsetOptions, pluginDriver, modulesById, chunkByModule, facadeChunkByModule, null);
|
|
10865
|
+
static generateFacade(inputOptions, outputOptions, unsetOptions, pluginDriver, modulesById, chunkByModule, facadeChunkByModule, includedNamespaces, facadedModule, facadeName) {
|
|
10866
|
+
const chunk = new Chunk$1([], inputOptions, outputOptions, unsetOptions, pluginDriver, modulesById, chunkByModule, facadeChunkByModule, includedNamespaces, null);
|
|
10839
10867
|
chunk.assignFacadeName(facadeName, facadedModule);
|
|
10840
10868
|
if (!facadeChunkByModule.has(facadedModule)) {
|
|
10841
10869
|
facadeChunkByModule.set(facadedModule, chunk);
|
|
@@ -10937,7 +10965,7 @@ class Chunk$1 {
|
|
|
10937
10965
|
this.assignFacadeName(requiredFacades.shift(), module);
|
|
10938
10966
|
}
|
|
10939
10967
|
for (const facadeName of requiredFacades) {
|
|
10940
|
-
facades.push(Chunk$1.generateFacade(this.inputOptions, this.outputOptions, this.unsetOptions, this.pluginDriver, this.modulesById, this.chunkByModule, this.facadeChunkByModule, module, facadeName));
|
|
10968
|
+
facades.push(Chunk$1.generateFacade(this.inputOptions, this.outputOptions, this.unsetOptions, this.pluginDriver, this.modulesById, this.chunkByModule, this.facadeChunkByModule, this.includedNamespaces, module, facadeName));
|
|
10941
10969
|
}
|
|
10942
10970
|
}
|
|
10943
10971
|
for (const module of this.dynamicEntryModules) {
|
|
@@ -10955,7 +10983,7 @@ class Chunk$1 {
|
|
|
10955
10983
|
this.strictFacade = true;
|
|
10956
10984
|
}
|
|
10957
10985
|
else if (!((_a = this.facadeChunkByModule.get(module)) === null || _a === void 0 ? void 0 : _a.strictFacade)) {
|
|
10958
|
-
|
|
10986
|
+
this.includedNamespaces.add(module);
|
|
10959
10987
|
this.exports.add(module.namespace);
|
|
10960
10988
|
}
|
|
10961
10989
|
}
|
|
@@ -11103,7 +11131,7 @@ class Chunk$1 {
|
|
|
11103
11131
|
const renderedModules = this.renderedModules;
|
|
11104
11132
|
for (const module of this.orderedModules) {
|
|
11105
11133
|
let renderedLength = 0;
|
|
11106
|
-
if (module.isIncluded()) {
|
|
11134
|
+
if (module.isIncluded() || this.includedNamespaces.has(module)) {
|
|
11107
11135
|
const source = module.render(renderOptions).trim();
|
|
11108
11136
|
renderedLength = source.length();
|
|
11109
11137
|
if (renderedLength) {
|
|
@@ -11114,7 +11142,7 @@ class Chunk$1 {
|
|
|
11114
11142
|
this.usedModules.push(module);
|
|
11115
11143
|
}
|
|
11116
11144
|
const namespace = module.namespace;
|
|
11117
|
-
if (
|
|
11145
|
+
if (this.includedNamespaces.has(module) && !this.outputOptions.preserveModules) {
|
|
11118
11146
|
const rendered = namespace.renderBlock(renderOptions);
|
|
11119
11147
|
if (namespace.renderFirst())
|
|
11120
11148
|
hoistedSource += n + rendered;
|
|
@@ -11460,6 +11488,11 @@ class Chunk$1 {
|
|
|
11460
11488
|
const chunk = this.chunkByModule.get(module);
|
|
11461
11489
|
if (chunk !== this) {
|
|
11462
11490
|
dependencies.add(chunk);
|
|
11491
|
+
if (addNonNamespacesAndInteropHelpers &&
|
|
11492
|
+
chunk.exportMode === 'default' &&
|
|
11493
|
+
variable.isNamespace) {
|
|
11494
|
+
deconflictedNamespace.add(chunk);
|
|
11495
|
+
}
|
|
11463
11496
|
}
|
|
11464
11497
|
}
|
|
11465
11498
|
}
|
|
@@ -11674,16 +11707,15 @@ class Chunk$1 {
|
|
|
11674
11707
|
usedNames.add(helper);
|
|
11675
11708
|
}
|
|
11676
11709
|
}
|
|
11677
|
-
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);
|
|
11710
|
+
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);
|
|
11678
11711
|
}
|
|
11679
11712
|
setUpChunkImportsAndExportsForModule(module) {
|
|
11680
11713
|
const moduleImports = new Set(module.imports);
|
|
11681
11714
|
// when we are not preserving modules, we need to make all namespace variables available for
|
|
11682
11715
|
// rendering the namespace object
|
|
11683
11716
|
if (!this.outputOptions.preserveModules) {
|
|
11684
|
-
|
|
11685
|
-
|
|
11686
|
-
const memberVariables = namespace.getMemberVariables();
|
|
11717
|
+
if (this.includedNamespaces.has(module)) {
|
|
11718
|
+
const memberVariables = module.namespace.getMemberVariables();
|
|
11687
11719
|
for (const name of Object.keys(memberVariables)) {
|
|
11688
11720
|
moduleImports.add(memberVariables[name]);
|
|
11689
11721
|
}
|
|
@@ -11705,7 +11737,7 @@ class Chunk$1 {
|
|
|
11705
11737
|
}
|
|
11706
11738
|
}
|
|
11707
11739
|
}
|
|
11708
|
-
if (
|
|
11740
|
+
if (this.includedNamespaces.has(module) ||
|
|
11709
11741
|
(module.isEntryPoint && module.preserveSignature !== false) ||
|
|
11710
11742
|
module.includedDynamicImporters.some(importer => this.chunkByModule.get(importer) !== this)) {
|
|
11711
11743
|
this.ensureReexportsAreAvailableForModule(module);
|
|
@@ -11714,8 +11746,8 @@ class Chunk$1 {
|
|
|
11714
11746
|
if (node.included &&
|
|
11715
11747
|
resolution instanceof Module &&
|
|
11716
11748
|
this.chunkByModule.get(resolution) === this &&
|
|
11717
|
-
!
|
|
11718
|
-
|
|
11749
|
+
!this.includedNamespaces.has(resolution)) {
|
|
11750
|
+
this.includedNamespaces.add(resolution);
|
|
11719
11751
|
this.ensureReexportsAreAvailableForModule(resolution);
|
|
11720
11752
|
}
|
|
11721
11753
|
}
|
|
@@ -12156,6 +12188,7 @@ class Bundle$1 {
|
|
|
12156
12188
|
this.pluginDriver = pluginDriver;
|
|
12157
12189
|
this.graph = graph;
|
|
12158
12190
|
this.facadeChunkByModule = new Map();
|
|
12191
|
+
this.includedNamespaces = new Set();
|
|
12159
12192
|
}
|
|
12160
12193
|
async generate(isWrite) {
|
|
12161
12194
|
timeStart('GENERATE', 1);
|
|
@@ -12279,7 +12312,7 @@ class Bundle$1 {
|
|
|
12279
12312
|
}))
|
|
12280
12313
|
: getChunkAssignments(this.graph.entryModules, manualChunkAliasByEntry)) {
|
|
12281
12314
|
sortByExecutionOrder(modules);
|
|
12282
|
-
const chunk = new Chunk$1(modules, this.inputOptions, this.outputOptions, this.unsetOptions, this.pluginDriver, this.graph.modulesById, chunkByModule, this.facadeChunkByModule, alias);
|
|
12315
|
+
const chunk = new Chunk$1(modules, this.inputOptions, this.outputOptions, this.unsetOptions, this.pluginDriver, this.graph.modulesById, chunkByModule, this.facadeChunkByModule, this.includedNamespaces, alias);
|
|
12283
12316
|
chunks.push(chunk);
|
|
12284
12317
|
for (const module of modules) {
|
|
12285
12318
|
chunkByModule.set(module, chunk);
|
|
@@ -18729,7 +18762,7 @@ class Graph {
|
|
|
18729
18762
|
includeStatements() {
|
|
18730
18763
|
for (const module of [...this.entryModules, ...this.implicitEntryModules]) {
|
|
18731
18764
|
if (module.preserveSignature !== false) {
|
|
18732
|
-
module.includeAllExports();
|
|
18765
|
+
module.includeAllExports(false);
|
|
18733
18766
|
}
|
|
18734
18767
|
else {
|
|
18735
18768
|
markModuleAndImpureDependenciesAsExecuted(module);
|
package/dist/shared/watch-cli.js
CHANGED
package/dist/shared/watch.js
CHANGED