rollup 2.46.0 → 2.47.0
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 +11 -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 +137 -88
- package/dist/es/shared/watch.js +2 -2
- package/dist/loadConfigFile.js +2 -2
- package/dist/rollup.browser.js +3 -3
- package/dist/rollup.browser.js.map +1 -1
- package/dist/rollup.js +2 -2
- package/dist/shared/index.js +2 -2
- package/dist/shared/loadConfigFile.js +8 -18
- package/dist/shared/mergeOptions.js +2 -2
- package/dist/shared/rollup.js +124 -74
- 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.
|
|
4
|
-
|
|
3
|
+
Rollup.js v2.47.0
|
|
4
|
+
Tue, 04 May 2021 05:02:40 GMT - commit 6cc9d6b5137dd80fef9618e97471f89f8fbc54ad
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
https://github.com/rollup/rollup
|
|
@@ -14,7 +14,7 @@ import * as fs from 'fs';
|
|
|
14
14
|
import { lstatSync, realpathSync, readdirSync } from 'fs';
|
|
15
15
|
import { EventEmitter } from 'events';
|
|
16
16
|
|
|
17
|
-
var version$1 = "2.
|
|
17
|
+
var version$1 = "2.47.0";
|
|
18
18
|
|
|
19
19
|
var charToInteger = {};
|
|
20
20
|
var chars$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
|
@@ -4351,14 +4351,17 @@ class NamespaceVariable extends Variable {
|
|
|
4351
4351
|
this.references.push(identifier);
|
|
4352
4352
|
this.name = identifier.name;
|
|
4353
4353
|
}
|
|
4354
|
-
|
|
4355
|
-
// build fails due to an illegal namespace reassignment or MemberExpression already forwards
|
|
4356
|
-
// the reassignment to the right variable. This means we lost track of this variable and thus
|
|
4357
|
-
// need to reassign all exports.
|
|
4358
|
-
deoptimizePath() {
|
|
4354
|
+
deoptimizePath(path) {
|
|
4359
4355
|
const memberVariables = this.getMemberVariables();
|
|
4360
|
-
|
|
4361
|
-
|
|
4356
|
+
const memberPath = path.length <= 1 ? UNKNOWN_PATH : path.slice(1);
|
|
4357
|
+
const key = path[0];
|
|
4358
|
+
if (typeof key !== 'string') {
|
|
4359
|
+
for (const key of Object.keys(memberVariables)) {
|
|
4360
|
+
memberVariables[key].deoptimizePath(memberPath);
|
|
4361
|
+
}
|
|
4362
|
+
}
|
|
4363
|
+
else {
|
|
4364
|
+
memberVariables[key].deoptimizePath(memberPath);
|
|
4362
4365
|
}
|
|
4363
4366
|
}
|
|
4364
4367
|
getMemberVariables() {
|
|
@@ -4368,7 +4371,10 @@ class NamespaceVariable extends Variable {
|
|
|
4368
4371
|
const memberVariables = Object.create(null);
|
|
4369
4372
|
for (const name of this.context.getExports().concat(this.context.getReexports())) {
|
|
4370
4373
|
if (name[0] !== '*' && name !== this.module.info.syntheticNamedExports) {
|
|
4371
|
-
|
|
4374
|
+
const exportedVariable = this.context.traceExport(name);
|
|
4375
|
+
if (exportedVariable) {
|
|
4376
|
+
memberVariables[name] = exportedVariable;
|
|
4377
|
+
}
|
|
4372
4378
|
}
|
|
4373
4379
|
}
|
|
4374
4380
|
return (this.memberVariables = memberVariables);
|
|
@@ -4541,6 +4547,32 @@ function normalize(path) {
|
|
|
4541
4547
|
return path.replace(/\\/g, '/');
|
|
4542
4548
|
}
|
|
4543
4549
|
|
|
4550
|
+
function printQuotedStringList(list, verbs) {
|
|
4551
|
+
const isSingleItem = list.length <= 1;
|
|
4552
|
+
const quotedList = list.map(item => `"${item}"`);
|
|
4553
|
+
let output = isSingleItem
|
|
4554
|
+
? quotedList[0]
|
|
4555
|
+
: `${quotedList.slice(0, -1).join(', ')} and ${quotedList.slice(-1)[0]}`;
|
|
4556
|
+
if (verbs) {
|
|
4557
|
+
output += ` ${isSingleItem ? verbs[0] : verbs[1]}`;
|
|
4558
|
+
}
|
|
4559
|
+
return output;
|
|
4560
|
+
}
|
|
4561
|
+
|
|
4562
|
+
function getAliasName(id) {
|
|
4563
|
+
const base = basename(id);
|
|
4564
|
+
return base.substr(0, base.length - extname(id).length);
|
|
4565
|
+
}
|
|
4566
|
+
function relativeId(id) {
|
|
4567
|
+
if (!isAbsolute(id))
|
|
4568
|
+
return id;
|
|
4569
|
+
return relative$1(resolve(), id);
|
|
4570
|
+
}
|
|
4571
|
+
function isPathFragment(name) {
|
|
4572
|
+
// starting with "/", "./", "../", "C:/"
|
|
4573
|
+
return name[0] === '/' || name[0] === '.' && (name[1] === '/' || name[1] === '.') || isAbsolute(name);
|
|
4574
|
+
}
|
|
4575
|
+
|
|
4544
4576
|
class ExternalModule {
|
|
4545
4577
|
constructor(options, id, hasModuleSideEffects, meta, renormalizeRenderPath) {
|
|
4546
4578
|
this.options = options;
|
|
@@ -4618,25 +4650,17 @@ class ExternalModule {
|
|
|
4618
4650
|
});
|
|
4619
4651
|
if (unused.length === 0)
|
|
4620
4652
|
return;
|
|
4621
|
-
const names = unused.length === 1
|
|
4622
|
-
? `'${unused[0]}' is`
|
|
4623
|
-
: `${unused
|
|
4624
|
-
.slice(0, -1)
|
|
4625
|
-
.map(name => `'${name}'`)
|
|
4626
|
-
.join(', ')} and '${unused.slice(-1)}' are`;
|
|
4627
4653
|
const importersSet = new Set();
|
|
4628
4654
|
for (const name of unused) {
|
|
4629
|
-
const { importers
|
|
4630
|
-
|
|
4631
|
-
|
|
4632
|
-
|
|
4633
|
-
|
|
4634
|
-
|
|
4635
|
-
const importersArray = Array.from(importersSet);
|
|
4636
|
-
const importerList = ' in' + importersArray.map(s => `\n\t${s};`);
|
|
4655
|
+
const { importers } = this.declarations[name].module;
|
|
4656
|
+
for (const importer of importers) {
|
|
4657
|
+
importersSet.add(importer);
|
|
4658
|
+
}
|
|
4659
|
+
}
|
|
4660
|
+
const importersArray = [...importersSet];
|
|
4637
4661
|
this.options.onwarn({
|
|
4638
4662
|
code: 'UNUSED_EXTERNAL_IMPORT',
|
|
4639
|
-
message: `${
|
|
4663
|
+
message: `${printQuotedStringList(unused, ['is', 'are'])} imported from external module "${this.id}" but never used in ${printQuotedStringList(importersArray.map(importer => relativeId(importer)))}.`,
|
|
4640
4664
|
names: unused,
|
|
4641
4665
|
source: this.id,
|
|
4642
4666
|
sources: importersArray
|
|
@@ -4960,15 +4984,9 @@ function warnOnBuiltins(warn, dependencies) {
|
|
|
4960
4984
|
const externalBuiltins = dependencies.map(({ id }) => id).filter(id => id in builtins);
|
|
4961
4985
|
if (!externalBuiltins.length)
|
|
4962
4986
|
return;
|
|
4963
|
-
const detail = externalBuiltins.length === 1
|
|
4964
|
-
? `module ('${externalBuiltins[0]}')`
|
|
4965
|
-
: `modules (${externalBuiltins
|
|
4966
|
-
.slice(0, -1)
|
|
4967
|
-
.map(name => `'${name}'`)
|
|
4968
|
-
.join(', ')} and '${externalBuiltins.slice(-1)}')`;
|
|
4969
4987
|
warn({
|
|
4970
4988
|
code: 'MISSING_NODE_BUILTINS',
|
|
4971
|
-
message: `Creating a browser bundle that depends on Node.js built-in ${
|
|
4989
|
+
message: `Creating a browser bundle that depends on Node.js built-in modules (${printQuotedStringList(externalBuiltins)}). You might need to include https://github.com/ionic-team/rollup-plugin-node-polyfills`,
|
|
4972
4990
|
modules: externalBuiltins
|
|
4973
4991
|
});
|
|
4974
4992
|
}
|
|
@@ -5203,20 +5221,6 @@ function getCodeFrame(source, line, column) {
|
|
|
5203
5221
|
.join('\n');
|
|
5204
5222
|
}
|
|
5205
5223
|
|
|
5206
|
-
function getAliasName(id) {
|
|
5207
|
-
const base = basename(id);
|
|
5208
|
-
return base.substr(0, base.length - extname(id).length);
|
|
5209
|
-
}
|
|
5210
|
-
function relativeId(id) {
|
|
5211
|
-
if (!isAbsolute(id))
|
|
5212
|
-
return id;
|
|
5213
|
-
return relative$1(resolve(), id);
|
|
5214
|
-
}
|
|
5215
|
-
function isPathFragment(name) {
|
|
5216
|
-
// starting with "/", "./", "../", "C:/"
|
|
5217
|
-
return name[0] === '/' || name[0] === '.' && (name[1] === '/' || name[1] === '.') || isAbsolute(name);
|
|
5218
|
-
}
|
|
5219
|
-
|
|
5220
5224
|
function error(base) {
|
|
5221
5225
|
if (!(base instanceof Error))
|
|
5222
5226
|
base = Object.assign(new Error(base.message), base);
|
|
@@ -5265,6 +5269,7 @@ var Errors;
|
|
|
5265
5269
|
Errors["MISSING_IMPLICIT_DEPENDANT"] = "MISSING_IMPLICIT_DEPENDANT";
|
|
5266
5270
|
Errors["MIXED_EXPORTS"] = "MIXED_EXPORTS";
|
|
5267
5271
|
Errors["NAMESPACE_CONFLICT"] = "NAMESPACE_CONFLICT";
|
|
5272
|
+
Errors["AMBIGUOUS_EXTERNAL_NAMESPACES"] = "AMBIGUOUS_EXTERNAL_NAMESPACES";
|
|
5268
5273
|
Errors["NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE"] = "NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE";
|
|
5269
5274
|
Errors["PLUGIN_ERROR"] = "PLUGIN_ERROR";
|
|
5270
5275
|
Errors["PREFER_NAMED_EXPORTS"] = "PREFER_NAMED_EXPORTS";
|
|
@@ -5430,9 +5435,7 @@ function errImplicitDependantIsNotIncluded(module) {
|
|
|
5430
5435
|
const implicitDependencies = Array.from(module.implicitlyLoadedBefore, dependency => relativeId(dependency.id)).sort();
|
|
5431
5436
|
return {
|
|
5432
5437
|
code: Errors.MISSING_IMPLICIT_DEPENDANT,
|
|
5433
|
-
message: `Module "${relativeId(module.id)}" that should be implicitly loaded before
|
|
5434
|
-
? implicitDependencies[0]
|
|
5435
|
-
: `${implicitDependencies.slice(0, -1).join('", "')}" and "${implicitDependencies.slice(-1)[0]}`}" is not included in the module graph. Either it was not imported by an included module or only via a tree-shaken dynamic import, or no imported bindings were used and it had otherwise no side-effects.`
|
|
5438
|
+
message: `Module "${relativeId(module.id)}" that should be implicitly loaded before ${printQuotedStringList(implicitDependencies)} is not included in the module graph. Either it was not imported by an included module or only via a tree-shaken dynamic import, or no imported bindings were used and it had otherwise no side-effects.`
|
|
5436
5439
|
};
|
|
5437
5440
|
}
|
|
5438
5441
|
function errMixedExport(facadeModuleId, name) {
|
|
@@ -5446,12 +5449,21 @@ function errMixedExport(facadeModuleId, name) {
|
|
|
5446
5449
|
function errNamespaceConflict(name, reexportingModule, additionalExportAllModule) {
|
|
5447
5450
|
return {
|
|
5448
5451
|
code: Errors.NAMESPACE_CONFLICT,
|
|
5449
|
-
message: `Conflicting namespaces: ${relativeId(reexportingModule.id)} re-exports
|
|
5452
|
+
message: `Conflicting namespaces: "${relativeId(reexportingModule.id)}" re-exports "${name}" from both "${relativeId(reexportingModule.exportsAll[name])}" and "${relativeId(additionalExportAllModule.exportsAll[name])}" (will be ignored)`,
|
|
5450
5453
|
name,
|
|
5451
5454
|
reexporter: reexportingModule.id,
|
|
5452
5455
|
sources: [reexportingModule.exportsAll[name], additionalExportAllModule.exportsAll[name]]
|
|
5453
5456
|
};
|
|
5454
5457
|
}
|
|
5458
|
+
function errAmbiguousExternalNamespaces(name, reexportingModule, usedExternalModule, externalModules) {
|
|
5459
|
+
return {
|
|
5460
|
+
code: Errors.AMBIGUOUS_EXTERNAL_NAMESPACES,
|
|
5461
|
+
message: `Ambiguous external namespace resolution: "${relativeId(reexportingModule)}" re-exports "${name}" from one of the external modules ${printQuotedStringList(externalModules.map(module => relativeId(module)))}, guessing "${relativeId(usedExternalModule)}".`,
|
|
5462
|
+
name,
|
|
5463
|
+
reexporter: reexportingModule,
|
|
5464
|
+
sources: externalModules
|
|
5465
|
+
};
|
|
5466
|
+
}
|
|
5455
5467
|
function errNoTransformMapOrAstWithoutCode(pluginName) {
|
|
5456
5468
|
return {
|
|
5457
5469
|
code: Errors.NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE,
|
|
@@ -6517,15 +6529,9 @@ class MemberExpression extends NodeBase {
|
|
|
6517
6529
|
if (this.variable) {
|
|
6518
6530
|
this.variable.deoptimizePath(path);
|
|
6519
6531
|
}
|
|
6520
|
-
else {
|
|
6521
|
-
|
|
6522
|
-
|
|
6523
|
-
this.object.deoptimizePath(UNKNOWN_PATH);
|
|
6524
|
-
}
|
|
6525
|
-
else {
|
|
6526
|
-
this.wasPathDeoptimizedWhileOptimized = true;
|
|
6527
|
-
this.object.deoptimizePath([propertyKey, ...path]);
|
|
6528
|
-
}
|
|
6532
|
+
else if (!this.replacement) {
|
|
6533
|
+
this.wasPathDeoptimizedWhileOptimized = true;
|
|
6534
|
+
this.object.deoptimizePath([this.getPropertyKey(), ...path]);
|
|
6529
6535
|
}
|
|
6530
6536
|
}
|
|
6531
6537
|
getLiteralValueAtPath(path, recursionTracker, origin) {
|
|
@@ -9523,8 +9529,11 @@ function findSourceMappingURLComments(ast, code) {
|
|
|
9523
9529
|
}
|
|
9524
9530
|
let sourcemappingUrlMatch;
|
|
9525
9531
|
const interStatmentCode = code.slice(start, end);
|
|
9526
|
-
while (sourcemappingUrlMatch = SOURCEMAPPING_URL_COMMENT_RE.exec(interStatmentCode)) {
|
|
9527
|
-
ret.push([
|
|
9532
|
+
while ((sourcemappingUrlMatch = SOURCEMAPPING_URL_COMMENT_RE.exec(interStatmentCode))) {
|
|
9533
|
+
ret.push([
|
|
9534
|
+
start + sourcemappingUrlMatch.index,
|
|
9535
|
+
start + SOURCEMAPPING_URL_COMMENT_RE.lastIndex
|
|
9536
|
+
]);
|
|
9528
9537
|
}
|
|
9529
9538
|
};
|
|
9530
9539
|
let prevStmtEnd = 0;
|
|
@@ -9535,7 +9544,7 @@ function findSourceMappingURLComments(ast, code) {
|
|
|
9535
9544
|
addCommentsPos(prevStmtEnd, code.length);
|
|
9536
9545
|
return ret;
|
|
9537
9546
|
}
|
|
9538
|
-
function getVariableForExportNameRecursive(target, name, importerForSideEffects, isExportAllSearch, searchedNamesAndModules = new Map()) {
|
|
9547
|
+
function getVariableForExportNameRecursive(target, name, importerForSideEffects, isExportAllSearch, searchedNamesAndModules = new Map(), skipExternalNamespaceReexports) {
|
|
9539
9548
|
const searchedModules = searchedNamesAndModules.get(name);
|
|
9540
9549
|
if (searchedModules) {
|
|
9541
9550
|
if (searchedModules.has(target)) {
|
|
@@ -9546,7 +9555,12 @@ function getVariableForExportNameRecursive(target, name, importerForSideEffects,
|
|
|
9546
9555
|
else {
|
|
9547
9556
|
searchedNamesAndModules.set(name, new Set([target]));
|
|
9548
9557
|
}
|
|
9549
|
-
return target.getVariableForExportName(name,
|
|
9558
|
+
return target.getVariableForExportName(name, {
|
|
9559
|
+
importerForSideEffects,
|
|
9560
|
+
isExportAllSearch,
|
|
9561
|
+
searchedNamesAndModules,
|
|
9562
|
+
skipExternalNamespaceReexports
|
|
9563
|
+
});
|
|
9550
9564
|
}
|
|
9551
9565
|
function getAndExtendSideEffectModules(variable, module) {
|
|
9552
9566
|
const sideEffectModules = getOrCreate(module.sideEffectDependenciesByVariable, variable, () => new Set());
|
|
@@ -9611,6 +9625,7 @@ class Module {
|
|
|
9611
9625
|
this.exportAllModules = [];
|
|
9612
9626
|
this.exportNamesByVariable = null;
|
|
9613
9627
|
this.exportShimVariable = new ExportShimVariable(this);
|
|
9628
|
+
this.namespaceReexportsByName = Object.create(null);
|
|
9614
9629
|
this.relevantDependencies = null;
|
|
9615
9630
|
this.syntheticExports = new Map();
|
|
9616
9631
|
this.syntheticNamespace = null;
|
|
@@ -9702,7 +9717,10 @@ class Module {
|
|
|
9702
9717
|
this.implicitlyLoadedAfter.size > 0) {
|
|
9703
9718
|
dependencyVariables = new Set(dependencyVariables);
|
|
9704
9719
|
for (const exportName of [...this.getReexports(), ...this.getExports()]) {
|
|
9705
|
-
|
|
9720
|
+
const exportedVariable = this.getVariableForExportName(exportName);
|
|
9721
|
+
if (exportedVariable) {
|
|
9722
|
+
dependencyVariables.add(exportedVariable);
|
|
9723
|
+
}
|
|
9706
9724
|
}
|
|
9707
9725
|
}
|
|
9708
9726
|
for (let variable of dependencyVariables) {
|
|
@@ -9807,7 +9825,7 @@ class Module {
|
|
|
9807
9825
|
}
|
|
9808
9826
|
return this.syntheticNamespace;
|
|
9809
9827
|
}
|
|
9810
|
-
getVariableForExportName(name, importerForSideEffects, isExportAllSearch, searchedNamesAndModules) {
|
|
9828
|
+
getVariableForExportName(name, { importerForSideEffects, isExportAllSearch, searchedNamesAndModules, skipExternalNamespaceReexports } = EMPTY_OBJECT) {
|
|
9811
9829
|
if (name[0] === '*') {
|
|
9812
9830
|
if (name.length === 1) {
|
|
9813
9831
|
// export * from './other'
|
|
@@ -9822,7 +9840,7 @@ class Module {
|
|
|
9822
9840
|
// export { foo } from './other'
|
|
9823
9841
|
const reexportDeclaration = this.reexportDescriptions[name];
|
|
9824
9842
|
if (reexportDeclaration) {
|
|
9825
|
-
const variable = getVariableForExportNameRecursive(reexportDeclaration.module, reexportDeclaration.localName, importerForSideEffects, false, searchedNamesAndModules);
|
|
9843
|
+
const variable = getVariableForExportNameRecursive(reexportDeclaration.module, reexportDeclaration.localName, importerForSideEffects, false, searchedNamesAndModules, false);
|
|
9826
9844
|
if (!variable) {
|
|
9827
9845
|
return this.error(errMissingExport(reexportDeclaration.localName, this.id, reexportDeclaration.module.id), reexportDeclaration.start);
|
|
9828
9846
|
}
|
|
@@ -9845,20 +9863,11 @@ class Module {
|
|
|
9845
9863
|
return variable;
|
|
9846
9864
|
}
|
|
9847
9865
|
if (name !== 'default') {
|
|
9848
|
-
|
|
9849
|
-
|
|
9850
|
-
|
|
9851
|
-
|
|
9852
|
-
|
|
9853
|
-
return declaration;
|
|
9854
|
-
}
|
|
9855
|
-
if (!foundSyntheticDeclaration) {
|
|
9856
|
-
foundSyntheticDeclaration = declaration;
|
|
9857
|
-
}
|
|
9858
|
-
}
|
|
9859
|
-
}
|
|
9860
|
-
if (foundSyntheticDeclaration) {
|
|
9861
|
-
return foundSyntheticDeclaration;
|
|
9866
|
+
const foundNamespaceReexport = name in this.namespaceReexportsByName
|
|
9867
|
+
? this.namespaceReexportsByName[name]
|
|
9868
|
+
: (this.namespaceReexportsByName[name] = this.getVariableFromNamespaceReexports(name, importerForSideEffects, searchedNamesAndModules, skipExternalNamespaceReexports));
|
|
9869
|
+
if (foundNamespaceReexport) {
|
|
9870
|
+
return foundNamespaceReexport;
|
|
9862
9871
|
}
|
|
9863
9872
|
}
|
|
9864
9873
|
if (this.info.syntheticNamedExports) {
|
|
@@ -9906,12 +9915,14 @@ class Module {
|
|
|
9906
9915
|
}
|
|
9907
9916
|
for (const name of this.getReexports()) {
|
|
9908
9917
|
const variable = this.getVariableForExportName(name);
|
|
9909
|
-
variable
|
|
9910
|
-
|
|
9911
|
-
|
|
9912
|
-
|
|
9913
|
-
|
|
9914
|
-
variable
|
|
9918
|
+
if (variable) {
|
|
9919
|
+
variable.deoptimizePath(UNKNOWN_PATH);
|
|
9920
|
+
if (!variable.included) {
|
|
9921
|
+
this.includeVariable(variable);
|
|
9922
|
+
}
|
|
9923
|
+
if (variable instanceof ExternalVariable) {
|
|
9924
|
+
variable.module.reexported = true;
|
|
9925
|
+
}
|
|
9915
9926
|
}
|
|
9916
9927
|
}
|
|
9917
9928
|
if (includeNamespaceMembers) {
|
|
@@ -10050,7 +10061,9 @@ class Module {
|
|
|
10050
10061
|
if (otherModule instanceof Module && importDeclaration.name === '*') {
|
|
10051
10062
|
return otherModule.namespace;
|
|
10052
10063
|
}
|
|
10053
|
-
const declaration = otherModule.getVariableForExportName(importDeclaration.name,
|
|
10064
|
+
const declaration = otherModule.getVariableForExportName(importDeclaration.name, {
|
|
10065
|
+
importerForSideEffects: importerForSideEffects || this
|
|
10066
|
+
});
|
|
10054
10067
|
if (!declaration) {
|
|
10055
10068
|
return this.error(errMissingExport(importDeclaration.name, this.id, otherModule.id), importDeclaration.start);
|
|
10056
10069
|
}
|
|
@@ -10248,6 +10261,42 @@ class Module {
|
|
|
10248
10261
|
addSideEffectDependencies(this.dependencies);
|
|
10249
10262
|
addSideEffectDependencies(alwaysCheckedDependencies);
|
|
10250
10263
|
}
|
|
10264
|
+
getVariableFromNamespaceReexports(name, importerForSideEffects, searchedNamesAndModules, skipExternalNamespaceReexports = false) {
|
|
10265
|
+
let foundSyntheticDeclaration = null;
|
|
10266
|
+
const skipExternalNamespaceValues = new Set([true, skipExternalNamespaceReexports]);
|
|
10267
|
+
for (const skipExternalNamespaces of skipExternalNamespaceValues) {
|
|
10268
|
+
const foundDeclarations = new Set();
|
|
10269
|
+
for (const module of this.exportAllModules) {
|
|
10270
|
+
if (module instanceof Module || !skipExternalNamespaces) {
|
|
10271
|
+
const declaration = getVariableForExportNameRecursive(module, name, importerForSideEffects, true, searchedNamesAndModules, skipExternalNamespaces);
|
|
10272
|
+
if (declaration) {
|
|
10273
|
+
if (!(declaration instanceof SyntheticNamedExportVariable)) {
|
|
10274
|
+
foundDeclarations.add(declaration);
|
|
10275
|
+
}
|
|
10276
|
+
else if (!foundSyntheticDeclaration) {
|
|
10277
|
+
foundSyntheticDeclaration = declaration;
|
|
10278
|
+
}
|
|
10279
|
+
}
|
|
10280
|
+
}
|
|
10281
|
+
}
|
|
10282
|
+
if (foundDeclarations.size === 1) {
|
|
10283
|
+
return [...foundDeclarations][0];
|
|
10284
|
+
}
|
|
10285
|
+
if (foundDeclarations.size > 1) {
|
|
10286
|
+
if (skipExternalNamespaces) {
|
|
10287
|
+
return null;
|
|
10288
|
+
}
|
|
10289
|
+
const foundDeclarationList = [...foundDeclarations];
|
|
10290
|
+
const usedDeclaration = foundDeclarationList[0];
|
|
10291
|
+
this.options.onwarn(errAmbiguousExternalNamespaces(name, this.id, usedDeclaration.module.id, foundDeclarationList.map(declaration => declaration.module.id)));
|
|
10292
|
+
return usedDeclaration;
|
|
10293
|
+
}
|
|
10294
|
+
}
|
|
10295
|
+
if (foundSyntheticDeclaration) {
|
|
10296
|
+
return foundSyntheticDeclaration;
|
|
10297
|
+
}
|
|
10298
|
+
return null;
|
|
10299
|
+
}
|
|
10251
10300
|
includeAndGetAdditionalMergedNamespaces() {
|
|
10252
10301
|
const mergedNamespaces = [];
|
|
10253
10302
|
for (const module of this.exportAllModules) {
|
package/dist/es/shared/watch.js
CHANGED
package/dist/loadConfigFile.js
CHANGED