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/rollup.js
CHANGED
package/dist/shared/index.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
|
|
@@ -157,13 +157,7 @@ const immediateHandlers = {
|
|
|
157
157
|
},
|
|
158
158
|
MISSING_NODE_BUILTINS: warning => {
|
|
159
159
|
title(`Missing shims for Node.js built-ins`);
|
|
160
|
-
|
|
161
|
-
? `'${warning.modules[0]}'`
|
|
162
|
-
: `${warning
|
|
163
|
-
.modules.slice(0, -1)
|
|
164
|
-
.map((name) => `'${name}'`)
|
|
165
|
-
.join(', ')} and '${warning.modules.slice(-1)}'`;
|
|
166
|
-
stderr(`Creating a browser bundle that depends on ${detail}. You might need to include https://github.com/ionic-team/rollup-plugin-node-polyfills`);
|
|
160
|
+
stderr(`Creating a browser bundle that depends on ${rollup.printQuotedStringList(warning.modules)}. You might need to include https://github.com/ionic-team/rollup-plugin-node-polyfills`);
|
|
167
161
|
}
|
|
168
162
|
};
|
|
169
163
|
const deferredHandlers = {
|
|
@@ -218,7 +212,7 @@ const deferredHandlers = {
|
|
|
218
212
|
NAMESPACE_CONFLICT(warnings) {
|
|
219
213
|
title(`Conflicting re-exports`);
|
|
220
214
|
for (const warning of warnings) {
|
|
221
|
-
stderr(
|
|
215
|
+
stderr(`"${bold(rollup.relativeId(warning.reexporter))}" re-exports "${warning.name}" from both "${rollup.relativeId(warning.sources[0])}" and "${rollup.relativeId(warning.sources[1])}" (will be ignored)`);
|
|
222
216
|
}
|
|
223
217
|
},
|
|
224
218
|
NON_EXISTENT_EXPORT(warnings) {
|
|
@@ -253,14 +247,10 @@ const deferredHandlers = {
|
|
|
253
247
|
SOURCEMAP_BROKEN(warnings) {
|
|
254
248
|
title(`Broken sourcemap`);
|
|
255
249
|
info('https://rollupjs.org/guide/en/#warning-sourcemap-is-likely-to-be-incorrect');
|
|
256
|
-
const plugins =
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
.map(p => `'${p}'`)
|
|
261
|
-
.join(', ')} and '${plugins.slice(-1)}')`
|
|
262
|
-
: ` (such as '${plugins[0]}')`;
|
|
263
|
-
stderr(`Plugins that transform code${detail} should generate accompanying sourcemaps`);
|
|
250
|
+
const plugins = [
|
|
251
|
+
...new Set(warnings.map(warning => warning.plugin).filter(Boolean))
|
|
252
|
+
];
|
|
253
|
+
stderr(`Plugins that transform code (such as ${rollup.printQuotedStringList(plugins)}) should generate accompanying sourcemaps`);
|
|
264
254
|
},
|
|
265
255
|
THIS_IS_UNDEFINED(warnings) {
|
|
266
256
|
title('`this` has been rewritten to `undefined`');
|
package/dist/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
|
|
@@ -32,7 +32,7 @@ function _interopNamespaceDefaultOnly(e) {
|
|
|
32
32
|
|
|
33
33
|
var fs__namespace = /*#__PURE__*/_interopNamespaceDefault(fs);
|
|
34
34
|
|
|
35
|
-
var version$1 = "2.
|
|
35
|
+
var version$1 = "2.47.0";
|
|
36
36
|
|
|
37
37
|
function ensureArray(items) {
|
|
38
38
|
if (Array.isArray(items)) {
|
|
@@ -4462,14 +4462,17 @@ class NamespaceVariable extends Variable {
|
|
|
4462
4462
|
this.references.push(identifier);
|
|
4463
4463
|
this.name = identifier.name;
|
|
4464
4464
|
}
|
|
4465
|
-
|
|
4466
|
-
// build fails due to an illegal namespace reassignment or MemberExpression already forwards
|
|
4467
|
-
// the reassignment to the right variable. This means we lost track of this variable and thus
|
|
4468
|
-
// need to reassign all exports.
|
|
4469
|
-
deoptimizePath() {
|
|
4465
|
+
deoptimizePath(path) {
|
|
4470
4466
|
const memberVariables = this.getMemberVariables();
|
|
4471
|
-
|
|
4472
|
-
|
|
4467
|
+
const memberPath = path.length <= 1 ? UNKNOWN_PATH : path.slice(1);
|
|
4468
|
+
const key = path[0];
|
|
4469
|
+
if (typeof key !== 'string') {
|
|
4470
|
+
for (const key of Object.keys(memberVariables)) {
|
|
4471
|
+
memberVariables[key].deoptimizePath(memberPath);
|
|
4472
|
+
}
|
|
4473
|
+
}
|
|
4474
|
+
else {
|
|
4475
|
+
memberVariables[key].deoptimizePath(memberPath);
|
|
4473
4476
|
}
|
|
4474
4477
|
}
|
|
4475
4478
|
getMemberVariables() {
|
|
@@ -4479,7 +4482,10 @@ class NamespaceVariable extends Variable {
|
|
|
4479
4482
|
const memberVariables = Object.create(null);
|
|
4480
4483
|
for (const name of this.context.getExports().concat(this.context.getReexports())) {
|
|
4481
4484
|
if (name[0] !== '*' && name !== this.module.info.syntheticNamedExports) {
|
|
4482
|
-
|
|
4485
|
+
const exportedVariable = this.context.traceExport(name);
|
|
4486
|
+
if (exportedVariable) {
|
|
4487
|
+
memberVariables[name] = exportedVariable;
|
|
4488
|
+
}
|
|
4483
4489
|
}
|
|
4484
4490
|
}
|
|
4485
4491
|
return (this.memberVariables = memberVariables);
|
|
@@ -4638,6 +4644,18 @@ function makeLegal(str) {
|
|
|
4638
4644
|
return str || '_';
|
|
4639
4645
|
}
|
|
4640
4646
|
|
|
4647
|
+
function printQuotedStringList(list, verbs) {
|
|
4648
|
+
const isSingleItem = list.length <= 1;
|
|
4649
|
+
const quotedList = list.map(item => `"${item}"`);
|
|
4650
|
+
let output = isSingleItem
|
|
4651
|
+
? quotedList[0]
|
|
4652
|
+
: `${quotedList.slice(0, -1).join(', ')} and ${quotedList.slice(-1)[0]}`;
|
|
4653
|
+
if (verbs) {
|
|
4654
|
+
output += ` ${isSingleItem ? verbs[0] : verbs[1]}`;
|
|
4655
|
+
}
|
|
4656
|
+
return output;
|
|
4657
|
+
}
|
|
4658
|
+
|
|
4641
4659
|
class ExternalModule {
|
|
4642
4660
|
constructor(options, id, hasModuleSideEffects, meta, renormalizeRenderPath) {
|
|
4643
4661
|
this.options = options;
|
|
@@ -4715,25 +4733,17 @@ class ExternalModule {
|
|
|
4715
4733
|
});
|
|
4716
4734
|
if (unused.length === 0)
|
|
4717
4735
|
return;
|
|
4718
|
-
const names = unused.length === 1
|
|
4719
|
-
? `'${unused[0]}' is`
|
|
4720
|
-
: `${unused
|
|
4721
|
-
.slice(0, -1)
|
|
4722
|
-
.map(name => `'${name}'`)
|
|
4723
|
-
.join(', ')} and '${unused.slice(-1)}' are`;
|
|
4724
4736
|
const importersSet = new Set();
|
|
4725
4737
|
for (const name of unused) {
|
|
4726
|
-
const { importers
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
|
|
4731
|
-
|
|
4732
|
-
const importersArray = Array.from(importersSet);
|
|
4733
|
-
const importerList = ' in' + importersArray.map(s => `\n\t${s};`);
|
|
4738
|
+
const { importers } = this.declarations[name].module;
|
|
4739
|
+
for (const importer of importers) {
|
|
4740
|
+
importersSet.add(importer);
|
|
4741
|
+
}
|
|
4742
|
+
}
|
|
4743
|
+
const importersArray = [...importersSet];
|
|
4734
4744
|
this.options.onwarn({
|
|
4735
4745
|
code: 'UNUSED_EXTERNAL_IMPORT',
|
|
4736
|
-
message: `${
|
|
4746
|
+
message: `${printQuotedStringList(unused, ['is', 'are'])} imported from external module "${this.id}" but never used in ${printQuotedStringList(importersArray.map(importer => relativeId(importer)))}.`,
|
|
4737
4747
|
names: unused,
|
|
4738
4748
|
source: this.id,
|
|
4739
4749
|
sources: importersArray
|
|
@@ -5057,15 +5067,9 @@ function warnOnBuiltins(warn, dependencies) {
|
|
|
5057
5067
|
const externalBuiltins = dependencies.map(({ id }) => id).filter(id => id in builtins);
|
|
5058
5068
|
if (!externalBuiltins.length)
|
|
5059
5069
|
return;
|
|
5060
|
-
const detail = externalBuiltins.length === 1
|
|
5061
|
-
? `module ('${externalBuiltins[0]}')`
|
|
5062
|
-
: `modules (${externalBuiltins
|
|
5063
|
-
.slice(0, -1)
|
|
5064
|
-
.map(name => `'${name}'`)
|
|
5065
|
-
.join(', ')} and '${externalBuiltins.slice(-1)}')`;
|
|
5066
5070
|
warn({
|
|
5067
5071
|
code: 'MISSING_NODE_BUILTINS',
|
|
5068
|
-
message: `Creating a browser bundle that depends on Node.js built-in ${
|
|
5072
|
+
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`,
|
|
5069
5073
|
modules: externalBuiltins
|
|
5070
5074
|
});
|
|
5071
5075
|
}
|
|
@@ -5348,6 +5352,7 @@ var Errors;
|
|
|
5348
5352
|
Errors["MISSING_IMPLICIT_DEPENDANT"] = "MISSING_IMPLICIT_DEPENDANT";
|
|
5349
5353
|
Errors["MIXED_EXPORTS"] = "MIXED_EXPORTS";
|
|
5350
5354
|
Errors["NAMESPACE_CONFLICT"] = "NAMESPACE_CONFLICT";
|
|
5355
|
+
Errors["AMBIGUOUS_EXTERNAL_NAMESPACES"] = "AMBIGUOUS_EXTERNAL_NAMESPACES";
|
|
5351
5356
|
Errors["NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE"] = "NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE";
|
|
5352
5357
|
Errors["PLUGIN_ERROR"] = "PLUGIN_ERROR";
|
|
5353
5358
|
Errors["PREFER_NAMED_EXPORTS"] = "PREFER_NAMED_EXPORTS";
|
|
@@ -5513,9 +5518,7 @@ function errImplicitDependantIsNotIncluded(module) {
|
|
|
5513
5518
|
const implicitDependencies = Array.from(module.implicitlyLoadedBefore, dependency => relativeId(dependency.id)).sort();
|
|
5514
5519
|
return {
|
|
5515
5520
|
code: Errors.MISSING_IMPLICIT_DEPENDANT,
|
|
5516
|
-
message: `Module "${relativeId(module.id)}" that should be implicitly loaded before
|
|
5517
|
-
? implicitDependencies[0]
|
|
5518
|
-
: `${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.`
|
|
5521
|
+
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.`
|
|
5519
5522
|
};
|
|
5520
5523
|
}
|
|
5521
5524
|
function errMixedExport(facadeModuleId, name) {
|
|
@@ -5529,12 +5532,21 @@ function errMixedExport(facadeModuleId, name) {
|
|
|
5529
5532
|
function errNamespaceConflict(name, reexportingModule, additionalExportAllModule) {
|
|
5530
5533
|
return {
|
|
5531
5534
|
code: Errors.NAMESPACE_CONFLICT,
|
|
5532
|
-
message: `Conflicting namespaces: ${relativeId(reexportingModule.id)} re-exports
|
|
5535
|
+
message: `Conflicting namespaces: "${relativeId(reexportingModule.id)}" re-exports "${name}" from both "${relativeId(reexportingModule.exportsAll[name])}" and "${relativeId(additionalExportAllModule.exportsAll[name])}" (will be ignored)`,
|
|
5533
5536
|
name,
|
|
5534
5537
|
reexporter: reexportingModule.id,
|
|
5535
5538
|
sources: [reexportingModule.exportsAll[name], additionalExportAllModule.exportsAll[name]]
|
|
5536
5539
|
};
|
|
5537
5540
|
}
|
|
5541
|
+
function errAmbiguousExternalNamespaces(name, reexportingModule, usedExternalModule, externalModules) {
|
|
5542
|
+
return {
|
|
5543
|
+
code: Errors.AMBIGUOUS_EXTERNAL_NAMESPACES,
|
|
5544
|
+
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)}".`,
|
|
5545
|
+
name,
|
|
5546
|
+
reexporter: reexportingModule,
|
|
5547
|
+
sources: externalModules
|
|
5548
|
+
};
|
|
5549
|
+
}
|
|
5538
5550
|
function errNoTransformMapOrAstWithoutCode(pluginName) {
|
|
5539
5551
|
return {
|
|
5540
5552
|
code: Errors.NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE,
|
|
@@ -6600,15 +6612,9 @@ class MemberExpression extends NodeBase {
|
|
|
6600
6612
|
if (this.variable) {
|
|
6601
6613
|
this.variable.deoptimizePath(path);
|
|
6602
6614
|
}
|
|
6603
|
-
else {
|
|
6604
|
-
|
|
6605
|
-
|
|
6606
|
-
this.object.deoptimizePath(UNKNOWN_PATH);
|
|
6607
|
-
}
|
|
6608
|
-
else {
|
|
6609
|
-
this.wasPathDeoptimizedWhileOptimized = true;
|
|
6610
|
-
this.object.deoptimizePath([propertyKey, ...path]);
|
|
6611
|
-
}
|
|
6615
|
+
else if (!this.replacement) {
|
|
6616
|
+
this.wasPathDeoptimizedWhileOptimized = true;
|
|
6617
|
+
this.object.deoptimizePath([this.getPropertyKey(), ...path]);
|
|
6612
6618
|
}
|
|
6613
6619
|
}
|
|
6614
6620
|
getLiteralValueAtPath(path, recursionTracker, origin) {
|
|
@@ -9606,8 +9612,11 @@ function findSourceMappingURLComments(ast, code) {
|
|
|
9606
9612
|
}
|
|
9607
9613
|
let sourcemappingUrlMatch;
|
|
9608
9614
|
const interStatmentCode = code.slice(start, end);
|
|
9609
|
-
while (sourcemappingUrlMatch = SOURCEMAPPING_URL_COMMENT_RE.exec(interStatmentCode)) {
|
|
9610
|
-
ret.push([
|
|
9615
|
+
while ((sourcemappingUrlMatch = SOURCEMAPPING_URL_COMMENT_RE.exec(interStatmentCode))) {
|
|
9616
|
+
ret.push([
|
|
9617
|
+
start + sourcemappingUrlMatch.index,
|
|
9618
|
+
start + SOURCEMAPPING_URL_COMMENT_RE.lastIndex
|
|
9619
|
+
]);
|
|
9611
9620
|
}
|
|
9612
9621
|
};
|
|
9613
9622
|
let prevStmtEnd = 0;
|
|
@@ -9618,7 +9627,7 @@ function findSourceMappingURLComments(ast, code) {
|
|
|
9618
9627
|
addCommentsPos(prevStmtEnd, code.length);
|
|
9619
9628
|
return ret;
|
|
9620
9629
|
}
|
|
9621
|
-
function getVariableForExportNameRecursive(target, name, importerForSideEffects, isExportAllSearch, searchedNamesAndModules = new Map()) {
|
|
9630
|
+
function getVariableForExportNameRecursive(target, name, importerForSideEffects, isExportAllSearch, searchedNamesAndModules = new Map(), skipExternalNamespaceReexports) {
|
|
9622
9631
|
const searchedModules = searchedNamesAndModules.get(name);
|
|
9623
9632
|
if (searchedModules) {
|
|
9624
9633
|
if (searchedModules.has(target)) {
|
|
@@ -9629,7 +9638,12 @@ function getVariableForExportNameRecursive(target, name, importerForSideEffects,
|
|
|
9629
9638
|
else {
|
|
9630
9639
|
searchedNamesAndModules.set(name, new Set([target]));
|
|
9631
9640
|
}
|
|
9632
|
-
return target.getVariableForExportName(name,
|
|
9641
|
+
return target.getVariableForExportName(name, {
|
|
9642
|
+
importerForSideEffects,
|
|
9643
|
+
isExportAllSearch,
|
|
9644
|
+
searchedNamesAndModules,
|
|
9645
|
+
skipExternalNamespaceReexports
|
|
9646
|
+
});
|
|
9633
9647
|
}
|
|
9634
9648
|
function getAndExtendSideEffectModules(variable, module) {
|
|
9635
9649
|
const sideEffectModules = getOrCreate(module.sideEffectDependenciesByVariable, variable, () => new Set());
|
|
@@ -9694,6 +9708,7 @@ class Module {
|
|
|
9694
9708
|
this.exportAllModules = [];
|
|
9695
9709
|
this.exportNamesByVariable = null;
|
|
9696
9710
|
this.exportShimVariable = new ExportShimVariable(this);
|
|
9711
|
+
this.namespaceReexportsByName = Object.create(null);
|
|
9697
9712
|
this.relevantDependencies = null;
|
|
9698
9713
|
this.syntheticExports = new Map();
|
|
9699
9714
|
this.syntheticNamespace = null;
|
|
@@ -9785,7 +9800,10 @@ class Module {
|
|
|
9785
9800
|
this.implicitlyLoadedAfter.size > 0) {
|
|
9786
9801
|
dependencyVariables = new Set(dependencyVariables);
|
|
9787
9802
|
for (const exportName of [...this.getReexports(), ...this.getExports()]) {
|
|
9788
|
-
|
|
9803
|
+
const exportedVariable = this.getVariableForExportName(exportName);
|
|
9804
|
+
if (exportedVariable) {
|
|
9805
|
+
dependencyVariables.add(exportedVariable);
|
|
9806
|
+
}
|
|
9789
9807
|
}
|
|
9790
9808
|
}
|
|
9791
9809
|
for (let variable of dependencyVariables) {
|
|
@@ -9890,7 +9908,7 @@ class Module {
|
|
|
9890
9908
|
}
|
|
9891
9909
|
return this.syntheticNamespace;
|
|
9892
9910
|
}
|
|
9893
|
-
getVariableForExportName(name, importerForSideEffects, isExportAllSearch, searchedNamesAndModules) {
|
|
9911
|
+
getVariableForExportName(name, { importerForSideEffects, isExportAllSearch, searchedNamesAndModules, skipExternalNamespaceReexports } = EMPTY_OBJECT) {
|
|
9894
9912
|
if (name[0] === '*') {
|
|
9895
9913
|
if (name.length === 1) {
|
|
9896
9914
|
// export * from './other'
|
|
@@ -9905,7 +9923,7 @@ class Module {
|
|
|
9905
9923
|
// export { foo } from './other'
|
|
9906
9924
|
const reexportDeclaration = this.reexportDescriptions[name];
|
|
9907
9925
|
if (reexportDeclaration) {
|
|
9908
|
-
const variable = getVariableForExportNameRecursive(reexportDeclaration.module, reexportDeclaration.localName, importerForSideEffects, false, searchedNamesAndModules);
|
|
9926
|
+
const variable = getVariableForExportNameRecursive(reexportDeclaration.module, reexportDeclaration.localName, importerForSideEffects, false, searchedNamesAndModules, false);
|
|
9909
9927
|
if (!variable) {
|
|
9910
9928
|
return this.error(errMissingExport(reexportDeclaration.localName, this.id, reexportDeclaration.module.id), reexportDeclaration.start);
|
|
9911
9929
|
}
|
|
@@ -9928,20 +9946,11 @@ class Module {
|
|
|
9928
9946
|
return variable;
|
|
9929
9947
|
}
|
|
9930
9948
|
if (name !== 'default') {
|
|
9931
|
-
|
|
9932
|
-
|
|
9933
|
-
|
|
9934
|
-
|
|
9935
|
-
|
|
9936
|
-
return declaration;
|
|
9937
|
-
}
|
|
9938
|
-
if (!foundSyntheticDeclaration) {
|
|
9939
|
-
foundSyntheticDeclaration = declaration;
|
|
9940
|
-
}
|
|
9941
|
-
}
|
|
9942
|
-
}
|
|
9943
|
-
if (foundSyntheticDeclaration) {
|
|
9944
|
-
return foundSyntheticDeclaration;
|
|
9949
|
+
const foundNamespaceReexport = name in this.namespaceReexportsByName
|
|
9950
|
+
? this.namespaceReexportsByName[name]
|
|
9951
|
+
: (this.namespaceReexportsByName[name] = this.getVariableFromNamespaceReexports(name, importerForSideEffects, searchedNamesAndModules, skipExternalNamespaceReexports));
|
|
9952
|
+
if (foundNamespaceReexport) {
|
|
9953
|
+
return foundNamespaceReexport;
|
|
9945
9954
|
}
|
|
9946
9955
|
}
|
|
9947
9956
|
if (this.info.syntheticNamedExports) {
|
|
@@ -9989,12 +9998,14 @@ class Module {
|
|
|
9989
9998
|
}
|
|
9990
9999
|
for (const name of this.getReexports()) {
|
|
9991
10000
|
const variable = this.getVariableForExportName(name);
|
|
9992
|
-
variable
|
|
9993
|
-
|
|
9994
|
-
|
|
9995
|
-
|
|
9996
|
-
|
|
9997
|
-
variable
|
|
10001
|
+
if (variable) {
|
|
10002
|
+
variable.deoptimizePath(UNKNOWN_PATH);
|
|
10003
|
+
if (!variable.included) {
|
|
10004
|
+
this.includeVariable(variable);
|
|
10005
|
+
}
|
|
10006
|
+
if (variable instanceof ExternalVariable) {
|
|
10007
|
+
variable.module.reexported = true;
|
|
10008
|
+
}
|
|
9998
10009
|
}
|
|
9999
10010
|
}
|
|
10000
10011
|
if (includeNamespaceMembers) {
|
|
@@ -10133,7 +10144,9 @@ class Module {
|
|
|
10133
10144
|
if (otherModule instanceof Module && importDeclaration.name === '*') {
|
|
10134
10145
|
return otherModule.namespace;
|
|
10135
10146
|
}
|
|
10136
|
-
const declaration = otherModule.getVariableForExportName(importDeclaration.name,
|
|
10147
|
+
const declaration = otherModule.getVariableForExportName(importDeclaration.name, {
|
|
10148
|
+
importerForSideEffects: importerForSideEffects || this
|
|
10149
|
+
});
|
|
10137
10150
|
if (!declaration) {
|
|
10138
10151
|
return this.error(errMissingExport(importDeclaration.name, this.id, otherModule.id), importDeclaration.start);
|
|
10139
10152
|
}
|
|
@@ -10331,6 +10344,42 @@ class Module {
|
|
|
10331
10344
|
addSideEffectDependencies(this.dependencies);
|
|
10332
10345
|
addSideEffectDependencies(alwaysCheckedDependencies);
|
|
10333
10346
|
}
|
|
10347
|
+
getVariableFromNamespaceReexports(name, importerForSideEffects, searchedNamesAndModules, skipExternalNamespaceReexports = false) {
|
|
10348
|
+
let foundSyntheticDeclaration = null;
|
|
10349
|
+
const skipExternalNamespaceValues = new Set([true, skipExternalNamespaceReexports]);
|
|
10350
|
+
for (const skipExternalNamespaces of skipExternalNamespaceValues) {
|
|
10351
|
+
const foundDeclarations = new Set();
|
|
10352
|
+
for (const module of this.exportAllModules) {
|
|
10353
|
+
if (module instanceof Module || !skipExternalNamespaces) {
|
|
10354
|
+
const declaration = getVariableForExportNameRecursive(module, name, importerForSideEffects, true, searchedNamesAndModules, skipExternalNamespaces);
|
|
10355
|
+
if (declaration) {
|
|
10356
|
+
if (!(declaration instanceof SyntheticNamedExportVariable)) {
|
|
10357
|
+
foundDeclarations.add(declaration);
|
|
10358
|
+
}
|
|
10359
|
+
else if (!foundSyntheticDeclaration) {
|
|
10360
|
+
foundSyntheticDeclaration = declaration;
|
|
10361
|
+
}
|
|
10362
|
+
}
|
|
10363
|
+
}
|
|
10364
|
+
}
|
|
10365
|
+
if (foundDeclarations.size === 1) {
|
|
10366
|
+
return [...foundDeclarations][0];
|
|
10367
|
+
}
|
|
10368
|
+
if (foundDeclarations.size > 1) {
|
|
10369
|
+
if (skipExternalNamespaces) {
|
|
10370
|
+
return null;
|
|
10371
|
+
}
|
|
10372
|
+
const foundDeclarationList = [...foundDeclarations];
|
|
10373
|
+
const usedDeclaration = foundDeclarationList[0];
|
|
10374
|
+
this.options.onwarn(errAmbiguousExternalNamespaces(name, this.id, usedDeclaration.module.id, foundDeclarationList.map(declaration => declaration.module.id)));
|
|
10375
|
+
return usedDeclaration;
|
|
10376
|
+
}
|
|
10377
|
+
}
|
|
10378
|
+
if (foundSyntheticDeclaration) {
|
|
10379
|
+
return foundSyntheticDeclaration;
|
|
10380
|
+
}
|
|
10381
|
+
return null;
|
|
10382
|
+
}
|
|
10334
10383
|
includeAndGetAdditionalMergedNamespaces() {
|
|
10335
10384
|
const mergedNamespaces = [];
|
|
10336
10385
|
for (const module of this.exportAllModules) {
|
|
@@ -20430,6 +20479,7 @@ exports.getAliasName = getAliasName;
|
|
|
20430
20479
|
exports.getAugmentedNamespace = getAugmentedNamespace;
|
|
20431
20480
|
exports.getOrCreate = getOrCreate;
|
|
20432
20481
|
exports.loadFsEvents = loadFsEvents;
|
|
20482
|
+
exports.printQuotedStringList = printQuotedStringList;
|
|
20433
20483
|
exports.relativeId = relativeId;
|
|
20434
20484
|
exports.rollup = rollup;
|
|
20435
20485
|
exports.rollupInternal = rollupInternal;
|
package/dist/shared/watch-cli.js
CHANGED
package/dist/shared/watch.js
CHANGED