rollup 2.63.0 → 2.66.1
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 +72 -0
- package/LICENSE.md +0 -7
- package/dist/bin/rollup +13 -67
- package/dist/es/rollup.browser.js +3 -3
- package/dist/es/rollup.js +4 -2
- package/dist/es/shared/rollup.js +292 -257
- package/dist/es/shared/watch.js +24 -14
- package/dist/loadConfigFile.js +3 -2
- package/dist/rollup.browser.js +3 -3
- package/dist/rollup.browser.js.map +1 -1
- package/dist/rollup.d.ts +24 -4
- package/dist/rollup.js +4 -2
- package/dist/shared/index.js +21 -13
- package/dist/shared/loadConfigFile.js +10 -11
- package/dist/shared/mergeOptions.js +2 -2
- package/dist/shared/rollup.js +339 -304
- package/dist/shared/watch-cli.js +21 -30
- package/dist/shared/watch.js +8 -18
- package/package.json +19 -21
package/dist/es/shared/rollup.js
CHANGED
|
@@ -1,24 +1,26 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v2.
|
|
4
|
-
Tue,
|
|
3
|
+
Rollup.js v2.66.1
|
|
4
|
+
Tue, 25 Jan 2022 07:58:28 GMT - commit f523f0098d3e98f87abef54f48f39d06a7cc7eec
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
https://github.com/rollup/rollup
|
|
8
8
|
|
|
9
9
|
Released under the MIT License.
|
|
10
10
|
*/
|
|
11
|
-
import require$$
|
|
11
|
+
import require$$0, { relative as relative$1, resolve, extname, basename, win32, posix, isAbsolute as isAbsolute$1, dirname } from 'path';
|
|
12
|
+
import process$1 from 'process';
|
|
13
|
+
import { performance } from 'perf_hooks';
|
|
12
14
|
import { createHash as createHash$1 } from 'crypto';
|
|
13
15
|
import fs, { lstatSync, realpathSync, readdirSync } from 'fs';
|
|
14
16
|
import { EventEmitter } from 'events';
|
|
15
17
|
|
|
16
|
-
var version$1 = "2.
|
|
18
|
+
var version$1 = "2.66.1";
|
|
17
19
|
|
|
18
20
|
var charToInteger = {};
|
|
19
21
|
var chars$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
|
20
|
-
for (var i = 0; i < chars$1.length; i++) {
|
|
21
|
-
charToInteger[chars$1.charCodeAt(i)] = i;
|
|
22
|
+
for (var i$1 = 0; i$1 < chars$1.length; i$1++) {
|
|
23
|
+
charToInteger[chars$1.charCodeAt(i$1)] = i$1;
|
|
22
24
|
}
|
|
23
25
|
function decode(mappings) {
|
|
24
26
|
var decoded = [];
|
|
@@ -1776,14 +1778,17 @@ class ExternalModule {
|
|
|
1776
1778
|
this.info = {
|
|
1777
1779
|
ast: null,
|
|
1778
1780
|
code: null,
|
|
1781
|
+
dynamicallyImportedIdResolutions: EMPTY_ARRAY,
|
|
1779
1782
|
dynamicallyImportedIds: EMPTY_ARRAY,
|
|
1780
1783
|
get dynamicImporters() {
|
|
1781
1784
|
return dynamicImporters.sort();
|
|
1782
1785
|
},
|
|
1786
|
+
hasDefaultExport: null,
|
|
1783
1787
|
hasModuleSideEffects,
|
|
1784
1788
|
id,
|
|
1785
1789
|
implicitlyLoadedAfterOneOf: EMPTY_ARRAY,
|
|
1786
1790
|
implicitlyLoadedBefore: EMPTY_ARRAY,
|
|
1791
|
+
importedIdResolutions: EMPTY_ARRAY,
|
|
1787
1792
|
importedIds: EMPTY_ARRAY,
|
|
1788
1793
|
get importers() {
|
|
1789
1794
|
return importers.sort();
|
|
@@ -1798,10 +1803,10 @@ class ExternalModule {
|
|
|
1798
1803
|
getVariableForExportName(name) {
|
|
1799
1804
|
let declaration = this.declarations[name];
|
|
1800
1805
|
if (declaration)
|
|
1801
|
-
return declaration;
|
|
1806
|
+
return [declaration];
|
|
1802
1807
|
this.declarations[name] = declaration = new ExternalVariable(this, name);
|
|
1803
1808
|
this.exportedVariables.set(declaration, name);
|
|
1804
|
-
return declaration;
|
|
1809
|
+
return [declaration];
|
|
1805
1810
|
}
|
|
1806
1811
|
setRenderPath(options, inputBase) {
|
|
1807
1812
|
this.renderPath =
|
|
@@ -1866,7 +1871,7 @@ function getAugmentedNamespace(n) {
|
|
|
1866
1871
|
|
|
1867
1872
|
var utils$3 = {};
|
|
1868
1873
|
|
|
1869
|
-
const path$1 = require$$
|
|
1874
|
+
const path$1 = require$$0;
|
|
1870
1875
|
const WIN_SLASH = '\\\\/';
|
|
1871
1876
|
const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
1872
1877
|
|
|
@@ -2046,7 +2051,7 @@ var constants$2 = {
|
|
|
2046
2051
|
|
|
2047
2052
|
(function (exports) {
|
|
2048
2053
|
|
|
2049
|
-
const path = require$$
|
|
2054
|
+
const path = require$$0;
|
|
2050
2055
|
const win32 = process.platform === 'win32';
|
|
2051
2056
|
const {
|
|
2052
2057
|
REGEX_BACKSLASH,
|
|
@@ -2743,7 +2748,14 @@ const parse$1 = (input, options) => {
|
|
|
2743
2748
|
}
|
|
2744
2749
|
|
|
2745
2750
|
if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
|
|
2746
|
-
|
|
2751
|
+
// Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis.
|
|
2752
|
+
// In this case, we need to parse the string and use it in the output of the original pattern.
|
|
2753
|
+
// Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`.
|
|
2754
|
+
//
|
|
2755
|
+
// Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`.
|
|
2756
|
+
const expression = parse$1(rest, { ...options, fastpaths: false }).output;
|
|
2757
|
+
|
|
2758
|
+
output = token.close = `)${expression})${extglobStar})`;
|
|
2747
2759
|
}
|
|
2748
2760
|
|
|
2749
2761
|
if (token.prev.type === 'bos') {
|
|
@@ -3576,7 +3588,7 @@ parse$1.fastpaths = (input, options) => {
|
|
|
3576
3588
|
|
|
3577
3589
|
var parse_1 = parse$1;
|
|
3578
3590
|
|
|
3579
|
-
const path = require$$
|
|
3591
|
+
const path = require$$0;
|
|
3580
3592
|
const scan = scan_1;
|
|
3581
3593
|
const parse = parse_1;
|
|
3582
3594
|
const utils = utils$3;
|
|
@@ -10582,22 +10594,22 @@ function errMixedExport(facadeModuleId, name) {
|
|
|
10582
10594
|
url: `https://rollupjs.org/guide/en/#outputexports`
|
|
10583
10595
|
};
|
|
10584
10596
|
}
|
|
10585
|
-
function errNamespaceConflict(name,
|
|
10597
|
+
function errNamespaceConflict(name, reexportingModuleId, sources) {
|
|
10586
10598
|
return {
|
|
10587
10599
|
code: Errors.NAMESPACE_CONFLICT,
|
|
10588
|
-
message: `Conflicting namespaces: "${relativeId(
|
|
10600
|
+
message: `Conflicting namespaces: "${relativeId(reexportingModuleId)}" re-exports "${name}" from one of the modules ${printQuotedStringList(sources.map(moduleId => relativeId(moduleId)))} (will be ignored)`,
|
|
10589
10601
|
name,
|
|
10590
|
-
reexporter:
|
|
10591
|
-
sources
|
|
10602
|
+
reexporter: reexportingModuleId,
|
|
10603
|
+
sources
|
|
10592
10604
|
};
|
|
10593
10605
|
}
|
|
10594
|
-
function errAmbiguousExternalNamespaces(name, reexportingModule,
|
|
10606
|
+
function errAmbiguousExternalNamespaces(name, reexportingModule, usedModule, sources) {
|
|
10595
10607
|
return {
|
|
10596
10608
|
code: Errors.AMBIGUOUS_EXTERNAL_NAMESPACES,
|
|
10597
|
-
message: `Ambiguous external namespace resolution: "${relativeId(reexportingModule)}" re-exports "${name}" from one of the external modules ${printQuotedStringList(
|
|
10609
|
+
message: `Ambiguous external namespace resolution: "${relativeId(reexportingModule)}" re-exports "${name}" from one of the external modules ${printQuotedStringList(sources.map(module => relativeId(module)))}, guessing "${relativeId(usedModule)}".`,
|
|
10598
10610
|
name,
|
|
10599
10611
|
reexporter: reexportingModule,
|
|
10600
|
-
sources
|
|
10612
|
+
sources
|
|
10601
10613
|
};
|
|
10602
10614
|
}
|
|
10603
10615
|
function errNoTransformMapOrAstWithoutCode(pluginName) {
|
|
@@ -10621,7 +10633,7 @@ function errSyntheticNamedExportsNeedNamespaceExport(id, syntheticNamedExportsOp
|
|
|
10621
10633
|
code: Errors.SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT,
|
|
10622
10634
|
id,
|
|
10623
10635
|
message: `Module "${relativeId(id)}" that is marked with 'syntheticNamedExports: ${JSON.stringify(syntheticNamedExportsOption)}' needs ${typeof syntheticNamedExportsOption === 'string' && syntheticNamedExportsOption !== 'default'
|
|
10624
|
-
? `an export named "${syntheticNamedExportsOption}"`
|
|
10636
|
+
? `an explicit export named "${syntheticNamedExportsOption}"`
|
|
10625
10637
|
: 'a default export'} that does not reexport an unresolved named export of the same module.`
|
|
10626
10638
|
};
|
|
10627
10639
|
}
|
|
@@ -12012,24 +12024,7 @@ function getOriginalLocation(sourcemapChain, location) {
|
|
|
12012
12024
|
}
|
|
12013
12025
|
|
|
12014
12026
|
const NOOP = () => { };
|
|
12015
|
-
let
|
|
12016
|
-
let getElapsedTime = () => 0;
|
|
12017
|
-
let getMemory = () => 0;
|
|
12018
|
-
let timers = {};
|
|
12019
|
-
const normalizeHrTime = (time) => time[0] * 1e3 + time[1] / 1e6;
|
|
12020
|
-
function setTimeHelpers() {
|
|
12021
|
-
if (typeof process !== 'undefined' && typeof process.hrtime === 'function') {
|
|
12022
|
-
getStartTime = process.hrtime.bind(process);
|
|
12023
|
-
getElapsedTime = previous => normalizeHrTime(process.hrtime(previous));
|
|
12024
|
-
}
|
|
12025
|
-
else if (typeof performance !== 'undefined' && typeof performance.now === 'function') {
|
|
12026
|
-
getStartTime = () => [performance.now(), 0];
|
|
12027
|
-
getElapsedTime = previous => performance.now() - previous[0];
|
|
12028
|
-
}
|
|
12029
|
-
if (typeof process !== 'undefined' && typeof process.memoryUsage === 'function') {
|
|
12030
|
-
getMemory = () => process.memoryUsage().heapUsed;
|
|
12031
|
-
}
|
|
12032
|
-
}
|
|
12027
|
+
let timers = new Map();
|
|
12033
12028
|
function getPersistedLabel(label, level) {
|
|
12034
12029
|
switch (level) {
|
|
12035
12030
|
case 1:
|
|
@@ -12044,58 +12039,59 @@ function getPersistedLabel(label, level) {
|
|
|
12044
12039
|
}
|
|
12045
12040
|
function timeStartImpl(label, level = 3) {
|
|
12046
12041
|
label = getPersistedLabel(label, level);
|
|
12047
|
-
|
|
12048
|
-
|
|
12042
|
+
const startMemory = process$1.memoryUsage().heapUsed;
|
|
12043
|
+
const startTime = performance.now();
|
|
12044
|
+
const timer = timers.get(label);
|
|
12045
|
+
if (timer === undefined) {
|
|
12046
|
+
timers.set(label, {
|
|
12049
12047
|
memory: 0,
|
|
12050
|
-
startMemory
|
|
12051
|
-
startTime
|
|
12048
|
+
startMemory,
|
|
12049
|
+
startTime,
|
|
12052
12050
|
time: 0,
|
|
12053
12051
|
totalMemory: 0
|
|
12054
|
-
};
|
|
12052
|
+
});
|
|
12053
|
+
}
|
|
12054
|
+
else {
|
|
12055
|
+
timer.startMemory = startMemory;
|
|
12056
|
+
timer.startTime = startTime;
|
|
12055
12057
|
}
|
|
12056
|
-
const currentMemory = getMemory();
|
|
12057
|
-
timers[label].startTime = getStartTime();
|
|
12058
|
-
timers[label].startMemory = currentMemory;
|
|
12059
12058
|
}
|
|
12060
12059
|
function timeEndImpl(label, level = 3) {
|
|
12061
12060
|
label = getPersistedLabel(label, level);
|
|
12062
|
-
|
|
12063
|
-
|
|
12064
|
-
|
|
12065
|
-
|
|
12066
|
-
|
|
12061
|
+
const timer = timers.get(label);
|
|
12062
|
+
if (timer !== undefined) {
|
|
12063
|
+
const currentMemory = process$1.memoryUsage().heapUsed;
|
|
12064
|
+
timer.memory += currentMemory - timer.startMemory;
|
|
12065
|
+
timer.time += performance.now() - timer.startTime;
|
|
12066
|
+
timer.totalMemory = Math.max(timer.totalMemory, currentMemory);
|
|
12067
12067
|
}
|
|
12068
12068
|
}
|
|
12069
12069
|
function getTimings() {
|
|
12070
12070
|
const newTimings = {};
|
|
12071
|
-
for (const [label, {
|
|
12071
|
+
for (const [label, { memory, time, totalMemory }] of timers) {
|
|
12072
12072
|
newTimings[label] = [time, memory, totalMemory];
|
|
12073
12073
|
}
|
|
12074
12074
|
return newTimings;
|
|
12075
12075
|
}
|
|
12076
|
-
let timeStart = NOOP
|
|
12077
|
-
|
|
12078
|
-
|
|
12079
|
-
resolveDynamicImport: true,
|
|
12080
|
-
resolveId: true,
|
|
12081
|
-
transform: true
|
|
12082
|
-
};
|
|
12076
|
+
let timeStart = NOOP;
|
|
12077
|
+
let timeEnd = NOOP;
|
|
12078
|
+
const TIMED_PLUGIN_HOOKS = ['load', 'resolveDynamicImport', 'resolveId', 'transform'];
|
|
12083
12079
|
function getPluginWithTimers(plugin, index) {
|
|
12084
|
-
const
|
|
12085
|
-
|
|
12086
|
-
if (TIMED_PLUGIN_HOOKS[hook] === true) {
|
|
12080
|
+
for (const hook of TIMED_PLUGIN_HOOKS) {
|
|
12081
|
+
if (hook in plugin) {
|
|
12087
12082
|
let timerLabel = `plugin ${index}`;
|
|
12088
12083
|
if (plugin.name) {
|
|
12089
12084
|
timerLabel += ` (${plugin.name})`;
|
|
12090
12085
|
}
|
|
12091
12086
|
timerLabel += ` - ${hook}`;
|
|
12092
|
-
|
|
12087
|
+
const func = plugin[hook];
|
|
12088
|
+
plugin[hook] = function (...args) {
|
|
12093
12089
|
timeStart(timerLabel, 4);
|
|
12094
|
-
|
|
12090
|
+
const result = func.apply(this, args);
|
|
12095
12091
|
timeEnd(timerLabel, 4);
|
|
12096
12092
|
if (result && typeof result.then === 'function') {
|
|
12097
12093
|
timeStart(`${timerLabel} (async)`, 4);
|
|
12098
|
-
|
|
12094
|
+
return result.then((hookResult) => {
|
|
12099
12095
|
timeEnd(`${timerLabel} (async)`, 4);
|
|
12100
12096
|
return hookResult;
|
|
12101
12097
|
});
|
|
@@ -12103,16 +12099,12 @@ function getPluginWithTimers(plugin, index) {
|
|
|
12103
12099
|
return result;
|
|
12104
12100
|
};
|
|
12105
12101
|
}
|
|
12106
|
-
else {
|
|
12107
|
-
timedPlugin[hook] = plugin[hook];
|
|
12108
|
-
}
|
|
12109
12102
|
}
|
|
12110
|
-
return
|
|
12103
|
+
return plugin;
|
|
12111
12104
|
}
|
|
12112
12105
|
function initialiseTimers(inputOptions) {
|
|
12113
12106
|
if (inputOptions.perf) {
|
|
12114
|
-
timers =
|
|
12115
|
-
setTimeHelpers();
|
|
12107
|
+
timers = new Map();
|
|
12116
12108
|
timeStart = timeStartImpl;
|
|
12117
12109
|
timeEnd = timeEndImpl;
|
|
12118
12110
|
inputOptions.plugins = inputOptions.plugins.map(getPluginWithTimers);
|
|
@@ -12145,11 +12137,11 @@ const MISSING_EXPORT_SHIM_DESCRIPTION = {
|
|
|
12145
12137
|
identifier: null,
|
|
12146
12138
|
localName: MISSING_EXPORT_SHIM_VARIABLE
|
|
12147
12139
|
};
|
|
12148
|
-
function getVariableForExportNameRecursive(target, name, importerForSideEffects, isExportAllSearch, searchedNamesAndModules = new Map()
|
|
12140
|
+
function getVariableForExportNameRecursive(target, name, importerForSideEffects, isExportAllSearch, searchedNamesAndModules = new Map()) {
|
|
12149
12141
|
const searchedModules = searchedNamesAndModules.get(name);
|
|
12150
12142
|
if (searchedModules) {
|
|
12151
12143
|
if (searchedModules.has(target)) {
|
|
12152
|
-
return isExportAllSearch ? null : error(errCircularReexport(name, target.id));
|
|
12144
|
+
return isExportAllSearch ? [null] : error(errCircularReexport(name, target.id));
|
|
12153
12145
|
}
|
|
12154
12146
|
searchedModules.add(target);
|
|
12155
12147
|
}
|
|
@@ -12159,8 +12151,7 @@ function getVariableForExportNameRecursive(target, name, importerForSideEffects,
|
|
|
12159
12151
|
return target.getVariableForExportName(name, {
|
|
12160
12152
|
importerForSideEffects,
|
|
12161
12153
|
isExportAllSearch,
|
|
12162
|
-
searchedNamesAndModules
|
|
12163
|
-
skipExternalNamespaceReexports
|
|
12154
|
+
searchedNamesAndModules
|
|
12164
12155
|
});
|
|
12165
12156
|
}
|
|
12166
12157
|
function getAndExtendSideEffectModules(variable, module) {
|
|
@@ -12206,7 +12197,6 @@ class Module {
|
|
|
12206
12197
|
this.execIndex = Infinity;
|
|
12207
12198
|
this.exportAllSources = new Set();
|
|
12208
12199
|
this.exports = Object.create(null);
|
|
12209
|
-
this.exportsAll = Object.create(null);
|
|
12210
12200
|
this.implicitlyLoadedAfter = new Set();
|
|
12211
12201
|
this.implicitlyLoadedBefore = new Set();
|
|
12212
12202
|
this.importDescriptions = Object.create(null);
|
|
@@ -12241,6 +12231,11 @@ class Module {
|
|
|
12241
12231
|
this.info = {
|
|
12242
12232
|
ast: null,
|
|
12243
12233
|
code: null,
|
|
12234
|
+
get dynamicallyImportedIdResolutions() {
|
|
12235
|
+
return module.dynamicImports
|
|
12236
|
+
.map(({ argument }) => typeof argument === 'string' && module.resolvedIds[argument])
|
|
12237
|
+
.filter(Boolean);
|
|
12238
|
+
},
|
|
12244
12239
|
get dynamicallyImportedIds() {
|
|
12245
12240
|
const dynamicallyImportedIds = [];
|
|
12246
12241
|
for (const { id } of module.dynamicImports) {
|
|
@@ -12253,6 +12248,13 @@ class Module {
|
|
|
12253
12248
|
get dynamicImporters() {
|
|
12254
12249
|
return module.dynamicImporters.sort();
|
|
12255
12250
|
},
|
|
12251
|
+
get hasDefaultExport() {
|
|
12252
|
+
// This information is only valid after parsing
|
|
12253
|
+
if (!module.ast) {
|
|
12254
|
+
return null;
|
|
12255
|
+
}
|
|
12256
|
+
return 'default' in module.exports || 'default' in module.reexportDescriptions;
|
|
12257
|
+
},
|
|
12256
12258
|
hasModuleSideEffects,
|
|
12257
12259
|
id,
|
|
12258
12260
|
get implicitlyLoadedAfterOneOf() {
|
|
@@ -12261,6 +12263,9 @@ class Module {
|
|
|
12261
12263
|
get implicitlyLoadedBefore() {
|
|
12262
12264
|
return Array.from(module.implicitlyLoadedBefore, getId).sort();
|
|
12263
12265
|
},
|
|
12266
|
+
get importedIdResolutions() {
|
|
12267
|
+
return Array.from(module.sources, source => module.resolvedIds[source]).filter(Boolean);
|
|
12268
|
+
},
|
|
12264
12269
|
get importedIds() {
|
|
12265
12270
|
return Array.from(module.sources, source => { var _a; return (_a = module.resolvedIds[source]) === null || _a === void 0 ? void 0 : _a.id; }).filter(Boolean);
|
|
12266
12271
|
},
|
|
@@ -12275,7 +12280,7 @@ class Module {
|
|
|
12275
12280
|
}
|
|
12276
12281
|
return module.isIncluded();
|
|
12277
12282
|
},
|
|
12278
|
-
meta,
|
|
12283
|
+
meta: { ...meta },
|
|
12279
12284
|
syntheticNamedExports
|
|
12280
12285
|
};
|
|
12281
12286
|
}
|
|
@@ -12296,7 +12301,7 @@ class Module {
|
|
|
12296
12301
|
return this.allExportNames;
|
|
12297
12302
|
}
|
|
12298
12303
|
const allExportNames = (this.allExportNames = new Set());
|
|
12299
|
-
for (const name of
|
|
12304
|
+
for (const name of this.getExports()) {
|
|
12300
12305
|
allExportNames.add(name);
|
|
12301
12306
|
}
|
|
12302
12307
|
for (const name of Object.keys(this.reexportDescriptions)) {
|
|
@@ -12312,6 +12317,11 @@ class Module {
|
|
|
12312
12317
|
allExportNames.add(name);
|
|
12313
12318
|
}
|
|
12314
12319
|
}
|
|
12320
|
+
// We do not count the synthetic namespace as a regular export to hide it
|
|
12321
|
+
// from entry signatures and namespace objects
|
|
12322
|
+
if (typeof this.info.syntheticNamedExports === 'string') {
|
|
12323
|
+
allExportNames.delete(this.info.syntheticNamedExports);
|
|
12324
|
+
}
|
|
12315
12325
|
return allExportNames;
|
|
12316
12326
|
}
|
|
12317
12327
|
getDependenciesToBeIncluded() {
|
|
@@ -12320,14 +12330,13 @@ class Module {
|
|
|
12320
12330
|
const relevantDependencies = new Set();
|
|
12321
12331
|
const necessaryDependencies = new Set();
|
|
12322
12332
|
const alwaysCheckedDependencies = new Set();
|
|
12323
|
-
|
|
12333
|
+
const dependencyVariables = new Set(this.imports);
|
|
12324
12334
|
if (this.info.isEntry ||
|
|
12325
12335
|
this.includedDynamicImporters.length > 0 ||
|
|
12326
12336
|
this.namespace.included ||
|
|
12327
12337
|
this.implicitlyLoadedAfter.size > 0) {
|
|
12328
|
-
dependencyVariables = new Set(dependencyVariables);
|
|
12329
12338
|
for (const exportName of [...this.getReexports(), ...this.getExports()]) {
|
|
12330
|
-
const exportedVariable = this.getVariableForExportName(exportName);
|
|
12339
|
+
const [exportedVariable] = this.getVariableForExportName(exportName);
|
|
12331
12340
|
if (exportedVariable) {
|
|
12332
12341
|
dependencyVariables.add(exportedVariable);
|
|
12333
12342
|
}
|
|
@@ -12367,9 +12376,7 @@ class Module {
|
|
|
12367
12376
|
}
|
|
12368
12377
|
const exportNamesByVariable = new Map();
|
|
12369
12378
|
for (const exportName of this.getAllExportNames()) {
|
|
12370
|
-
|
|
12371
|
-
continue;
|
|
12372
|
-
let tracedVariable = this.getVariableForExportName(exportName);
|
|
12379
|
+
let [tracedVariable] = this.getVariableForExportName(exportName);
|
|
12373
12380
|
if (tracedVariable instanceof ExportDefaultVariable) {
|
|
12374
12381
|
tracedVariable = tracedVariable.getOriginalVariable();
|
|
12375
12382
|
}
|
|
@@ -12418,7 +12425,7 @@ class Module {
|
|
|
12418
12425
|
const renderedExports = [];
|
|
12419
12426
|
const removedExports = [];
|
|
12420
12427
|
for (const exportName in this.exports) {
|
|
12421
|
-
const variable = this.getVariableForExportName(exportName);
|
|
12428
|
+
const [variable] = this.getVariableForExportName(exportName);
|
|
12422
12429
|
(variable && variable.included ? renderedExports : removedExports).push(exportName);
|
|
12423
12430
|
}
|
|
12424
12431
|
return { removedExports, renderedExports };
|
|
@@ -12426,20 +12433,20 @@ class Module {
|
|
|
12426
12433
|
getSyntheticNamespace() {
|
|
12427
12434
|
if (this.syntheticNamespace === null) {
|
|
12428
12435
|
this.syntheticNamespace = undefined;
|
|
12429
|
-
this.syntheticNamespace = this.getVariableForExportName(typeof this.info.syntheticNamedExports === 'string'
|
|
12436
|
+
[this.syntheticNamespace] = this.getVariableForExportName(typeof this.info.syntheticNamedExports === 'string'
|
|
12430
12437
|
? this.info.syntheticNamedExports
|
|
12431
|
-
: 'default');
|
|
12438
|
+
: 'default', { onlyExplicit: true });
|
|
12432
12439
|
}
|
|
12433
12440
|
if (!this.syntheticNamespace) {
|
|
12434
12441
|
return error(errSyntheticNamedExportsNeedNamespaceExport(this.id, this.info.syntheticNamedExports));
|
|
12435
12442
|
}
|
|
12436
12443
|
return this.syntheticNamespace;
|
|
12437
12444
|
}
|
|
12438
|
-
getVariableForExportName(name, { importerForSideEffects, isExportAllSearch,
|
|
12445
|
+
getVariableForExportName(name, { importerForSideEffects, isExportAllSearch, onlyExplicit, searchedNamesAndModules } = EMPTY_OBJECT) {
|
|
12439
12446
|
if (name[0] === '*') {
|
|
12440
12447
|
if (name.length === 1) {
|
|
12441
12448
|
// export * from './other'
|
|
12442
|
-
return this.namespace;
|
|
12449
|
+
return [this.namespace];
|
|
12443
12450
|
}
|
|
12444
12451
|
else {
|
|
12445
12452
|
// export * from 'external'
|
|
@@ -12450,19 +12457,19 @@ class Module {
|
|
|
12450
12457
|
// export { foo } from './other'
|
|
12451
12458
|
const reexportDeclaration = this.reexportDescriptions[name];
|
|
12452
12459
|
if (reexportDeclaration) {
|
|
12453
|
-
const variable = getVariableForExportNameRecursive(reexportDeclaration.module, reexportDeclaration.localName, importerForSideEffects, false, searchedNamesAndModules
|
|
12460
|
+
const [variable] = getVariableForExportNameRecursive(reexportDeclaration.module, reexportDeclaration.localName, importerForSideEffects, false, searchedNamesAndModules);
|
|
12454
12461
|
if (!variable) {
|
|
12455
12462
|
return this.error(errMissingExport(reexportDeclaration.localName, this.id, reexportDeclaration.module.id), reexportDeclaration.start);
|
|
12456
12463
|
}
|
|
12457
12464
|
if (importerForSideEffects) {
|
|
12458
12465
|
setAlternativeExporterIfCyclic(variable, importerForSideEffects, this);
|
|
12459
12466
|
}
|
|
12460
|
-
return variable;
|
|
12467
|
+
return [variable];
|
|
12461
12468
|
}
|
|
12462
12469
|
const exportDeclaration = this.exports[name];
|
|
12463
12470
|
if (exportDeclaration) {
|
|
12464
12471
|
if (exportDeclaration === MISSING_EXPORT_SHIM_DESCRIPTION) {
|
|
12465
|
-
return this.exportShimVariable;
|
|
12472
|
+
return [this.exportShimVariable];
|
|
12466
12473
|
}
|
|
12467
12474
|
const name = exportDeclaration.localName;
|
|
12468
12475
|
const variable = this.traceVariable(name, importerForSideEffects);
|
|
@@ -12470,38 +12477,34 @@ class Module {
|
|
|
12470
12477
|
getOrCreate(importerForSideEffects.sideEffectDependenciesByVariable, variable, () => new Set()).add(this);
|
|
12471
12478
|
setAlternativeExporterIfCyclic(variable, importerForSideEffects, this);
|
|
12472
12479
|
}
|
|
12473
|
-
return variable;
|
|
12480
|
+
return [variable];
|
|
12481
|
+
}
|
|
12482
|
+
if (onlyExplicit) {
|
|
12483
|
+
return [null];
|
|
12474
12484
|
}
|
|
12475
12485
|
if (name !== 'default') {
|
|
12476
12486
|
const foundNamespaceReexport = name in this.namespaceReexportsByName
|
|
12477
12487
|
? this.namespaceReexportsByName[name]
|
|
12478
|
-
: this.getVariableFromNamespaceReexports(name, importerForSideEffects, searchedNamesAndModules
|
|
12479
|
-
|
|
12480
|
-
|
|
12481
|
-
}
|
|
12482
|
-
if (foundNamespaceReexport) {
|
|
12488
|
+
: this.getVariableFromNamespaceReexports(name, importerForSideEffects, searchedNamesAndModules);
|
|
12489
|
+
this.namespaceReexportsByName[name] = foundNamespaceReexport;
|
|
12490
|
+
if (foundNamespaceReexport[0]) {
|
|
12483
12491
|
return foundNamespaceReexport;
|
|
12484
12492
|
}
|
|
12485
12493
|
}
|
|
12486
12494
|
if (this.info.syntheticNamedExports) {
|
|
12487
|
-
|
|
12488
|
-
|
|
12489
|
-
|
|
12490
|
-
syntheticExport = new SyntheticNamedExportVariable(this.astContext, name, syntheticNamespace);
|
|
12491
|
-
this.syntheticExports.set(name, syntheticExport);
|
|
12492
|
-
return syntheticExport;
|
|
12493
|
-
}
|
|
12494
|
-
return syntheticExport;
|
|
12495
|
+
return [
|
|
12496
|
+
getOrCreate(this.syntheticExports, name, () => new SyntheticNamedExportVariable(this.astContext, name, this.getSyntheticNamespace()))
|
|
12497
|
+
];
|
|
12495
12498
|
}
|
|
12496
12499
|
// we don't want to create shims when we are just
|
|
12497
12500
|
// probing export * modules for exports
|
|
12498
12501
|
if (!isExportAllSearch) {
|
|
12499
12502
|
if (this.options.shimMissingExports) {
|
|
12500
12503
|
this.shimMissingExport(name);
|
|
12501
|
-
return this.exportShimVariable;
|
|
12504
|
+
return [this.exportShimVariable];
|
|
12502
12505
|
}
|
|
12503
12506
|
}
|
|
12504
|
-
return null;
|
|
12507
|
+
return [null];
|
|
12505
12508
|
}
|
|
12506
12509
|
hasEffects() {
|
|
12507
12510
|
return (this.info.hasModuleSideEffects === 'no-treeshake' ||
|
|
@@ -12519,7 +12522,7 @@ class Module {
|
|
|
12519
12522
|
}
|
|
12520
12523
|
for (const exportName of this.getExports()) {
|
|
12521
12524
|
if (includeNamespaceMembers || exportName !== this.info.syntheticNamedExports) {
|
|
12522
|
-
const variable = this.getVariableForExportName(exportName);
|
|
12525
|
+
const variable = this.getVariableForExportName(exportName)[0];
|
|
12523
12526
|
variable.deoptimizePath(UNKNOWN_PATH);
|
|
12524
12527
|
if (!variable.included) {
|
|
12525
12528
|
this.includeVariable(variable);
|
|
@@ -12527,7 +12530,7 @@ class Module {
|
|
|
12527
12530
|
}
|
|
12528
12531
|
}
|
|
12529
12532
|
for (const name of this.getReexports()) {
|
|
12530
|
-
const variable = this.getVariableForExportName(name);
|
|
12533
|
+
const [variable] = this.getVariableForExportName(name);
|
|
12531
12534
|
if (variable) {
|
|
12532
12535
|
variable.deoptimizePath(UNKNOWN_PATH);
|
|
12533
12536
|
if (!variable.included) {
|
|
@@ -12552,11 +12555,6 @@ class Module {
|
|
|
12552
12555
|
linkImports() {
|
|
12553
12556
|
this.addModulesToImportDescriptions(this.importDescriptions);
|
|
12554
12557
|
this.addModulesToImportDescriptions(this.reexportDescriptions);
|
|
12555
|
-
for (const name in this.exports) {
|
|
12556
|
-
if (name !== 'default' && name !== this.info.syntheticNamedExports) {
|
|
12557
|
-
this.exportsAll[name] = this.id;
|
|
12558
|
-
}
|
|
12559
|
-
}
|
|
12560
12558
|
const externalExportAllModules = [];
|
|
12561
12559
|
for (const source of this.exportAllSources) {
|
|
12562
12560
|
const module = this.graph.modulesById.get(this.resolvedIds[source].id);
|
|
@@ -12565,14 +12563,6 @@ class Module {
|
|
|
12565
12563
|
continue;
|
|
12566
12564
|
}
|
|
12567
12565
|
this.exportAllModules.push(module);
|
|
12568
|
-
for (const name in module.exportsAll) {
|
|
12569
|
-
if (name in this.exportsAll) {
|
|
12570
|
-
this.options.onwarn(errNamespaceConflict(name, this, module));
|
|
12571
|
-
}
|
|
12572
|
-
else {
|
|
12573
|
-
this.exportsAll[name] = module.exportsAll[name];
|
|
12574
|
-
}
|
|
12575
|
-
}
|
|
12576
12566
|
}
|
|
12577
12567
|
this.exportAllModules.push(...externalExportAllModules);
|
|
12578
12568
|
}
|
|
@@ -12630,7 +12620,7 @@ class Module {
|
|
|
12630
12620
|
moduleContext: this.context,
|
|
12631
12621
|
options: this.options,
|
|
12632
12622
|
requestTreeshakingPass: () => (this.graph.needsTreeshakingPass = true),
|
|
12633
|
-
traceExport: this.getVariableForExportName
|
|
12623
|
+
traceExport: (name) => this.getVariableForExportName(name)[0],
|
|
12634
12624
|
traceVariable: this.traceVariable.bind(this),
|
|
12635
12625
|
usesTopLevelAwait: false,
|
|
12636
12626
|
warn: this.warn.bind(this)
|
|
@@ -12670,7 +12660,7 @@ class Module {
|
|
|
12670
12660
|
if (otherModule instanceof Module && importDeclaration.name === '*') {
|
|
12671
12661
|
return otherModule.namespace;
|
|
12672
12662
|
}
|
|
12673
|
-
const declaration = otherModule.getVariableForExportName(importDeclaration.name, {
|
|
12663
|
+
const [declaration] = otherModule.getVariableForExportName(importDeclaration.name, {
|
|
12674
12664
|
importerForSideEffects: importerForSideEffects || this
|
|
12675
12665
|
});
|
|
12676
12666
|
if (!declaration) {
|
|
@@ -12798,11 +12788,7 @@ class Module {
|
|
|
12798
12788
|
for (const specifier of node.specifiers) {
|
|
12799
12789
|
const isDefault = specifier.type === ImportDefaultSpecifier$1;
|
|
12800
12790
|
const isNamespace = specifier.type === ImportNamespaceSpecifier$1;
|
|
12801
|
-
const name = isDefault
|
|
12802
|
-
? 'default'
|
|
12803
|
-
: isNamespace
|
|
12804
|
-
? '*'
|
|
12805
|
-
: specifier.imported.name;
|
|
12791
|
+
const name = isDefault ? 'default' : isNamespace ? '*' : specifier.imported.name;
|
|
12806
12792
|
this.importDescriptions[specifier.local.name] = {
|
|
12807
12793
|
module: null,
|
|
12808
12794
|
name,
|
|
@@ -12872,58 +12858,57 @@ class Module {
|
|
|
12872
12858
|
addSideEffectDependencies(this.dependencies);
|
|
12873
12859
|
addSideEffectDependencies(alwaysCheckedDependencies);
|
|
12874
12860
|
}
|
|
12875
|
-
getVariableFromNamespaceReexports(name, importerForSideEffects, searchedNamesAndModules
|
|
12861
|
+
getVariableFromNamespaceReexports(name, importerForSideEffects, searchedNamesAndModules) {
|
|
12876
12862
|
let foundSyntheticDeclaration = null;
|
|
12877
|
-
const
|
|
12878
|
-
|
|
12879
|
-
|
|
12880
|
-
|
|
12881
|
-
|
|
12882
|
-
|
|
12883
|
-
skipExternalNamespaceValues.push({
|
|
12884
|
-
searchedNamesAndModules: clonedSearchedNamesAndModules,
|
|
12885
|
-
skipExternalNamespaces: false
|
|
12886
|
-
});
|
|
12887
|
-
}
|
|
12888
|
-
for (const { skipExternalNamespaces, searchedNamesAndModules } of skipExternalNamespaceValues) {
|
|
12889
|
-
const foundDeclarations = new Set();
|
|
12890
|
-
for (const module of this.exportAllModules) {
|
|
12891
|
-
if (module instanceof Module || !skipExternalNamespaces) {
|
|
12892
|
-
const declaration = getVariableForExportNameRecursive(module, name, importerForSideEffects, true, searchedNamesAndModules, skipExternalNamespaces);
|
|
12893
|
-
if (declaration) {
|
|
12894
|
-
if (!(declaration instanceof SyntheticNamedExportVariable)) {
|
|
12895
|
-
foundDeclarations.add(declaration);
|
|
12896
|
-
}
|
|
12897
|
-
else if (!foundSyntheticDeclaration) {
|
|
12898
|
-
foundSyntheticDeclaration = declaration;
|
|
12899
|
-
}
|
|
12900
|
-
}
|
|
12901
|
-
}
|
|
12863
|
+
const foundInternalDeclarations = new Map();
|
|
12864
|
+
const foundExternalDeclarations = new Set();
|
|
12865
|
+
for (const module of this.exportAllModules) {
|
|
12866
|
+
// Synthetic namespaces should not hide "regular" exports of the same name
|
|
12867
|
+
if (module.info.syntheticNamedExports === name) {
|
|
12868
|
+
continue;
|
|
12902
12869
|
}
|
|
12903
|
-
|
|
12904
|
-
|
|
12870
|
+
const [variable, indirectExternal] = getVariableForExportNameRecursive(module, name, importerForSideEffects, true, searchedNamesAndModules);
|
|
12871
|
+
if (module instanceof ExternalModule || indirectExternal) {
|
|
12872
|
+
foundExternalDeclarations.add(variable);
|
|
12905
12873
|
}
|
|
12906
|
-
if (
|
|
12907
|
-
if (
|
|
12908
|
-
|
|
12874
|
+
else if (variable instanceof SyntheticNamedExportVariable) {
|
|
12875
|
+
if (!foundSyntheticDeclaration) {
|
|
12876
|
+
foundSyntheticDeclaration = variable;
|
|
12909
12877
|
}
|
|
12910
|
-
|
|
12911
|
-
|
|
12878
|
+
}
|
|
12879
|
+
else if (variable) {
|
|
12880
|
+
foundInternalDeclarations.set(variable, module);
|
|
12881
|
+
}
|
|
12882
|
+
}
|
|
12883
|
+
if (foundInternalDeclarations.size > 0) {
|
|
12884
|
+
const foundDeclarationList = [...foundInternalDeclarations];
|
|
12885
|
+
const usedDeclaration = foundDeclarationList[0][0];
|
|
12886
|
+
if (foundDeclarationList.length === 1) {
|
|
12887
|
+
return [usedDeclaration];
|
|
12888
|
+
}
|
|
12889
|
+
this.options.onwarn(errNamespaceConflict(name, this.id, foundDeclarationList.map(([, module]) => module.id)));
|
|
12890
|
+
// TODO we are pretending it was not found while it should behave like "undefined"
|
|
12891
|
+
return [null];
|
|
12892
|
+
}
|
|
12893
|
+
if (foundExternalDeclarations.size > 0) {
|
|
12894
|
+
const foundDeclarationList = [...foundExternalDeclarations];
|
|
12895
|
+
const usedDeclaration = foundDeclarationList[0];
|
|
12896
|
+
if (foundDeclarationList.length > 1) {
|
|
12912
12897
|
this.options.onwarn(errAmbiguousExternalNamespaces(name, this.id, usedDeclaration.module.id, foundDeclarationList.map(declaration => declaration.module.id)));
|
|
12913
|
-
return usedDeclaration;
|
|
12914
12898
|
}
|
|
12899
|
+
return [usedDeclaration, true];
|
|
12915
12900
|
}
|
|
12916
12901
|
if (foundSyntheticDeclaration) {
|
|
12917
|
-
return foundSyntheticDeclaration;
|
|
12902
|
+
return [foundSyntheticDeclaration];
|
|
12918
12903
|
}
|
|
12919
|
-
return null;
|
|
12904
|
+
return [null];
|
|
12920
12905
|
}
|
|
12921
12906
|
includeAndGetAdditionalMergedNamespaces() {
|
|
12922
12907
|
const externalNamespaces = new Set();
|
|
12923
12908
|
const syntheticNamespaces = new Set();
|
|
12924
12909
|
for (const module of [this, ...this.exportAllModules]) {
|
|
12925
12910
|
if (module instanceof ExternalModule) {
|
|
12926
|
-
const externalVariable = module.getVariableForExportName('*');
|
|
12911
|
+
const [externalVariable] = module.getVariableForExportName('*');
|
|
12927
12912
|
externalVariable.include();
|
|
12928
12913
|
this.imports.add(externalVariable);
|
|
12929
12914
|
externalNamespaces.add(externalVariable);
|
|
@@ -12949,7 +12934,7 @@ class Module {
|
|
|
12949
12934
|
variable.include();
|
|
12950
12935
|
this.graph.needsTreeshakingPass = true;
|
|
12951
12936
|
const variableModule = variable.module;
|
|
12952
|
-
if (variableModule
|
|
12937
|
+
if (variableModule instanceof Module) {
|
|
12953
12938
|
if (!variableModule.isExecuted) {
|
|
12954
12939
|
markModuleAndImpureDependenciesAsExecuted(variableModule);
|
|
12955
12940
|
}
|
|
@@ -14066,7 +14051,7 @@ function assignExportsToMangledNames(exports, exportsByName, exportNamesByVariab
|
|
|
14066
14051
|
let nameIndex = 0;
|
|
14067
14052
|
for (const variable of exports) {
|
|
14068
14053
|
let [exportName] = variable.name;
|
|
14069
|
-
if (exportsByName
|
|
14054
|
+
if (exportsByName.has(exportName)) {
|
|
14070
14055
|
do {
|
|
14071
14056
|
exportName = toBase64(++nameIndex);
|
|
14072
14057
|
// skip past leading number identifiers
|
|
@@ -14074,9 +14059,9 @@ function assignExportsToMangledNames(exports, exportsByName, exportNamesByVariab
|
|
|
14074
14059
|
nameIndex += 9 * 64 ** (exportName.length - 1);
|
|
14075
14060
|
exportName = toBase64(nameIndex);
|
|
14076
14061
|
}
|
|
14077
|
-
} while (RESERVED_NAMES$1.has(exportName) || exportsByName
|
|
14062
|
+
} while (RESERVED_NAMES$1.has(exportName) || exportsByName.has(exportName));
|
|
14078
14063
|
}
|
|
14079
|
-
exportsByName
|
|
14064
|
+
exportsByName.set(exportName, variable);
|
|
14080
14065
|
exportNamesByVariable.set(variable, [exportName]);
|
|
14081
14066
|
}
|
|
14082
14067
|
}
|
|
@@ -14084,10 +14069,10 @@ function assignExportsToNames(exports, exportsByName, exportNamesByVariable) {
|
|
|
14084
14069
|
for (const variable of exports) {
|
|
14085
14070
|
let nameIndex = 0;
|
|
14086
14071
|
let exportName = variable.name;
|
|
14087
|
-
while (exportsByName
|
|
14072
|
+
while (exportsByName.has(exportName)) {
|
|
14088
14073
|
exportName = variable.name + '$' + ++nameIndex;
|
|
14089
14074
|
}
|
|
14090
|
-
exportsByName
|
|
14075
|
+
exportsByName.set(exportName, variable);
|
|
14091
14076
|
exportNamesByVariable.set(variable, [exportName]);
|
|
14092
14077
|
}
|
|
14093
14078
|
}
|
|
@@ -14301,12 +14286,13 @@ class Chunk {
|
|
|
14301
14286
|
this.dynamicName = null;
|
|
14302
14287
|
this.exportNamesByVariable = new Map();
|
|
14303
14288
|
this.exports = new Set();
|
|
14304
|
-
this.exportsByName =
|
|
14289
|
+
this.exportsByName = new Map();
|
|
14305
14290
|
this.fileName = null;
|
|
14306
14291
|
this.implicitEntryModules = [];
|
|
14307
14292
|
this.implicitlyLoadedBefore = new Set();
|
|
14308
14293
|
this.imports = new Set();
|
|
14309
14294
|
this.indentString = undefined;
|
|
14295
|
+
// This may only be updated in the constructor
|
|
14310
14296
|
this.isEmpty = true;
|
|
14311
14297
|
this.name = null;
|
|
14312
14298
|
this.renderedDependencies = null;
|
|
@@ -14399,7 +14385,7 @@ class Chunk {
|
|
|
14399
14385
|
for (const [variable, exportNames] of exportNamesByVariable) {
|
|
14400
14386
|
this.exportNamesByVariable.set(variable, [...exportNames]);
|
|
14401
14387
|
for (const exportName of exportNames) {
|
|
14402
|
-
this.exportsByName
|
|
14388
|
+
this.exportsByName.set(exportName, variable);
|
|
14403
14389
|
}
|
|
14404
14390
|
remainingExports.delete(variable);
|
|
14405
14391
|
}
|
|
@@ -14492,7 +14478,7 @@ class Chunk {
|
|
|
14492
14478
|
}), existingNames);
|
|
14493
14479
|
}
|
|
14494
14480
|
generateIdPreserveModules(preserveModulesRelativeDir, options, existingNames, unsetOptions) {
|
|
14495
|
-
const id = this.orderedModules
|
|
14481
|
+
const [{ id }] = this.orderedModules;
|
|
14496
14482
|
const sanitizedId = this.outputOptions.sanitizeFileName(id);
|
|
14497
14483
|
let path;
|
|
14498
14484
|
const patternOpt = unsetOptions.has('entryFileNames')
|
|
@@ -14560,10 +14546,12 @@ class Chunk {
|
|
|
14560
14546
|
});
|
|
14561
14547
|
}
|
|
14562
14548
|
getChunkName() {
|
|
14563
|
-
|
|
14549
|
+
var _a;
|
|
14550
|
+
return ((_a = this.name) !== null && _a !== void 0 ? _a : (this.name = this.outputOptions.sanitizeFileName(this.getFallbackChunkName())));
|
|
14564
14551
|
}
|
|
14565
14552
|
getExportNames() {
|
|
14566
|
-
|
|
14553
|
+
var _a;
|
|
14554
|
+
return ((_a = this.sortedExportNames) !== null && _a !== void 0 ? _a : (this.sortedExportNames = Array.from(this.exportsByName.keys()).sort()));
|
|
14567
14555
|
}
|
|
14568
14556
|
getRenderedHash() {
|
|
14569
14557
|
if (this.renderedHash)
|
|
@@ -14579,7 +14567,7 @@ class Chunk {
|
|
|
14579
14567
|
hash.update(this.renderedSource.toString());
|
|
14580
14568
|
hash.update(this.getExportNames()
|
|
14581
14569
|
.map(exportName => {
|
|
14582
|
-
const variable = this.exportsByName
|
|
14570
|
+
const variable = this.exportsByName.get(exportName);
|
|
14583
14571
|
return `${relativeId(variable.module.id).replace(/\\/g, '/')}:${variable.name}:${exportName}`;
|
|
14584
14572
|
})
|
|
14585
14573
|
.join(','));
|
|
@@ -14838,12 +14826,12 @@ class Chunk {
|
|
|
14838
14826
|
}
|
|
14839
14827
|
computeContentHashWithDependencies(addons, options, existingNames) {
|
|
14840
14828
|
const hash = createHash();
|
|
14841
|
-
hash.update([addons.intro, addons.outro, addons.banner, addons.footer].
|
|
14829
|
+
hash.update([addons.intro, addons.outro, addons.banner, addons.footer].join(':'));
|
|
14842
14830
|
hash.update(options.format);
|
|
14843
14831
|
const dependenciesForHashing = new Set([this]);
|
|
14844
14832
|
for (const current of dependenciesForHashing) {
|
|
14845
14833
|
if (current instanceof ExternalModule) {
|
|
14846
|
-
hash.update(
|
|
14834
|
+
hash.update(`:${current.renderPath}`);
|
|
14847
14835
|
}
|
|
14848
14836
|
else {
|
|
14849
14837
|
hash.update(current.getRenderedHash());
|
|
@@ -14950,7 +14938,7 @@ class Chunk {
|
|
|
14950
14938
|
for (const exportName of this.getExportNames()) {
|
|
14951
14939
|
if (exportName[0] === '*')
|
|
14952
14940
|
continue;
|
|
14953
|
-
const variable = this.exportsByName
|
|
14941
|
+
const variable = this.exportsByName.get(exportName);
|
|
14954
14942
|
if (!(variable instanceof SyntheticNamedExportVariable)) {
|
|
14955
14943
|
const module = variable.module;
|
|
14956
14944
|
if (module && this.chunkByModule.get(module) !== this)
|
|
@@ -15098,7 +15086,7 @@ class Chunk {
|
|
|
15098
15086
|
imported = exportName = '*';
|
|
15099
15087
|
}
|
|
15100
15088
|
else {
|
|
15101
|
-
const variable = this.exportsByName
|
|
15089
|
+
const variable = this.exportsByName.get(exportName);
|
|
15102
15090
|
if (variable instanceof SyntheticNamedExportVariable)
|
|
15103
15091
|
continue;
|
|
15104
15092
|
const module = variable.module;
|
|
@@ -15199,7 +15187,7 @@ class Chunk {
|
|
|
15199
15187
|
setIdentifierRenderResolutions({ format, interop, namespaceToStringTag }) {
|
|
15200
15188
|
const syntheticExports = new Set();
|
|
15201
15189
|
for (const exportName of this.getExportNames()) {
|
|
15202
|
-
const exportVariable = this.exportsByName
|
|
15190
|
+
const exportVariable = this.exportsByName.get(exportName);
|
|
15203
15191
|
if (format !== 'es' &&
|
|
15204
15192
|
format !== 'system' &&
|
|
15205
15193
|
exportVariable.isReassigned &&
|
|
@@ -16067,8 +16055,8 @@ var keywordRelationalOperator = /^in(stanceof)?$/;
|
|
|
16067
16055
|
// are only applied when a character is found to actually have a
|
|
16068
16056
|
// code point above 128.
|
|
16069
16057
|
// Generated by `bin/generate-identifier-regex.js`.
|
|
16070
|
-
var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\
|
|
16071
|
-
var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\
|
|
16058
|
+
var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088e\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7ca\ua7d0\ua7d1\ua7d3\ua7d5-\ua7d9\ua7f2-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc";
|
|
16059
|
+
var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0898-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f";
|
|
16072
16060
|
|
|
16073
16061
|
var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
|
|
16074
16062
|
var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
|
|
@@ -16082,10 +16070,10 @@ nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
|
|
|
16082
16070
|
// generated by bin/generate-identifier-regex.js
|
|
16083
16071
|
|
|
16084
16072
|
// eslint-disable-next-line comma-spacing
|
|
16085
|
-
var astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,
|
|
16073
|
+
var astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,190,0,80,921,103,110,18,195,2637,96,16,1070,4050,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,46,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,482,44,11,6,17,0,322,29,19,43,1269,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4152,8,221,3,5761,15,7472,3104,541,1507,4938];
|
|
16086
16074
|
|
|
16087
16075
|
// eslint-disable-next-line comma-spacing
|
|
16088
|
-
var astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,154,10,
|
|
16076
|
+
var astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,154,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,357,0,62,13,1495,6,110,6,6,9,4759,9,787719,239];
|
|
16089
16077
|
|
|
16090
16078
|
// This has a complexity linear to the value of the code. The
|
|
16091
16079
|
// assumption is that looking up astral identifier characters is
|
|
@@ -16290,6 +16278,17 @@ function isNewLine(code) {
|
|
|
16290
16278
|
return code === 10 || code === 13 || code === 0x2028 || code === 0x2029
|
|
16291
16279
|
}
|
|
16292
16280
|
|
|
16281
|
+
function nextLineBreak(code, from, end) {
|
|
16282
|
+
if ( end === void 0 ) end = code.length;
|
|
16283
|
+
|
|
16284
|
+
for (var i = from; i < end; i++) {
|
|
16285
|
+
var next = code.charCodeAt(i);
|
|
16286
|
+
if (isNewLine(next))
|
|
16287
|
+
{ return i < end - 1 && next === 13 && code.charCodeAt(i + 1) === 10 ? i + 2 : i + 1 }
|
|
16288
|
+
}
|
|
16289
|
+
return -1
|
|
16290
|
+
}
|
|
16291
|
+
|
|
16293
16292
|
var nonASCIIwhitespace = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/;
|
|
16294
16293
|
|
|
16295
16294
|
var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;
|
|
@@ -16298,11 +16297,9 @@ var ref = Object.prototype;
|
|
|
16298
16297
|
var hasOwnProperty = ref.hasOwnProperty;
|
|
16299
16298
|
var toString = ref.toString;
|
|
16300
16299
|
|
|
16301
|
-
|
|
16302
|
-
|
|
16303
|
-
|
|
16304
|
-
return hasOwnProperty.call(obj, propName)
|
|
16305
|
-
}
|
|
16300
|
+
var hasOwn = Object.hasOwn || (function (obj, propName) { return (
|
|
16301
|
+
hasOwnProperty.call(obj, propName)
|
|
16302
|
+
); });
|
|
16306
16303
|
|
|
16307
16304
|
var isArray = Array.isArray || (function (obj) { return (
|
|
16308
16305
|
toString.call(obj) === "[object Array]"
|
|
@@ -16312,6 +16309,8 @@ function wordsRegexp(words) {
|
|
|
16312
16309
|
return new RegExp("^(?:" + words.replace(/ /g, "|") + ")$")
|
|
16313
16310
|
}
|
|
16314
16311
|
|
|
16312
|
+
var loneSurrogate = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/;
|
|
16313
|
+
|
|
16315
16314
|
// These are used when `options.locations` is on, for the
|
|
16316
16315
|
// `startLoc` and `endLoc` properties.
|
|
16317
16316
|
|
|
@@ -16338,14 +16337,10 @@ var SourceLocation = function SourceLocation(p, start, end) {
|
|
|
16338
16337
|
|
|
16339
16338
|
function getLineInfo(input, offset) {
|
|
16340
16339
|
for (var line = 1, cur = 0;;) {
|
|
16341
|
-
|
|
16342
|
-
|
|
16343
|
-
|
|
16344
|
-
|
|
16345
|
-
cur = match.index + match[0].length;
|
|
16346
|
-
} else {
|
|
16347
|
-
return new Position(line, offset - cur)
|
|
16348
|
-
}
|
|
16340
|
+
var nextBreak = nextLineBreak(input, cur, offset);
|
|
16341
|
+
if (nextBreak < 0) { return new Position(line, offset - cur) }
|
|
16342
|
+
++line;
|
|
16343
|
+
cur = nextBreak;
|
|
16349
16344
|
}
|
|
16350
16345
|
}
|
|
16351
16346
|
|
|
@@ -16451,7 +16446,7 @@ function getOptions(opts) {
|
|
|
16451
16446
|
var options = {};
|
|
16452
16447
|
|
|
16453
16448
|
for (var opt in defaultOptions)
|
|
16454
|
-
{ options[opt] = opts &&
|
|
16449
|
+
{ options[opt] = opts && hasOwn(opts, opt) ? opts[opt] : defaultOptions[opt]; }
|
|
16455
16450
|
|
|
16456
16451
|
if (options.ecmaVersion === "latest") {
|
|
16457
16452
|
options.ecmaVersion = 1e8;
|
|
@@ -17617,7 +17612,7 @@ pp$8.exitClassBody = function() {
|
|
|
17617
17612
|
var parent = len === 0 ? null : this.privateNameStack[len - 1];
|
|
17618
17613
|
for (var i = 0; i < used.length; ++i) {
|
|
17619
17614
|
var id = used[i];
|
|
17620
|
-
if (!
|
|
17615
|
+
if (!hasOwn(declared, id.name)) {
|
|
17621
17616
|
if (parent) {
|
|
17622
17617
|
parent.used.push(id);
|
|
17623
17618
|
} else {
|
|
@@ -17670,7 +17665,7 @@ pp$8.parseExport = function(node, exports) {
|
|
|
17670
17665
|
if (this.eat(types$1.star)) {
|
|
17671
17666
|
if (this.options.ecmaVersion >= 11) {
|
|
17672
17667
|
if (this.eatContextual("as")) {
|
|
17673
|
-
node.exported = this.
|
|
17668
|
+
node.exported = this.parseModuleExportName();
|
|
17674
17669
|
this.checkExport(exports, node.exported.name, this.lastTokStart);
|
|
17675
17670
|
} else {
|
|
17676
17671
|
node.exported = null;
|
|
@@ -17722,6 +17717,10 @@ pp$8.parseExport = function(node, exports) {
|
|
|
17722
17717
|
this.checkUnreserved(spec.local);
|
|
17723
17718
|
// check if export is defined
|
|
17724
17719
|
this.checkLocalExport(spec.local);
|
|
17720
|
+
|
|
17721
|
+
if (spec.local.type === "Literal") {
|
|
17722
|
+
this.raise(spec.local.start, "A string literal cannot be used as an exported binding without `from`.");
|
|
17723
|
+
}
|
|
17725
17724
|
}
|
|
17726
17725
|
|
|
17727
17726
|
node.source = null;
|
|
@@ -17733,7 +17732,7 @@ pp$8.parseExport = function(node, exports) {
|
|
|
17733
17732
|
|
|
17734
17733
|
pp$8.checkExport = function(exports, name, pos) {
|
|
17735
17734
|
if (!exports) { return }
|
|
17736
|
-
if (
|
|
17735
|
+
if (hasOwn(exports, name))
|
|
17737
17736
|
{ this.raiseRecoverable(pos, "Duplicate export '" + name + "'"); }
|
|
17738
17737
|
exports[name] = true;
|
|
17739
17738
|
};
|
|
@@ -17797,9 +17796,13 @@ pp$8.parseExportSpecifiers = function(exports) {
|
|
|
17797
17796
|
} else { first = false; }
|
|
17798
17797
|
|
|
17799
17798
|
var node = this.startNode();
|
|
17800
|
-
node.local = this.
|
|
17801
|
-
node.exported = this.eatContextual("as") ? this.
|
|
17802
|
-
this.checkExport(
|
|
17799
|
+
node.local = this.parseModuleExportName();
|
|
17800
|
+
node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local;
|
|
17801
|
+
this.checkExport(
|
|
17802
|
+
exports,
|
|
17803
|
+
node.exported[node.exported.type === "Identifier" ? "name" : "value"],
|
|
17804
|
+
node.exported.start
|
|
17805
|
+
);
|
|
17803
17806
|
nodes.push(this.finishNode(node, "ExportSpecifier"));
|
|
17804
17807
|
}
|
|
17805
17808
|
return nodes
|
|
@@ -17851,7 +17854,7 @@ pp$8.parseImportSpecifiers = function() {
|
|
|
17851
17854
|
} else { first = false; }
|
|
17852
17855
|
|
|
17853
17856
|
var node$2 = this.startNode();
|
|
17854
|
-
node$2.imported = this.
|
|
17857
|
+
node$2.imported = this.parseModuleExportName();
|
|
17855
17858
|
if (this.eatContextual("as")) {
|
|
17856
17859
|
node$2.local = this.parseIdent();
|
|
17857
17860
|
} else {
|
|
@@ -17864,6 +17867,17 @@ pp$8.parseImportSpecifiers = function() {
|
|
|
17864
17867
|
return nodes
|
|
17865
17868
|
};
|
|
17866
17869
|
|
|
17870
|
+
pp$8.parseModuleExportName = function() {
|
|
17871
|
+
if (this.options.ecmaVersion >= 13 && this.type === types$1.string) {
|
|
17872
|
+
var stringLiteral = this.parseLiteral(this.value);
|
|
17873
|
+
if (loneSurrogate.test(stringLiteral.value)) {
|
|
17874
|
+
this.raise(stringLiteral.start, "An export name cannot include a lone surrogate.");
|
|
17875
|
+
}
|
|
17876
|
+
return stringLiteral
|
|
17877
|
+
}
|
|
17878
|
+
return this.parseIdent(true)
|
|
17879
|
+
};
|
|
17880
|
+
|
|
17867
17881
|
// Set `ExpressionStatement#directive` property for directive prologues.
|
|
17868
17882
|
pp$8.adaptDirectivePrologue = function(statements) {
|
|
17869
17883
|
for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) {
|
|
@@ -18137,7 +18151,7 @@ pp$7.checkLValSimple = function(expr, bindingType, checkClashes) {
|
|
|
18137
18151
|
if (bindingType === BIND_LEXICAL && expr.name === "let")
|
|
18138
18152
|
{ this.raiseRecoverable(expr.start, "let is disallowed as a lexically bound name"); }
|
|
18139
18153
|
if (checkClashes) {
|
|
18140
|
-
if (
|
|
18154
|
+
if (hasOwn(checkClashes, expr.name))
|
|
18141
18155
|
{ this.raiseRecoverable(expr.start, "Argument name clash"); }
|
|
18142
18156
|
checkClashes[expr.name] = true;
|
|
18143
18157
|
}
|
|
@@ -19632,26 +19646,30 @@ var ecma9BinaryProperties = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Ass
|
|
|
19632
19646
|
var ecma10BinaryProperties = ecma9BinaryProperties + " Extended_Pictographic";
|
|
19633
19647
|
var ecma11BinaryProperties = ecma10BinaryProperties;
|
|
19634
19648
|
var ecma12BinaryProperties = ecma11BinaryProperties + " EBase EComp EMod EPres ExtPict";
|
|
19649
|
+
var ecma13BinaryProperties = ecma12BinaryProperties;
|
|
19635
19650
|
var unicodeBinaryProperties = {
|
|
19636
19651
|
9: ecma9BinaryProperties,
|
|
19637
19652
|
10: ecma10BinaryProperties,
|
|
19638
19653
|
11: ecma11BinaryProperties,
|
|
19639
|
-
12: ecma12BinaryProperties
|
|
19654
|
+
12: ecma12BinaryProperties,
|
|
19655
|
+
13: ecma13BinaryProperties
|
|
19640
19656
|
};
|
|
19641
19657
|
|
|
19642
19658
|
// #table-unicode-general-category-values
|
|
19643
19659
|
var unicodeGeneralCategoryValues = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu";
|
|
19644
19660
|
|
|
19645
19661
|
// #table-unicode-script-values
|
|
19646
|
-
var ecma9ScriptValues = "Adlam Adlm Ahom
|
|
19662
|
+
var ecma9ScriptValues = "Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb";
|
|
19647
19663
|
var ecma10ScriptValues = ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd";
|
|
19648
19664
|
var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho";
|
|
19649
19665
|
var ecma12ScriptValues = ecma11ScriptValues + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi";
|
|
19666
|
+
var ecma13ScriptValues = ecma12ScriptValues + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith";
|
|
19650
19667
|
var unicodeScriptValues = {
|
|
19651
19668
|
9: ecma9ScriptValues,
|
|
19652
19669
|
10: ecma10ScriptValues,
|
|
19653
19670
|
11: ecma11ScriptValues,
|
|
19654
|
-
12: ecma12ScriptValues
|
|
19671
|
+
12: ecma12ScriptValues,
|
|
19672
|
+
13: ecma13ScriptValues
|
|
19655
19673
|
};
|
|
19656
19674
|
|
|
19657
19675
|
var data = {};
|
|
@@ -19669,17 +19687,19 @@ function buildUnicodeData(ecmaVersion) {
|
|
|
19669
19687
|
d.nonBinary.sc = d.nonBinary.Script;
|
|
19670
19688
|
d.nonBinary.scx = d.nonBinary.Script_Extensions;
|
|
19671
19689
|
}
|
|
19672
|
-
|
|
19673
|
-
|
|
19674
|
-
|
|
19675
|
-
|
|
19690
|
+
|
|
19691
|
+
for (var i = 0, list = [9, 10, 11, 12, 13]; i < list.length; i += 1) {
|
|
19692
|
+
var ecmaVersion = list[i];
|
|
19693
|
+
|
|
19694
|
+
buildUnicodeData(ecmaVersion);
|
|
19695
|
+
}
|
|
19676
19696
|
|
|
19677
19697
|
var pp$1 = Parser.prototype;
|
|
19678
19698
|
|
|
19679
19699
|
var RegExpValidationState = function RegExpValidationState(parser) {
|
|
19680
19700
|
this.parser = parser;
|
|
19681
19701
|
this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "") + (parser.options.ecmaVersion >= 13 ? "d" : "");
|
|
19682
|
-
this.unicodeProperties = data[parser.options.ecmaVersion >=
|
|
19702
|
+
this.unicodeProperties = data[parser.options.ecmaVersion >= 13 ? 13 : parser.options.ecmaVersion];
|
|
19683
19703
|
this.source = "";
|
|
19684
19704
|
this.flags = "";
|
|
19685
19705
|
this.start = 0;
|
|
@@ -20478,7 +20498,7 @@ pp$1.regexp_eatUnicodePropertyValueExpression = function(state) {
|
|
|
20478
20498
|
return false
|
|
20479
20499
|
};
|
|
20480
20500
|
pp$1.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) {
|
|
20481
|
-
if (!
|
|
20501
|
+
if (!hasOwn(state.unicodeProperties.nonBinary, name))
|
|
20482
20502
|
{ state.raise("Invalid property name"); }
|
|
20483
20503
|
if (!state.unicodeProperties.nonBinary[name].test(value))
|
|
20484
20504
|
{ state.raise("Invalid property value"); }
|
|
@@ -20830,11 +20850,9 @@ pp.skipBlockComment = function() {
|
|
|
20830
20850
|
if (end === -1) { this.raise(this.pos - 2, "Unterminated comment"); }
|
|
20831
20851
|
this.pos = end + 2;
|
|
20832
20852
|
if (this.options.locations) {
|
|
20833
|
-
|
|
20834
|
-
var match;
|
|
20835
|
-
while ((match = lineBreakG.exec(this.input)) && match.index < this.pos) {
|
|
20853
|
+
for (var nextBreak = (void 0), pos = start; (nextBreak = nextLineBreak(this.input, pos, this.pos)) > -1;) {
|
|
20836
20854
|
++this.curLine;
|
|
20837
|
-
this.lineStart =
|
|
20855
|
+
pos = this.lineStart = nextBreak;
|
|
20838
20856
|
}
|
|
20839
20857
|
}
|
|
20840
20858
|
if (this.options.onComment)
|
|
@@ -21545,7 +21563,7 @@ pp.readWord = function() {
|
|
|
21545
21563
|
|
|
21546
21564
|
// Acorn is a tiny, fast JavaScript parser written in JavaScript.
|
|
21547
21565
|
|
|
21548
|
-
var version = "8.
|
|
21566
|
+
var version = "8.7.0";
|
|
21549
21567
|
|
|
21550
21568
|
Parser.acorn = {
|
|
21551
21569
|
Parser: Parser,
|
|
@@ -21589,9 +21607,9 @@ function writeFile(dest, data) {
|
|
|
21589
21607
|
}
|
|
21590
21608
|
|
|
21591
21609
|
class Queue {
|
|
21592
|
-
constructor(maxParallel
|
|
21610
|
+
constructor(maxParallel) {
|
|
21593
21611
|
this.maxParallel = maxParallel;
|
|
21594
|
-
this.queue =
|
|
21612
|
+
this.queue = [];
|
|
21595
21613
|
this.workerCount = 0;
|
|
21596
21614
|
}
|
|
21597
21615
|
run(task) {
|
|
@@ -21922,7 +21940,6 @@ async function transform(source, module, pluginDriver, warn) {
|
|
|
21922
21940
|
ast,
|
|
21923
21941
|
code,
|
|
21924
21942
|
customTransformCache,
|
|
21925
|
-
meta: module.info.meta,
|
|
21926
21943
|
originalCode,
|
|
21927
21944
|
originalSourcemap,
|
|
21928
21945
|
sourcemapChain,
|
|
@@ -21930,6 +21947,7 @@ async function transform(source, module, pluginDriver, warn) {
|
|
|
21930
21947
|
};
|
|
21931
21948
|
}
|
|
21932
21949
|
|
|
21950
|
+
const RESOLVE_DEPENDENCIES = 'resolveDependencies';
|
|
21933
21951
|
class ModuleLoader {
|
|
21934
21952
|
constructor(graph, modulesById, options, pluginDriver) {
|
|
21935
21953
|
this.graph = graph;
|
|
@@ -21942,16 +21960,15 @@ class ModuleLoader {
|
|
|
21942
21960
|
this.moduleLoadPromises = new Map();
|
|
21943
21961
|
this.modulesWithLoadedDependencies = new Set();
|
|
21944
21962
|
this.nextEntryModuleIndex = 0;
|
|
21945
|
-
this.readQueue = new Queue();
|
|
21946
21963
|
this.resolveId = async (source, importer, customOptions, isEntry, skip = null) => {
|
|
21947
|
-
return this.
|
|
21964
|
+
return this.getResolvedIdWithDefaults(this.getNormalizedResolvedIdWithoutDefaults(this.options.external(source, importer, false)
|
|
21948
21965
|
? false
|
|
21949
21966
|
: await resolveId(source, importer, this.options.preserveSymlinks, this.pluginDriver, this.resolveId, skip, customOptions, typeof isEntry === 'boolean' ? isEntry : !importer), importer, source));
|
|
21950
21967
|
};
|
|
21951
21968
|
this.hasModuleSideEffects = options.treeshake
|
|
21952
21969
|
? options.treeshake.moduleSideEffects
|
|
21953
21970
|
: () => true;
|
|
21954
|
-
this.readQueue
|
|
21971
|
+
this.readQueue = new Queue(options.maxParallelFileReads);
|
|
21955
21972
|
}
|
|
21956
21973
|
async addAdditionalModules(unresolvedModules) {
|
|
21957
21974
|
const result = this.extendLoadModulesPromise(Promise.all(unresolvedModules.map(id => this.loadEntryModule(id, false, undefined, null))));
|
|
@@ -22002,22 +22019,9 @@ class ModuleLoader {
|
|
|
22002
22019
|
}
|
|
22003
22020
|
return module;
|
|
22004
22021
|
}
|
|
22005
|
-
preloadModule(resolvedId) {
|
|
22006
|
-
|
|
22007
|
-
|
|
22008
|
-
addDefaultsToResolvedId(resolvedId) {
|
|
22009
|
-
var _a, _b;
|
|
22010
|
-
if (!resolvedId) {
|
|
22011
|
-
return null;
|
|
22012
|
-
}
|
|
22013
|
-
const external = resolvedId.external || false;
|
|
22014
|
-
return {
|
|
22015
|
-
external,
|
|
22016
|
-
id: resolvedId.id,
|
|
22017
|
-
meta: resolvedId.meta || {},
|
|
22018
|
-
moduleSideEffects: (_a = resolvedId.moduleSideEffects) !== null && _a !== void 0 ? _a : this.hasModuleSideEffects(resolvedId.id, !!external),
|
|
22019
|
-
syntheticNamedExports: (_b = resolvedId.syntheticNamedExports) !== null && _b !== void 0 ? _b : false
|
|
22020
|
-
};
|
|
22022
|
+
async preloadModule(resolvedId) {
|
|
22023
|
+
const module = await this.fetchModule(this.getResolvedIdWithDefaults(resolvedId), undefined, false, resolvedId.resolveDependencies ? RESOLVE_DEPENDENCIES : true);
|
|
22024
|
+
return module.info;
|
|
22021
22025
|
}
|
|
22022
22026
|
addEntryWithImplicitDependants(unresolvedModule, implicitlyLoadedAfter) {
|
|
22023
22027
|
return this.extendLoadModulesPromise(this.loadEntryModule(unresolvedModule.id, false, unresolvedModule.importer, null).then(async (entryModule) => {
|
|
@@ -22053,13 +22057,23 @@ class ModuleLoader {
|
|
|
22053
22057
|
timeEnd('load modules', 3);
|
|
22054
22058
|
const sourceDescription = typeof source === 'string'
|
|
22055
22059
|
? { code: source }
|
|
22056
|
-
: typeof source === 'object' && typeof source.code === 'string'
|
|
22060
|
+
: source != null && typeof source === 'object' && typeof source.code === 'string'
|
|
22057
22061
|
? source
|
|
22058
22062
|
: error(errBadLoader(id));
|
|
22059
22063
|
const cachedModule = this.graph.cachedModules.get(id);
|
|
22060
22064
|
if (cachedModule &&
|
|
22061
22065
|
!cachedModule.customTransformCache &&
|
|
22062
|
-
cachedModule.originalCode === sourceDescription.code
|
|
22066
|
+
cachedModule.originalCode === sourceDescription.code &&
|
|
22067
|
+
!(await this.pluginDriver.hookFirst('shouldTransformCachedModule', [
|
|
22068
|
+
{
|
|
22069
|
+
ast: cachedModule.ast,
|
|
22070
|
+
code: cachedModule.code,
|
|
22071
|
+
id: cachedModule.id,
|
|
22072
|
+
meta: cachedModule.meta,
|
|
22073
|
+
moduleSideEffects: cachedModule.moduleSideEffects,
|
|
22074
|
+
syntheticNamedExports: cachedModule.syntheticNamedExports
|
|
22075
|
+
}
|
|
22076
|
+
]))) {
|
|
22063
22077
|
if (cachedModule.transformFiles) {
|
|
22064
22078
|
for (const emittedFile of cachedModule.transformFiles)
|
|
22065
22079
|
this.pluginDriver.emitFile(emittedFile);
|
|
@@ -22122,9 +22136,7 @@ class ModuleLoader {
|
|
|
22122
22136
|
this.getResolveDynamicImportPromises(module),
|
|
22123
22137
|
loadAndResolveDependenciesPromise
|
|
22124
22138
|
]);
|
|
22125
|
-
const loadAndResolveDependenciesPromise = loadPromise
|
|
22126
|
-
.then(([resolveStaticDependencyPromises, resolveDynamicImportPromises]) => Promise.all([...resolveStaticDependencyPromises, ...resolveDynamicImportPromises]))
|
|
22127
|
-
.then(() => this.pluginDriver.hookParallel('moduleParsed', [module.info]));
|
|
22139
|
+
const loadAndResolveDependenciesPromise = waitForDependencyResolution(loadPromise).then(() => this.pluginDriver.hookParallel('moduleParsed', [module.info]));
|
|
22128
22140
|
loadAndResolveDependenciesPromise.catch(() => {
|
|
22129
22141
|
/* avoid unhandled promise rejections */
|
|
22130
22142
|
});
|
|
@@ -22133,6 +22145,9 @@ class ModuleLoader {
|
|
|
22133
22145
|
if (!isPreload) {
|
|
22134
22146
|
await this.fetchModuleDependencies(module, ...resolveDependencyPromises);
|
|
22135
22147
|
}
|
|
22148
|
+
else if (isPreload === RESOLVE_DEPENDENCIES) {
|
|
22149
|
+
await loadAndResolveDependenciesPromise;
|
|
22150
|
+
}
|
|
22136
22151
|
return module;
|
|
22137
22152
|
}
|
|
22138
22153
|
async fetchModuleDependencies(module, resolveStaticDependencyPromises, resolveDynamicDependencyPromises, loadAndResolveDependenciesPromise) {
|
|
@@ -22232,10 +22247,26 @@ class ModuleLoader {
|
|
|
22232
22247
|
this.handleResolveId(await this.resolveId(source, module.id, EMPTY_OBJECT, false), source, module.id))
|
|
22233
22248
|
]);
|
|
22234
22249
|
}
|
|
22250
|
+
getResolvedIdWithDefaults(resolvedId) {
|
|
22251
|
+
var _a, _b;
|
|
22252
|
+
if (!resolvedId) {
|
|
22253
|
+
return null;
|
|
22254
|
+
}
|
|
22255
|
+
const external = resolvedId.external || false;
|
|
22256
|
+
return {
|
|
22257
|
+
external,
|
|
22258
|
+
id: resolvedId.id,
|
|
22259
|
+
meta: resolvedId.meta || {},
|
|
22260
|
+
moduleSideEffects: (_a = resolvedId.moduleSideEffects) !== null && _a !== void 0 ? _a : this.hasModuleSideEffects(resolvedId.id, !!external),
|
|
22261
|
+
syntheticNamedExports: (_b = resolvedId.syntheticNamedExports) !== null && _b !== void 0 ? _b : false
|
|
22262
|
+
};
|
|
22263
|
+
}
|
|
22235
22264
|
async handleExistingModule(module, isEntry, isPreload) {
|
|
22236
22265
|
const loadPromise = this.moduleLoadPromises.get(module);
|
|
22237
22266
|
if (isPreload) {
|
|
22238
|
-
return
|
|
22267
|
+
return isPreload === RESOLVE_DEPENDENCIES
|
|
22268
|
+
? waitForDependencyResolution(loadPromise)
|
|
22269
|
+
: loadPromise;
|
|
22239
22270
|
}
|
|
22240
22271
|
if (isEntry) {
|
|
22241
22272
|
module.info.isEntry = true;
|
|
@@ -22281,7 +22312,7 @@ class ModuleLoader {
|
|
|
22281
22312
|
? errEntryCannotBeExternal(unresolvedId)
|
|
22282
22313
|
: errImplicitDependantCannotBeExternal(unresolvedId, implicitlyLoadedBefore));
|
|
22283
22314
|
}
|
|
22284
|
-
return this.fetchModule(this.
|
|
22315
|
+
return this.fetchModule(this.getResolvedIdWithDefaults(typeof resolveIdResult === 'object'
|
|
22285
22316
|
? resolveIdResult
|
|
22286
22317
|
: { id: resolveIdResult }), undefined, isEntry, false);
|
|
22287
22318
|
}
|
|
@@ -22308,7 +22339,7 @@ class ModuleLoader {
|
|
|
22308
22339
|
module.resolvedIds[specifier] ||
|
|
22309
22340
|
this.handleResolveId(await this.resolveId(specifier, module.id, EMPTY_OBJECT, false), specifier, module.id));
|
|
22310
22341
|
}
|
|
22311
|
-
return this.handleResolveId(this.
|
|
22342
|
+
return this.handleResolveId(this.getResolvedIdWithDefaults(this.getNormalizedResolvedIdWithoutDefaults(resolution, importer, specifier)), specifier, importer);
|
|
22312
22343
|
}
|
|
22313
22344
|
}
|
|
22314
22345
|
function normalizeRelativeExternalId(source, importer) {
|
|
@@ -22336,6 +22367,10 @@ function isNotAbsoluteExternal(id, source, makeAbsoluteExternalsRelative) {
|
|
|
22336
22367
|
(makeAbsoluteExternalsRelative === 'ifRelativeSource' && isRelative(source)) ||
|
|
22337
22368
|
!isAbsolute(id));
|
|
22338
22369
|
}
|
|
22370
|
+
async function waitForDependencyResolution(loadPromise) {
|
|
22371
|
+
const [resolveStaticDependencyPromises, resolveDynamicImportPromises] = await loadPromise;
|
|
22372
|
+
return Promise.all([...resolveStaticDependencyPromises, ...resolveDynamicImportPromises]);
|
|
22373
|
+
}
|
|
22339
22374
|
|
|
22340
22375
|
class GlobalScope extends Scope$1 {
|
|
22341
22376
|
constructor() {
|
|
@@ -22495,6 +22530,7 @@ const inputHookNames = {
|
|
|
22495
22530
|
options: 1,
|
|
22496
22531
|
resolveDynamicImport: 1,
|
|
22497
22532
|
resolveId: 1,
|
|
22533
|
+
shouldTransformCachedModule: 1,
|
|
22498
22534
|
transform: 1,
|
|
22499
22535
|
watchChange: 1
|
|
22500
22536
|
};
|
|
@@ -22909,7 +22945,7 @@ class Graph {
|
|
|
22909
22945
|
for (const module of this.modules) {
|
|
22910
22946
|
for (const importDescription of Object.values(module.importDescriptions)) {
|
|
22911
22947
|
if (importDescription.name !== '*' &&
|
|
22912
|
-
!importDescription.module.getVariableForExportName(importDescription.name)) {
|
|
22948
|
+
!importDescription.module.getVariableForExportName(importDescription.name)[0]) {
|
|
22913
22949
|
module.warn({
|
|
22914
22950
|
code: 'NON_EXISTENT_EXPORT',
|
|
22915
22951
|
message: `Non-existent export '${importDescription.name}' is imported from ${relativeId(importDescription.module.id)}`,
|
|
@@ -23645,9 +23681,8 @@ function defineConfig(options) {
|
|
|
23645
23681
|
let fsEvents;
|
|
23646
23682
|
let fsEventsImportError;
|
|
23647
23683
|
async function loadFsEvents() {
|
|
23648
|
-
const moduleName = 'fsevents';
|
|
23649
23684
|
try {
|
|
23650
|
-
({ default: fsEvents } = await import(
|
|
23685
|
+
({ default: fsEvents } = await import('fsevents'));
|
|
23651
23686
|
}
|
|
23652
23687
|
catch (err) {
|
|
23653
23688
|
fsEventsImportError = err;
|