rollup 2.62.0 → 2.66.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 +82 -1
- package/LICENSE.md +0 -7
- package/dist/bin/rollup +14 -68
- package/dist/es/rollup.browser.js +3 -3
- package/dist/es/rollup.js +4 -2
- package/dist/es/shared/rollup.js +350 -234
- package/dist/es/shared/watch.js +28 -18
- 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 +12 -5
- package/dist/shared/rollup.js +397 -280
- 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
|
-
|
|
3
|
+
Rollup.js v2.66.0
|
|
4
|
+
Sat, 22 Jan 2022 06:33:58 GMT - commit 3ca594eb98846b6bca32a0280931b8356c522e0d
|
|
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.0";
|
|
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();
|
|
@@ -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;
|
|
@@ -8116,6 +8128,8 @@ const ARRAY_PROTOTYPE = new ObjectEntity({
|
|
|
8116
8128
|
filter: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NEW_ARRAY,
|
|
8117
8129
|
find: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN,
|
|
8118
8130
|
findIndex: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NUMBER,
|
|
8131
|
+
findLast: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN,
|
|
8132
|
+
findLastIndex: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NUMBER,
|
|
8119
8133
|
flat: METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY,
|
|
8120
8134
|
flatMap: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NEW_ARRAY,
|
|
8121
8135
|
forEach: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN,
|
|
@@ -12010,24 +12024,7 @@ function getOriginalLocation(sourcemapChain, location) {
|
|
|
12010
12024
|
}
|
|
12011
12025
|
|
|
12012
12026
|
const NOOP = () => { };
|
|
12013
|
-
let
|
|
12014
|
-
let getElapsedTime = () => 0;
|
|
12015
|
-
let getMemory = () => 0;
|
|
12016
|
-
let timers = {};
|
|
12017
|
-
const normalizeHrTime = (time) => time[0] * 1e3 + time[1] / 1e6;
|
|
12018
|
-
function setTimeHelpers() {
|
|
12019
|
-
if (typeof process !== 'undefined' && typeof process.hrtime === 'function') {
|
|
12020
|
-
getStartTime = process.hrtime.bind(process);
|
|
12021
|
-
getElapsedTime = previous => normalizeHrTime(process.hrtime(previous));
|
|
12022
|
-
}
|
|
12023
|
-
else if (typeof performance !== 'undefined' && typeof performance.now === 'function') {
|
|
12024
|
-
getStartTime = () => [performance.now(), 0];
|
|
12025
|
-
getElapsedTime = previous => performance.now() - previous[0];
|
|
12026
|
-
}
|
|
12027
|
-
if (typeof process !== 'undefined' && typeof process.memoryUsage === 'function') {
|
|
12028
|
-
getMemory = () => process.memoryUsage().heapUsed;
|
|
12029
|
-
}
|
|
12030
|
-
}
|
|
12027
|
+
let timers = new Map();
|
|
12031
12028
|
function getPersistedLabel(label, level) {
|
|
12032
12029
|
switch (level) {
|
|
12033
12030
|
case 1:
|
|
@@ -12042,58 +12039,59 @@ function getPersistedLabel(label, level) {
|
|
|
12042
12039
|
}
|
|
12043
12040
|
function timeStartImpl(label, level = 3) {
|
|
12044
12041
|
label = getPersistedLabel(label, level);
|
|
12045
|
-
|
|
12046
|
-
|
|
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, {
|
|
12047
12047
|
memory: 0,
|
|
12048
|
-
startMemory
|
|
12049
|
-
startTime
|
|
12048
|
+
startMemory,
|
|
12049
|
+
startTime,
|
|
12050
12050
|
time: 0,
|
|
12051
12051
|
totalMemory: 0
|
|
12052
|
-
};
|
|
12052
|
+
});
|
|
12053
|
+
}
|
|
12054
|
+
else {
|
|
12055
|
+
timer.startMemory = startMemory;
|
|
12056
|
+
timer.startTime = startTime;
|
|
12053
12057
|
}
|
|
12054
|
-
const currentMemory = getMemory();
|
|
12055
|
-
timers[label].startTime = getStartTime();
|
|
12056
|
-
timers[label].startMemory = currentMemory;
|
|
12057
12058
|
}
|
|
12058
12059
|
function timeEndImpl(label, level = 3) {
|
|
12059
12060
|
label = getPersistedLabel(label, level);
|
|
12060
|
-
|
|
12061
|
-
|
|
12062
|
-
|
|
12063
|
-
|
|
12064
|
-
|
|
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);
|
|
12065
12067
|
}
|
|
12066
12068
|
}
|
|
12067
12069
|
function getTimings() {
|
|
12068
12070
|
const newTimings = {};
|
|
12069
|
-
for (const [label, {
|
|
12071
|
+
for (const [label, { memory, time, totalMemory }] of timers) {
|
|
12070
12072
|
newTimings[label] = [time, memory, totalMemory];
|
|
12071
12073
|
}
|
|
12072
12074
|
return newTimings;
|
|
12073
12075
|
}
|
|
12074
|
-
let timeStart = NOOP
|
|
12075
|
-
|
|
12076
|
-
|
|
12077
|
-
resolveDynamicImport: true,
|
|
12078
|
-
resolveId: true,
|
|
12079
|
-
transform: true
|
|
12080
|
-
};
|
|
12076
|
+
let timeStart = NOOP;
|
|
12077
|
+
let timeEnd = NOOP;
|
|
12078
|
+
const TIMED_PLUGIN_HOOKS = ['load', 'resolveDynamicImport', 'resolveId', 'transform'];
|
|
12081
12079
|
function getPluginWithTimers(plugin, index) {
|
|
12082
|
-
const
|
|
12083
|
-
|
|
12084
|
-
if (TIMED_PLUGIN_HOOKS[hook] === true) {
|
|
12080
|
+
for (const hook of TIMED_PLUGIN_HOOKS) {
|
|
12081
|
+
if (hook in plugin) {
|
|
12085
12082
|
let timerLabel = `plugin ${index}`;
|
|
12086
12083
|
if (plugin.name) {
|
|
12087
12084
|
timerLabel += ` (${plugin.name})`;
|
|
12088
12085
|
}
|
|
12089
12086
|
timerLabel += ` - ${hook}`;
|
|
12090
|
-
|
|
12087
|
+
const func = plugin[hook];
|
|
12088
|
+
plugin[hook] = function (...args) {
|
|
12091
12089
|
timeStart(timerLabel, 4);
|
|
12092
|
-
|
|
12090
|
+
const result = func.apply(this, args);
|
|
12093
12091
|
timeEnd(timerLabel, 4);
|
|
12094
12092
|
if (result && typeof result.then === 'function') {
|
|
12095
12093
|
timeStart(`${timerLabel} (async)`, 4);
|
|
12096
|
-
|
|
12094
|
+
return result.then((hookResult) => {
|
|
12097
12095
|
timeEnd(`${timerLabel} (async)`, 4);
|
|
12098
12096
|
return hookResult;
|
|
12099
12097
|
});
|
|
@@ -12101,16 +12099,12 @@ function getPluginWithTimers(plugin, index) {
|
|
|
12101
12099
|
return result;
|
|
12102
12100
|
};
|
|
12103
12101
|
}
|
|
12104
|
-
else {
|
|
12105
|
-
timedPlugin[hook] = plugin[hook];
|
|
12106
|
-
}
|
|
12107
12102
|
}
|
|
12108
|
-
return
|
|
12103
|
+
return plugin;
|
|
12109
12104
|
}
|
|
12110
12105
|
function initialiseTimers(inputOptions) {
|
|
12111
12106
|
if (inputOptions.perf) {
|
|
12112
|
-
timers =
|
|
12113
|
-
setTimeHelpers();
|
|
12107
|
+
timers = new Map();
|
|
12114
12108
|
timeStart = timeStartImpl;
|
|
12115
12109
|
timeEnd = timeEndImpl;
|
|
12116
12110
|
inputOptions.plugins = inputOptions.plugins.map(getPluginWithTimers);
|
|
@@ -12239,6 +12233,11 @@ class Module {
|
|
|
12239
12233
|
this.info = {
|
|
12240
12234
|
ast: null,
|
|
12241
12235
|
code: null,
|
|
12236
|
+
get dynamicallyImportedIdResolutions() {
|
|
12237
|
+
return module.dynamicImports
|
|
12238
|
+
.map(({ argument }) => typeof argument === 'string' && module.resolvedIds[argument])
|
|
12239
|
+
.filter(Boolean);
|
|
12240
|
+
},
|
|
12242
12241
|
get dynamicallyImportedIds() {
|
|
12243
12242
|
const dynamicallyImportedIds = [];
|
|
12244
12243
|
for (const { id } of module.dynamicImports) {
|
|
@@ -12251,6 +12250,13 @@ class Module {
|
|
|
12251
12250
|
get dynamicImporters() {
|
|
12252
12251
|
return module.dynamicImporters.sort();
|
|
12253
12252
|
},
|
|
12253
|
+
get hasDefaultExport() {
|
|
12254
|
+
// This information is only valid after parsing
|
|
12255
|
+
if (!module.ast) {
|
|
12256
|
+
return null;
|
|
12257
|
+
}
|
|
12258
|
+
return 'default' in module.exports || 'default' in module.reexportDescriptions;
|
|
12259
|
+
},
|
|
12254
12260
|
hasModuleSideEffects,
|
|
12255
12261
|
id,
|
|
12256
12262
|
get implicitlyLoadedAfterOneOf() {
|
|
@@ -12259,6 +12265,9 @@ class Module {
|
|
|
12259
12265
|
get implicitlyLoadedBefore() {
|
|
12260
12266
|
return Array.from(module.implicitlyLoadedBefore, getId).sort();
|
|
12261
12267
|
},
|
|
12268
|
+
get importedIdResolutions() {
|
|
12269
|
+
return Array.from(module.sources, source => module.resolvedIds[source]).filter(Boolean);
|
|
12270
|
+
},
|
|
12262
12271
|
get importedIds() {
|
|
12263
12272
|
return Array.from(module.sources, source => { var _a; return (_a = module.resolvedIds[source]) === null || _a === void 0 ? void 0 : _a.id; }).filter(Boolean);
|
|
12264
12273
|
},
|
|
@@ -12273,7 +12282,7 @@ class Module {
|
|
|
12273
12282
|
}
|
|
12274
12283
|
return module.isIncluded();
|
|
12275
12284
|
},
|
|
12276
|
-
meta,
|
|
12285
|
+
meta: { ...meta },
|
|
12277
12286
|
syntheticNamedExports
|
|
12278
12287
|
};
|
|
12279
12288
|
}
|
|
@@ -12294,7 +12303,7 @@ class Module {
|
|
|
12294
12303
|
return this.allExportNames;
|
|
12295
12304
|
}
|
|
12296
12305
|
const allExportNames = (this.allExportNames = new Set());
|
|
12297
|
-
for (const name of
|
|
12306
|
+
for (const name of this.getExports()) {
|
|
12298
12307
|
allExportNames.add(name);
|
|
12299
12308
|
}
|
|
12300
12309
|
for (const name of Object.keys(this.reexportDescriptions)) {
|
|
@@ -12318,12 +12327,11 @@ class Module {
|
|
|
12318
12327
|
const relevantDependencies = new Set();
|
|
12319
12328
|
const necessaryDependencies = new Set();
|
|
12320
12329
|
const alwaysCheckedDependencies = new Set();
|
|
12321
|
-
|
|
12330
|
+
const dependencyVariables = new Set(this.imports);
|
|
12322
12331
|
if (this.info.isEntry ||
|
|
12323
12332
|
this.includedDynamicImporters.length > 0 ||
|
|
12324
12333
|
this.namespace.included ||
|
|
12325
12334
|
this.implicitlyLoadedAfter.size > 0) {
|
|
12326
|
-
dependencyVariables = new Set(dependencyVariables);
|
|
12327
12335
|
for (const exportName of [...this.getReexports(), ...this.getExports()]) {
|
|
12328
12336
|
const exportedVariable = this.getVariableForExportName(exportName);
|
|
12329
12337
|
if (exportedVariable) {
|
|
@@ -12705,7 +12713,7 @@ class Module {
|
|
|
12705
12713
|
this.info.syntheticNamedExports = syntheticNamedExports;
|
|
12706
12714
|
}
|
|
12707
12715
|
if (meta != null) {
|
|
12708
|
-
|
|
12716
|
+
Object.assign(this.info.meta, meta);
|
|
12709
12717
|
}
|
|
12710
12718
|
}
|
|
12711
12719
|
warn(props, pos) {
|
|
@@ -12796,11 +12804,7 @@ class Module {
|
|
|
12796
12804
|
for (const specifier of node.specifiers) {
|
|
12797
12805
|
const isDefault = specifier.type === ImportDefaultSpecifier$1;
|
|
12798
12806
|
const isNamespace = specifier.type === ImportNamespaceSpecifier$1;
|
|
12799
|
-
const name = isDefault
|
|
12800
|
-
? 'default'
|
|
12801
|
-
: isNamespace
|
|
12802
|
-
? '*'
|
|
12803
|
-
: specifier.imported.name;
|
|
12807
|
+
const name = isDefault ? 'default' : isNamespace ? '*' : specifier.imported.name;
|
|
12804
12808
|
this.importDescriptions[specifier.local.name] = {
|
|
12805
12809
|
module: null,
|
|
12806
12810
|
name,
|
|
@@ -12947,7 +12951,7 @@ class Module {
|
|
|
12947
12951
|
variable.include();
|
|
12948
12952
|
this.graph.needsTreeshakingPass = true;
|
|
12949
12953
|
const variableModule = variable.module;
|
|
12950
|
-
if (variableModule
|
|
12954
|
+
if (variableModule instanceof Module) {
|
|
12951
12955
|
if (!variableModule.isExecuted) {
|
|
12952
12956
|
markModuleAndImpureDependenciesAsExecuted(variableModule);
|
|
12953
12957
|
}
|
|
@@ -14305,6 +14309,7 @@ class Chunk {
|
|
|
14305
14309
|
this.implicitlyLoadedBefore = new Set();
|
|
14306
14310
|
this.imports = new Set();
|
|
14307
14311
|
this.indentString = undefined;
|
|
14312
|
+
// This may only be updated in the constructor
|
|
14308
14313
|
this.isEmpty = true;
|
|
14309
14314
|
this.name = null;
|
|
14310
14315
|
this.renderedDependencies = null;
|
|
@@ -14490,7 +14495,7 @@ class Chunk {
|
|
|
14490
14495
|
}), existingNames);
|
|
14491
14496
|
}
|
|
14492
14497
|
generateIdPreserveModules(preserveModulesRelativeDir, options, existingNames, unsetOptions) {
|
|
14493
|
-
const id = this.orderedModules
|
|
14498
|
+
const [{ id }] = this.orderedModules;
|
|
14494
14499
|
const sanitizedId = this.outputOptions.sanitizeFileName(id);
|
|
14495
14500
|
let path;
|
|
14496
14501
|
const patternOpt = unsetOptions.has('entryFileNames')
|
|
@@ -16065,8 +16070,8 @@ var keywordRelationalOperator = /^in(stanceof)?$/;
|
|
|
16065
16070
|
// are only applied when a character is found to actually have a
|
|
16066
16071
|
// code point above 128.
|
|
16067
16072
|
// Generated by `bin/generate-identifier-regex.js`.
|
|
16068
|
-
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\
|
|
16069
|
-
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\
|
|
16073
|
+
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";
|
|
16074
|
+
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";
|
|
16070
16075
|
|
|
16071
16076
|
var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
|
|
16072
16077
|
var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
|
|
@@ -16080,10 +16085,10 @@ nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
|
|
|
16080
16085
|
// generated by bin/generate-identifier-regex.js
|
|
16081
16086
|
|
|
16082
16087
|
// eslint-disable-next-line comma-spacing
|
|
16083
|
-
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,
|
|
16088
|
+
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];
|
|
16084
16089
|
|
|
16085
16090
|
// eslint-disable-next-line comma-spacing
|
|
16086
|
-
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,
|
|
16091
|
+
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];
|
|
16087
16092
|
|
|
16088
16093
|
// This has a complexity linear to the value of the code. The
|
|
16089
16094
|
// assumption is that looking up astral identifier characters is
|
|
@@ -16288,6 +16293,17 @@ function isNewLine(code) {
|
|
|
16288
16293
|
return code === 10 || code === 13 || code === 0x2028 || code === 0x2029
|
|
16289
16294
|
}
|
|
16290
16295
|
|
|
16296
|
+
function nextLineBreak(code, from, end) {
|
|
16297
|
+
if ( end === void 0 ) end = code.length;
|
|
16298
|
+
|
|
16299
|
+
for (var i = from; i < end; i++) {
|
|
16300
|
+
var next = code.charCodeAt(i);
|
|
16301
|
+
if (isNewLine(next))
|
|
16302
|
+
{ return i < end - 1 && next === 13 && code.charCodeAt(i + 1) === 10 ? i + 2 : i + 1 }
|
|
16303
|
+
}
|
|
16304
|
+
return -1
|
|
16305
|
+
}
|
|
16306
|
+
|
|
16291
16307
|
var nonASCIIwhitespace = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/;
|
|
16292
16308
|
|
|
16293
16309
|
var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;
|
|
@@ -16296,11 +16312,9 @@ var ref = Object.prototype;
|
|
|
16296
16312
|
var hasOwnProperty = ref.hasOwnProperty;
|
|
16297
16313
|
var toString = ref.toString;
|
|
16298
16314
|
|
|
16299
|
-
|
|
16300
|
-
|
|
16301
|
-
|
|
16302
|
-
return hasOwnProperty.call(obj, propName)
|
|
16303
|
-
}
|
|
16315
|
+
var hasOwn = Object.hasOwn || (function (obj, propName) { return (
|
|
16316
|
+
hasOwnProperty.call(obj, propName)
|
|
16317
|
+
); });
|
|
16304
16318
|
|
|
16305
16319
|
var isArray = Array.isArray || (function (obj) { return (
|
|
16306
16320
|
toString.call(obj) === "[object Array]"
|
|
@@ -16310,6 +16324,8 @@ function wordsRegexp(words) {
|
|
|
16310
16324
|
return new RegExp("^(?:" + words.replace(/ /g, "|") + ")$")
|
|
16311
16325
|
}
|
|
16312
16326
|
|
|
16327
|
+
var loneSurrogate = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/;
|
|
16328
|
+
|
|
16313
16329
|
// These are used when `options.locations` is on, for the
|
|
16314
16330
|
// `startLoc` and `endLoc` properties.
|
|
16315
16331
|
|
|
@@ -16336,14 +16352,10 @@ var SourceLocation = function SourceLocation(p, start, end) {
|
|
|
16336
16352
|
|
|
16337
16353
|
function getLineInfo(input, offset) {
|
|
16338
16354
|
for (var line = 1, cur = 0;;) {
|
|
16339
|
-
|
|
16340
|
-
|
|
16341
|
-
|
|
16342
|
-
|
|
16343
|
-
cur = match.index + match[0].length;
|
|
16344
|
-
} else {
|
|
16345
|
-
return new Position(line, offset - cur)
|
|
16346
|
-
}
|
|
16355
|
+
var nextBreak = nextLineBreak(input, cur, offset);
|
|
16356
|
+
if (nextBreak < 0) { return new Position(line, offset - cur) }
|
|
16357
|
+
++line;
|
|
16358
|
+
cur = nextBreak;
|
|
16347
16359
|
}
|
|
16348
16360
|
}
|
|
16349
16361
|
|
|
@@ -16449,7 +16461,7 @@ function getOptions(opts) {
|
|
|
16449
16461
|
var options = {};
|
|
16450
16462
|
|
|
16451
16463
|
for (var opt in defaultOptions)
|
|
16452
|
-
{ options[opt] = opts &&
|
|
16464
|
+
{ options[opt] = opts && hasOwn(opts, opt) ? opts[opt] : defaultOptions[opt]; }
|
|
16453
16465
|
|
|
16454
16466
|
if (options.ecmaVersion === "latest") {
|
|
16455
16467
|
options.ecmaVersion = 1e8;
|
|
@@ -17615,7 +17627,7 @@ pp$8.exitClassBody = function() {
|
|
|
17615
17627
|
var parent = len === 0 ? null : this.privateNameStack[len - 1];
|
|
17616
17628
|
for (var i = 0; i < used.length; ++i) {
|
|
17617
17629
|
var id = used[i];
|
|
17618
|
-
if (!
|
|
17630
|
+
if (!hasOwn(declared, id.name)) {
|
|
17619
17631
|
if (parent) {
|
|
17620
17632
|
parent.used.push(id);
|
|
17621
17633
|
} else {
|
|
@@ -17668,7 +17680,7 @@ pp$8.parseExport = function(node, exports) {
|
|
|
17668
17680
|
if (this.eat(types$1.star)) {
|
|
17669
17681
|
if (this.options.ecmaVersion >= 11) {
|
|
17670
17682
|
if (this.eatContextual("as")) {
|
|
17671
|
-
node.exported = this.
|
|
17683
|
+
node.exported = this.parseModuleExportName();
|
|
17672
17684
|
this.checkExport(exports, node.exported.name, this.lastTokStart);
|
|
17673
17685
|
} else {
|
|
17674
17686
|
node.exported = null;
|
|
@@ -17720,6 +17732,10 @@ pp$8.parseExport = function(node, exports) {
|
|
|
17720
17732
|
this.checkUnreserved(spec.local);
|
|
17721
17733
|
// check if export is defined
|
|
17722
17734
|
this.checkLocalExport(spec.local);
|
|
17735
|
+
|
|
17736
|
+
if (spec.local.type === "Literal") {
|
|
17737
|
+
this.raise(spec.local.start, "A string literal cannot be used as an exported binding without `from`.");
|
|
17738
|
+
}
|
|
17723
17739
|
}
|
|
17724
17740
|
|
|
17725
17741
|
node.source = null;
|
|
@@ -17731,7 +17747,7 @@ pp$8.parseExport = function(node, exports) {
|
|
|
17731
17747
|
|
|
17732
17748
|
pp$8.checkExport = function(exports, name, pos) {
|
|
17733
17749
|
if (!exports) { return }
|
|
17734
|
-
if (
|
|
17750
|
+
if (hasOwn(exports, name))
|
|
17735
17751
|
{ this.raiseRecoverable(pos, "Duplicate export '" + name + "'"); }
|
|
17736
17752
|
exports[name] = true;
|
|
17737
17753
|
};
|
|
@@ -17795,9 +17811,13 @@ pp$8.parseExportSpecifiers = function(exports) {
|
|
|
17795
17811
|
} else { first = false; }
|
|
17796
17812
|
|
|
17797
17813
|
var node = this.startNode();
|
|
17798
|
-
node.local = this.
|
|
17799
|
-
node.exported = this.eatContextual("as") ? this.
|
|
17800
|
-
this.checkExport(
|
|
17814
|
+
node.local = this.parseModuleExportName();
|
|
17815
|
+
node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local;
|
|
17816
|
+
this.checkExport(
|
|
17817
|
+
exports,
|
|
17818
|
+
node.exported[node.exported.type === "Identifier" ? "name" : "value"],
|
|
17819
|
+
node.exported.start
|
|
17820
|
+
);
|
|
17801
17821
|
nodes.push(this.finishNode(node, "ExportSpecifier"));
|
|
17802
17822
|
}
|
|
17803
17823
|
return nodes
|
|
@@ -17849,7 +17869,7 @@ pp$8.parseImportSpecifiers = function() {
|
|
|
17849
17869
|
} else { first = false; }
|
|
17850
17870
|
|
|
17851
17871
|
var node$2 = this.startNode();
|
|
17852
|
-
node$2.imported = this.
|
|
17872
|
+
node$2.imported = this.parseModuleExportName();
|
|
17853
17873
|
if (this.eatContextual("as")) {
|
|
17854
17874
|
node$2.local = this.parseIdent();
|
|
17855
17875
|
} else {
|
|
@@ -17862,6 +17882,17 @@ pp$8.parseImportSpecifiers = function() {
|
|
|
17862
17882
|
return nodes
|
|
17863
17883
|
};
|
|
17864
17884
|
|
|
17885
|
+
pp$8.parseModuleExportName = function() {
|
|
17886
|
+
if (this.options.ecmaVersion >= 13 && this.type === types$1.string) {
|
|
17887
|
+
var stringLiteral = this.parseLiteral(this.value);
|
|
17888
|
+
if (loneSurrogate.test(stringLiteral.value)) {
|
|
17889
|
+
this.raise(stringLiteral.start, "An export name cannot include a lone surrogate.");
|
|
17890
|
+
}
|
|
17891
|
+
return stringLiteral
|
|
17892
|
+
}
|
|
17893
|
+
return this.parseIdent(true)
|
|
17894
|
+
};
|
|
17895
|
+
|
|
17865
17896
|
// Set `ExpressionStatement#directive` property for directive prologues.
|
|
17866
17897
|
pp$8.adaptDirectivePrologue = function(statements) {
|
|
17867
17898
|
for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) {
|
|
@@ -18135,7 +18166,7 @@ pp$7.checkLValSimple = function(expr, bindingType, checkClashes) {
|
|
|
18135
18166
|
if (bindingType === BIND_LEXICAL && expr.name === "let")
|
|
18136
18167
|
{ this.raiseRecoverable(expr.start, "let is disallowed as a lexically bound name"); }
|
|
18137
18168
|
if (checkClashes) {
|
|
18138
|
-
if (
|
|
18169
|
+
if (hasOwn(checkClashes, expr.name))
|
|
18139
18170
|
{ this.raiseRecoverable(expr.start, "Argument name clash"); }
|
|
18140
18171
|
checkClashes[expr.name] = true;
|
|
18141
18172
|
}
|
|
@@ -19630,26 +19661,30 @@ var ecma9BinaryProperties = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Ass
|
|
|
19630
19661
|
var ecma10BinaryProperties = ecma9BinaryProperties + " Extended_Pictographic";
|
|
19631
19662
|
var ecma11BinaryProperties = ecma10BinaryProperties;
|
|
19632
19663
|
var ecma12BinaryProperties = ecma11BinaryProperties + " EBase EComp EMod EPres ExtPict";
|
|
19664
|
+
var ecma13BinaryProperties = ecma12BinaryProperties;
|
|
19633
19665
|
var unicodeBinaryProperties = {
|
|
19634
19666
|
9: ecma9BinaryProperties,
|
|
19635
19667
|
10: ecma10BinaryProperties,
|
|
19636
19668
|
11: ecma11BinaryProperties,
|
|
19637
|
-
12: ecma12BinaryProperties
|
|
19669
|
+
12: ecma12BinaryProperties,
|
|
19670
|
+
13: ecma13BinaryProperties
|
|
19638
19671
|
};
|
|
19639
19672
|
|
|
19640
19673
|
// #table-unicode-general-category-values
|
|
19641
19674
|
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";
|
|
19642
19675
|
|
|
19643
19676
|
// #table-unicode-script-values
|
|
19644
|
-
var ecma9ScriptValues = "Adlam Adlm Ahom
|
|
19677
|
+
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";
|
|
19645
19678
|
var ecma10ScriptValues = ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd";
|
|
19646
19679
|
var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho";
|
|
19647
19680
|
var ecma12ScriptValues = ecma11ScriptValues + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi";
|
|
19681
|
+
var ecma13ScriptValues = ecma12ScriptValues + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith";
|
|
19648
19682
|
var unicodeScriptValues = {
|
|
19649
19683
|
9: ecma9ScriptValues,
|
|
19650
19684
|
10: ecma10ScriptValues,
|
|
19651
19685
|
11: ecma11ScriptValues,
|
|
19652
|
-
12: ecma12ScriptValues
|
|
19686
|
+
12: ecma12ScriptValues,
|
|
19687
|
+
13: ecma13ScriptValues
|
|
19653
19688
|
};
|
|
19654
19689
|
|
|
19655
19690
|
var data = {};
|
|
@@ -19667,17 +19702,19 @@ function buildUnicodeData(ecmaVersion) {
|
|
|
19667
19702
|
d.nonBinary.sc = d.nonBinary.Script;
|
|
19668
19703
|
d.nonBinary.scx = d.nonBinary.Script_Extensions;
|
|
19669
19704
|
}
|
|
19670
|
-
|
|
19671
|
-
|
|
19672
|
-
|
|
19673
|
-
|
|
19705
|
+
|
|
19706
|
+
for (var i = 0, list = [9, 10, 11, 12, 13]; i < list.length; i += 1) {
|
|
19707
|
+
var ecmaVersion = list[i];
|
|
19708
|
+
|
|
19709
|
+
buildUnicodeData(ecmaVersion);
|
|
19710
|
+
}
|
|
19674
19711
|
|
|
19675
19712
|
var pp$1 = Parser.prototype;
|
|
19676
19713
|
|
|
19677
19714
|
var RegExpValidationState = function RegExpValidationState(parser) {
|
|
19678
19715
|
this.parser = parser;
|
|
19679
19716
|
this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "") + (parser.options.ecmaVersion >= 13 ? "d" : "");
|
|
19680
|
-
this.unicodeProperties = data[parser.options.ecmaVersion >=
|
|
19717
|
+
this.unicodeProperties = data[parser.options.ecmaVersion >= 13 ? 13 : parser.options.ecmaVersion];
|
|
19681
19718
|
this.source = "";
|
|
19682
19719
|
this.flags = "";
|
|
19683
19720
|
this.start = 0;
|
|
@@ -20476,7 +20513,7 @@ pp$1.regexp_eatUnicodePropertyValueExpression = function(state) {
|
|
|
20476
20513
|
return false
|
|
20477
20514
|
};
|
|
20478
20515
|
pp$1.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) {
|
|
20479
|
-
if (!
|
|
20516
|
+
if (!hasOwn(state.unicodeProperties.nonBinary, name))
|
|
20480
20517
|
{ state.raise("Invalid property name"); }
|
|
20481
20518
|
if (!state.unicodeProperties.nonBinary[name].test(value))
|
|
20482
20519
|
{ state.raise("Invalid property value"); }
|
|
@@ -20828,11 +20865,9 @@ pp.skipBlockComment = function() {
|
|
|
20828
20865
|
if (end === -1) { this.raise(this.pos - 2, "Unterminated comment"); }
|
|
20829
20866
|
this.pos = end + 2;
|
|
20830
20867
|
if (this.options.locations) {
|
|
20831
|
-
|
|
20832
|
-
var match;
|
|
20833
|
-
while ((match = lineBreakG.exec(this.input)) && match.index < this.pos) {
|
|
20868
|
+
for (var nextBreak = (void 0), pos = start; (nextBreak = nextLineBreak(this.input, pos, this.pos)) > -1;) {
|
|
20834
20869
|
++this.curLine;
|
|
20835
|
-
this.lineStart =
|
|
20870
|
+
pos = this.lineStart = nextBreak;
|
|
20836
20871
|
}
|
|
20837
20872
|
}
|
|
20838
20873
|
if (this.options.onComment)
|
|
@@ -21543,7 +21578,7 @@ pp.readWord = function() {
|
|
|
21543
21578
|
|
|
21544
21579
|
// Acorn is a tiny, fast JavaScript parser written in JavaScript.
|
|
21545
21580
|
|
|
21546
|
-
var version = "8.
|
|
21581
|
+
var version = "8.7.0";
|
|
21547
21582
|
|
|
21548
21583
|
Parser.acorn = {
|
|
21549
21584
|
Parser: Parser,
|
|
@@ -21587,9 +21622,9 @@ function writeFile(dest, data) {
|
|
|
21587
21622
|
}
|
|
21588
21623
|
|
|
21589
21624
|
class Queue {
|
|
21590
|
-
constructor(maxParallel
|
|
21625
|
+
constructor(maxParallel) {
|
|
21591
21626
|
this.maxParallel = maxParallel;
|
|
21592
|
-
this.queue =
|
|
21627
|
+
this.queue = [];
|
|
21593
21628
|
this.workerCount = 0;
|
|
21594
21629
|
}
|
|
21595
21630
|
run(task) {
|
|
@@ -21799,7 +21834,7 @@ function getCacheForUncacheablePlugin(pluginName) {
|
|
|
21799
21834
|
};
|
|
21800
21835
|
}
|
|
21801
21836
|
|
|
21802
|
-
function transform(source, module, pluginDriver, warn) {
|
|
21837
|
+
async function transform(source, module, pluginDriver, warn) {
|
|
21803
21838
|
const id = module.id;
|
|
21804
21839
|
const sourcemapChain = [];
|
|
21805
21840
|
let originalSourcemap = source.map === null ? null : decodedSourcemap(source.map);
|
|
@@ -21809,7 +21844,7 @@ function transform(source, module, pluginDriver, warn) {
|
|
|
21809
21844
|
const emittedFiles = [];
|
|
21810
21845
|
let customTransformCache = false;
|
|
21811
21846
|
const useCustomTransformCache = () => (customTransformCache = true);
|
|
21812
|
-
let
|
|
21847
|
+
let pluginName = '';
|
|
21813
21848
|
const curSource = source.code;
|
|
21814
21849
|
function transformReducer(previousCode, result, plugin) {
|
|
21815
21850
|
let code;
|
|
@@ -21840,92 +21875,94 @@ function transform(source, module, pluginDriver, warn) {
|
|
|
21840
21875
|
}
|
|
21841
21876
|
return code;
|
|
21842
21877
|
}
|
|
21843
|
-
|
|
21844
|
-
|
|
21845
|
-
|
|
21846
|
-
|
|
21847
|
-
|
|
21848
|
-
|
|
21849
|
-
|
|
21850
|
-
|
|
21851
|
-
|
|
21852
|
-
|
|
21853
|
-
|
|
21854
|
-
|
|
21855
|
-
|
|
21856
|
-
|
|
21857
|
-
|
|
21858
|
-
|
|
21859
|
-
|
|
21860
|
-
|
|
21861
|
-
|
|
21862
|
-
|
|
21863
|
-
|
|
21864
|
-
|
|
21865
|
-
|
|
21866
|
-
|
|
21867
|
-
|
|
21868
|
-
|
|
21869
|
-
|
|
21870
|
-
|
|
21871
|
-
|
|
21872
|
-
|
|
21873
|
-
|
|
21874
|
-
|
|
21875
|
-
|
|
21876
|
-
|
|
21877
|
-
|
|
21878
|
-
|
|
21879
|
-
|
|
21880
|
-
|
|
21881
|
-
|
|
21882
|
-
|
|
21883
|
-
originalSourcemap
|
|
21884
|
-
|
|
21878
|
+
let code;
|
|
21879
|
+
try {
|
|
21880
|
+
code = await pluginDriver.hookReduceArg0('transform', [curSource, id], transformReducer, (pluginContext, plugin) => {
|
|
21881
|
+
pluginName = plugin.name;
|
|
21882
|
+
return {
|
|
21883
|
+
...pluginContext,
|
|
21884
|
+
addWatchFile(id) {
|
|
21885
|
+
transformDependencies.push(id);
|
|
21886
|
+
pluginContext.addWatchFile(id);
|
|
21887
|
+
},
|
|
21888
|
+
cache: customTransformCache
|
|
21889
|
+
? pluginContext.cache
|
|
21890
|
+
: getTrackedPluginCache(pluginContext.cache, useCustomTransformCache),
|
|
21891
|
+
emitAsset(name, source) {
|
|
21892
|
+
emittedFiles.push({ name, source, type: 'asset' });
|
|
21893
|
+
return pluginContext.emitAsset(name, source);
|
|
21894
|
+
},
|
|
21895
|
+
emitChunk(id, options) {
|
|
21896
|
+
emittedFiles.push({ id, name: options && options.name, type: 'chunk' });
|
|
21897
|
+
return pluginContext.emitChunk(id, options);
|
|
21898
|
+
},
|
|
21899
|
+
emitFile(emittedFile) {
|
|
21900
|
+
emittedFiles.push(emittedFile);
|
|
21901
|
+
return pluginDriver.emitFile(emittedFile);
|
|
21902
|
+
},
|
|
21903
|
+
error(err, pos) {
|
|
21904
|
+
if (typeof err === 'string')
|
|
21905
|
+
err = { message: err };
|
|
21906
|
+
if (pos)
|
|
21907
|
+
augmentCodeLocation(err, pos, curSource, id);
|
|
21908
|
+
err.id = id;
|
|
21909
|
+
err.hook = 'transform';
|
|
21910
|
+
return pluginContext.error(err);
|
|
21911
|
+
},
|
|
21912
|
+
getCombinedSourcemap() {
|
|
21913
|
+
const combinedMap = collapseSourcemap(id, originalCode, originalSourcemap, sourcemapChain, warn);
|
|
21914
|
+
if (!combinedMap) {
|
|
21915
|
+
const magicString = new MagicString$1(originalCode);
|
|
21916
|
+
return magicString.generateMap({ hires: true, includeContent: true, source: id });
|
|
21917
|
+
}
|
|
21918
|
+
if (originalSourcemap !== combinedMap) {
|
|
21919
|
+
originalSourcemap = combinedMap;
|
|
21920
|
+
sourcemapChain.length = 0;
|
|
21921
|
+
}
|
|
21922
|
+
return new SourceMap({
|
|
21923
|
+
...combinedMap,
|
|
21924
|
+
file: null,
|
|
21925
|
+
sourcesContent: combinedMap.sourcesContent
|
|
21926
|
+
});
|
|
21927
|
+
},
|
|
21928
|
+
setAssetSource() {
|
|
21929
|
+
return this.error({
|
|
21930
|
+
code: 'INVALID_SETASSETSOURCE',
|
|
21931
|
+
message: `setAssetSource cannot be called in transform for caching reasons. Use emitFile with a source, or call setAssetSource in another hook.`
|
|
21932
|
+
});
|
|
21933
|
+
},
|
|
21934
|
+
warn(warning, pos) {
|
|
21935
|
+
if (typeof warning === 'string')
|
|
21936
|
+
warning = { message: warning };
|
|
21937
|
+
if (pos)
|
|
21938
|
+
augmentCodeLocation(warning, pos, curSource, id);
|
|
21939
|
+
warning.id = id;
|
|
21940
|
+
warning.hook = 'transform';
|
|
21941
|
+
pluginContext.warn(warning);
|
|
21885
21942
|
}
|
|
21886
|
-
|
|
21887
|
-
|
|
21888
|
-
|
|
21889
|
-
|
|
21890
|
-
|
|
21891
|
-
|
|
21892
|
-
|
|
21893
|
-
|
|
21894
|
-
|
|
21895
|
-
|
|
21896
|
-
|
|
21897
|
-
|
|
21898
|
-
|
|
21899
|
-
|
|
21900
|
-
|
|
21901
|
-
|
|
21902
|
-
|
|
21903
|
-
|
|
21904
|
-
|
|
21905
|
-
|
|
21906
|
-
}
|
|
21907
|
-
};
|
|
21908
|
-
})
|
|
21909
|
-
.catch(err => throwPluginError(err, curPlugin.name, { hook: 'transform', id }))
|
|
21910
|
-
.then(code => {
|
|
21911
|
-
if (!customTransformCache) {
|
|
21912
|
-
// files emitted by a transform hook need to be emitted again if the hook is skipped
|
|
21913
|
-
if (emittedFiles.length)
|
|
21914
|
-
module.transformFiles = emittedFiles;
|
|
21915
|
-
}
|
|
21916
|
-
return {
|
|
21917
|
-
ast,
|
|
21918
|
-
code,
|
|
21919
|
-
customTransformCache,
|
|
21920
|
-
meta: module.info.meta,
|
|
21921
|
-
originalCode,
|
|
21922
|
-
originalSourcemap,
|
|
21923
|
-
sourcemapChain,
|
|
21924
|
-
transformDependencies
|
|
21925
|
-
};
|
|
21926
|
-
});
|
|
21943
|
+
};
|
|
21944
|
+
});
|
|
21945
|
+
}
|
|
21946
|
+
catch (err) {
|
|
21947
|
+
throwPluginError(err, pluginName, { hook: 'transform', id });
|
|
21948
|
+
}
|
|
21949
|
+
if (!customTransformCache) {
|
|
21950
|
+
// files emitted by a transform hook need to be emitted again if the hook is skipped
|
|
21951
|
+
if (emittedFiles.length)
|
|
21952
|
+
module.transformFiles = emittedFiles;
|
|
21953
|
+
}
|
|
21954
|
+
return {
|
|
21955
|
+
ast,
|
|
21956
|
+
code,
|
|
21957
|
+
customTransformCache,
|
|
21958
|
+
originalCode,
|
|
21959
|
+
originalSourcemap,
|
|
21960
|
+
sourcemapChain,
|
|
21961
|
+
transformDependencies
|
|
21962
|
+
};
|
|
21927
21963
|
}
|
|
21928
21964
|
|
|
21965
|
+
const RESOLVE_DEPENDENCIES = 'resolveDependencies';
|
|
21929
21966
|
class ModuleLoader {
|
|
21930
21967
|
constructor(graph, modulesById, options, pluginDriver) {
|
|
21931
21968
|
this.graph = graph;
|
|
@@ -21938,16 +21975,15 @@ class ModuleLoader {
|
|
|
21938
21975
|
this.moduleLoadPromises = new Map();
|
|
21939
21976
|
this.modulesWithLoadedDependencies = new Set();
|
|
21940
21977
|
this.nextEntryModuleIndex = 0;
|
|
21941
|
-
this.readQueue = new Queue();
|
|
21942
21978
|
this.resolveId = async (source, importer, customOptions, isEntry, skip = null) => {
|
|
21943
|
-
return this.
|
|
21979
|
+
return this.getResolvedIdWithDefaults(this.getNormalizedResolvedIdWithoutDefaults(this.options.external(source, importer, false)
|
|
21944
21980
|
? false
|
|
21945
21981
|
: await resolveId(source, importer, this.options.preserveSymlinks, this.pluginDriver, this.resolveId, skip, customOptions, typeof isEntry === 'boolean' ? isEntry : !importer), importer, source));
|
|
21946
21982
|
};
|
|
21947
21983
|
this.hasModuleSideEffects = options.treeshake
|
|
21948
21984
|
? options.treeshake.moduleSideEffects
|
|
21949
21985
|
: () => true;
|
|
21950
|
-
this.readQueue
|
|
21986
|
+
this.readQueue = new Queue(options.maxParallelFileReads);
|
|
21951
21987
|
}
|
|
21952
21988
|
async addAdditionalModules(unresolvedModules) {
|
|
21953
21989
|
const result = this.extendLoadModulesPromise(Promise.all(unresolvedModules.map(id => this.loadEntryModule(id, false, undefined, null))));
|
|
@@ -21998,22 +22034,9 @@ class ModuleLoader {
|
|
|
21998
22034
|
}
|
|
21999
22035
|
return module;
|
|
22000
22036
|
}
|
|
22001
|
-
preloadModule(resolvedId) {
|
|
22002
|
-
|
|
22003
|
-
|
|
22004
|
-
addDefaultsToResolvedId(resolvedId) {
|
|
22005
|
-
var _a, _b;
|
|
22006
|
-
if (!resolvedId) {
|
|
22007
|
-
return null;
|
|
22008
|
-
}
|
|
22009
|
-
const external = resolvedId.external || false;
|
|
22010
|
-
return {
|
|
22011
|
-
external,
|
|
22012
|
-
id: resolvedId.id,
|
|
22013
|
-
meta: resolvedId.meta || EMPTY_OBJECT,
|
|
22014
|
-
moduleSideEffects: (_a = resolvedId.moduleSideEffects) !== null && _a !== void 0 ? _a : this.hasModuleSideEffects(resolvedId.id, !!external),
|
|
22015
|
-
syntheticNamedExports: (_b = resolvedId.syntheticNamedExports) !== null && _b !== void 0 ? _b : false
|
|
22016
|
-
};
|
|
22037
|
+
async preloadModule(resolvedId) {
|
|
22038
|
+
const module = await this.fetchModule(this.getResolvedIdWithDefaults(resolvedId), undefined, false, resolvedId.resolveDependencies ? RESOLVE_DEPENDENCIES : true);
|
|
22039
|
+
return module.info;
|
|
22017
22040
|
}
|
|
22018
22041
|
addEntryWithImplicitDependants(unresolvedModule, implicitlyLoadedAfter) {
|
|
22019
22042
|
return this.extendLoadModulesPromise(this.loadEntryModule(unresolvedModule.id, false, unresolvedModule.importer, null).then(async (entryModule) => {
|
|
@@ -22049,13 +22072,23 @@ class ModuleLoader {
|
|
|
22049
22072
|
timeEnd('load modules', 3);
|
|
22050
22073
|
const sourceDescription = typeof source === 'string'
|
|
22051
22074
|
? { code: source }
|
|
22052
|
-
: typeof source === 'object' && typeof source.code === 'string'
|
|
22075
|
+
: source != null && typeof source === 'object' && typeof source.code === 'string'
|
|
22053
22076
|
? source
|
|
22054
22077
|
: error(errBadLoader(id));
|
|
22055
22078
|
const cachedModule = this.graph.cachedModules.get(id);
|
|
22056
22079
|
if (cachedModule &&
|
|
22057
22080
|
!cachedModule.customTransformCache &&
|
|
22058
|
-
cachedModule.originalCode === sourceDescription.code
|
|
22081
|
+
cachedModule.originalCode === sourceDescription.code &&
|
|
22082
|
+
!(await this.pluginDriver.hookFirst('shouldTransformCachedModule', [
|
|
22083
|
+
{
|
|
22084
|
+
ast: cachedModule.ast,
|
|
22085
|
+
code: cachedModule.code,
|
|
22086
|
+
id: cachedModule.id,
|
|
22087
|
+
meta: cachedModule.meta,
|
|
22088
|
+
moduleSideEffects: cachedModule.moduleSideEffects,
|
|
22089
|
+
syntheticNamedExports: cachedModule.syntheticNamedExports
|
|
22090
|
+
}
|
|
22091
|
+
]))) {
|
|
22059
22092
|
if (cachedModule.transformFiles) {
|
|
22060
22093
|
for (const emittedFile of cachedModule.transformFiles)
|
|
22061
22094
|
this.pluginDriver.emitFile(emittedFile);
|
|
@@ -22118,9 +22151,7 @@ class ModuleLoader {
|
|
|
22118
22151
|
this.getResolveDynamicImportPromises(module),
|
|
22119
22152
|
loadAndResolveDependenciesPromise
|
|
22120
22153
|
]);
|
|
22121
|
-
const loadAndResolveDependenciesPromise = loadPromise
|
|
22122
|
-
.then(([resolveStaticDependencyPromises, resolveDynamicImportPromises]) => Promise.all([...resolveStaticDependencyPromises, ...resolveDynamicImportPromises]))
|
|
22123
|
-
.then(() => this.pluginDriver.hookParallel('moduleParsed', [module.info]));
|
|
22154
|
+
const loadAndResolveDependenciesPromise = waitForDependencyResolution(loadPromise).then(() => this.pluginDriver.hookParallel('moduleParsed', [module.info]));
|
|
22124
22155
|
loadAndResolveDependenciesPromise.catch(() => {
|
|
22125
22156
|
/* avoid unhandled promise rejections */
|
|
22126
22157
|
});
|
|
@@ -22129,6 +22160,9 @@ class ModuleLoader {
|
|
|
22129
22160
|
if (!isPreload) {
|
|
22130
22161
|
await this.fetchModuleDependencies(module, ...resolveDependencyPromises);
|
|
22131
22162
|
}
|
|
22163
|
+
else if (isPreload === RESOLVE_DEPENDENCIES) {
|
|
22164
|
+
await loadAndResolveDependenciesPromise;
|
|
22165
|
+
}
|
|
22132
22166
|
return module;
|
|
22133
22167
|
}
|
|
22134
22168
|
async fetchModuleDependencies(module, resolveStaticDependencyPromises, resolveDynamicDependencyPromises, loadAndResolveDependenciesPromise) {
|
|
@@ -22228,10 +22262,26 @@ class ModuleLoader {
|
|
|
22228
22262
|
this.handleResolveId(await this.resolveId(source, module.id, EMPTY_OBJECT, false), source, module.id))
|
|
22229
22263
|
]);
|
|
22230
22264
|
}
|
|
22265
|
+
getResolvedIdWithDefaults(resolvedId) {
|
|
22266
|
+
var _a, _b;
|
|
22267
|
+
if (!resolvedId) {
|
|
22268
|
+
return null;
|
|
22269
|
+
}
|
|
22270
|
+
const external = resolvedId.external || false;
|
|
22271
|
+
return {
|
|
22272
|
+
external,
|
|
22273
|
+
id: resolvedId.id,
|
|
22274
|
+
meta: resolvedId.meta || {},
|
|
22275
|
+
moduleSideEffects: (_a = resolvedId.moduleSideEffects) !== null && _a !== void 0 ? _a : this.hasModuleSideEffects(resolvedId.id, !!external),
|
|
22276
|
+
syntheticNamedExports: (_b = resolvedId.syntheticNamedExports) !== null && _b !== void 0 ? _b : false
|
|
22277
|
+
};
|
|
22278
|
+
}
|
|
22231
22279
|
async handleExistingModule(module, isEntry, isPreload) {
|
|
22232
22280
|
const loadPromise = this.moduleLoadPromises.get(module);
|
|
22233
22281
|
if (isPreload) {
|
|
22234
|
-
return
|
|
22282
|
+
return isPreload === RESOLVE_DEPENDENCIES
|
|
22283
|
+
? waitForDependencyResolution(loadPromise)
|
|
22284
|
+
: loadPromise;
|
|
22235
22285
|
}
|
|
22236
22286
|
if (isEntry) {
|
|
22237
22287
|
module.info.isEntry = true;
|
|
@@ -22252,7 +22302,7 @@ class ModuleLoader {
|
|
|
22252
22302
|
return {
|
|
22253
22303
|
external: true,
|
|
22254
22304
|
id: source,
|
|
22255
|
-
meta:
|
|
22305
|
+
meta: {},
|
|
22256
22306
|
moduleSideEffects: this.hasModuleSideEffects(source, true),
|
|
22257
22307
|
syntheticNamedExports: false
|
|
22258
22308
|
};
|
|
@@ -22277,7 +22327,7 @@ class ModuleLoader {
|
|
|
22277
22327
|
? errEntryCannotBeExternal(unresolvedId)
|
|
22278
22328
|
: errImplicitDependantCannotBeExternal(unresolvedId, implicitlyLoadedBefore));
|
|
22279
22329
|
}
|
|
22280
|
-
return this.fetchModule(this.
|
|
22330
|
+
return this.fetchModule(this.getResolvedIdWithDefaults(typeof resolveIdResult === 'object'
|
|
22281
22331
|
? resolveIdResult
|
|
22282
22332
|
: { id: resolveIdResult }), undefined, isEntry, false);
|
|
22283
22333
|
}
|
|
@@ -22304,7 +22354,7 @@ class ModuleLoader {
|
|
|
22304
22354
|
module.resolvedIds[specifier] ||
|
|
22305
22355
|
this.handleResolveId(await this.resolveId(specifier, module.id, EMPTY_OBJECT, false), specifier, module.id));
|
|
22306
22356
|
}
|
|
22307
|
-
return this.handleResolveId(this.
|
|
22357
|
+
return this.handleResolveId(this.getResolvedIdWithDefaults(this.getNormalizedResolvedIdWithoutDefaults(resolution, importer, specifier)), specifier, importer);
|
|
22308
22358
|
}
|
|
22309
22359
|
}
|
|
22310
22360
|
function normalizeRelativeExternalId(source, importer) {
|
|
@@ -22332,6 +22382,10 @@ function isNotAbsoluteExternal(id, source, makeAbsoluteExternalsRelative) {
|
|
|
22332
22382
|
(makeAbsoluteExternalsRelative === 'ifRelativeSource' && isRelative(source)) ||
|
|
22333
22383
|
!isAbsolute(id));
|
|
22334
22384
|
}
|
|
22385
|
+
async function waitForDependencyResolution(loadPromise) {
|
|
22386
|
+
const [resolveStaticDependencyPromises, resolveDynamicImportPromises] = await loadPromise;
|
|
22387
|
+
return Promise.all([...resolveStaticDependencyPromises, ...resolveDynamicImportPromises]);
|
|
22388
|
+
}
|
|
22335
22389
|
|
|
22336
22390
|
class GlobalScope extends Scope$1 {
|
|
22337
22391
|
constructor() {
|
|
@@ -22447,6 +22501,40 @@ function getPluginContext(plugin, pluginCache, graph, options, fileEmitter, exis
|
|
|
22447
22501
|
return context;
|
|
22448
22502
|
}
|
|
22449
22503
|
|
|
22504
|
+
const unfulfilledActions = new Set();
|
|
22505
|
+
function addUnresolvedAction(actionTuple) {
|
|
22506
|
+
unfulfilledActions.add(actionTuple);
|
|
22507
|
+
}
|
|
22508
|
+
function resolveAction(actionTuple) {
|
|
22509
|
+
unfulfilledActions.delete(actionTuple);
|
|
22510
|
+
}
|
|
22511
|
+
function formatAction([pluginName, hookName, args]) {
|
|
22512
|
+
let action = `(${pluginName}) ${hookName}`;
|
|
22513
|
+
const s = JSON.stringify;
|
|
22514
|
+
switch (hookName) {
|
|
22515
|
+
case 'resolveId':
|
|
22516
|
+
action += ` ${s(args[0])} ${s(args[1])}`;
|
|
22517
|
+
break;
|
|
22518
|
+
case 'load':
|
|
22519
|
+
action += ` ${s(args[0])}`;
|
|
22520
|
+
break;
|
|
22521
|
+
case 'transform':
|
|
22522
|
+
action += ` ${s(args[1])}`;
|
|
22523
|
+
break;
|
|
22524
|
+
}
|
|
22525
|
+
return action;
|
|
22526
|
+
}
|
|
22527
|
+
process.on('exit', () => {
|
|
22528
|
+
if (unfulfilledActions.size) {
|
|
22529
|
+
let err = '[!] Error: unfinished hook action(s) on exit:\n';
|
|
22530
|
+
for (const action of unfulfilledActions) {
|
|
22531
|
+
err += formatAction(action) + '\n';
|
|
22532
|
+
}
|
|
22533
|
+
console.error('%s', err);
|
|
22534
|
+
process.exit(1);
|
|
22535
|
+
}
|
|
22536
|
+
});
|
|
22537
|
+
|
|
22450
22538
|
const inputHookNames = {
|
|
22451
22539
|
buildEnd: 1,
|
|
22452
22540
|
buildStart: 1,
|
|
@@ -22457,6 +22545,7 @@ const inputHookNames = {
|
|
|
22457
22545
|
options: 1,
|
|
22458
22546
|
resolveDynamicImport: 1,
|
|
22459
22547
|
resolveId: 1,
|
|
22548
|
+
shouldTransformCachedModule: 1,
|
|
22460
22549
|
transform: 1,
|
|
22461
22550
|
watchChange: 1
|
|
22462
22551
|
};
|
|
@@ -22598,6 +22687,7 @@ class PluginDriver {
|
|
|
22598
22687
|
if (hookContext) {
|
|
22599
22688
|
context = hookContext(context, plugin);
|
|
22600
22689
|
}
|
|
22690
|
+
let action = null;
|
|
22601
22691
|
return Promise.resolve()
|
|
22602
22692
|
.then(() => {
|
|
22603
22693
|
// permit values allows values to be returned instead of a functional hook
|
|
@@ -22607,9 +22697,35 @@ class PluginDriver {
|
|
|
22607
22697
|
return throwInvalidHookError(hookName, plugin.name);
|
|
22608
22698
|
}
|
|
22609
22699
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
22610
|
-
|
|
22700
|
+
const hookResult = hook.apply(context, args);
|
|
22701
|
+
if (!hookResult || !hookResult.then) {
|
|
22702
|
+
// short circuit for non-thenables and non-Promises
|
|
22703
|
+
return hookResult;
|
|
22704
|
+
}
|
|
22705
|
+
// Track pending hook actions to properly error out when
|
|
22706
|
+
// unfulfilled promises cause rollup to abruptly and confusingly
|
|
22707
|
+
// exit with a successful 0 return code but without producing any
|
|
22708
|
+
// output, errors or warnings.
|
|
22709
|
+
action = [plugin.name, hookName, args];
|
|
22710
|
+
addUnresolvedAction(action);
|
|
22711
|
+
// Although it would be more elegant to just return hookResult here
|
|
22712
|
+
// and put the .then() handler just above the .catch() handler below,
|
|
22713
|
+
// doing so would subtly change the defacto async event dispatch order
|
|
22714
|
+
// which at least one test and some plugins in the wild may depend on.
|
|
22715
|
+
const promise = Promise.resolve(hookResult);
|
|
22716
|
+
return promise.then(() => {
|
|
22717
|
+
// action was fulfilled
|
|
22718
|
+
resolveAction(action);
|
|
22719
|
+
return promise;
|
|
22720
|
+
});
|
|
22611
22721
|
})
|
|
22612
|
-
.catch(err =>
|
|
22722
|
+
.catch(err => {
|
|
22723
|
+
if (action !== null) {
|
|
22724
|
+
// action considered to be fulfilled since error being handled
|
|
22725
|
+
resolveAction(action);
|
|
22726
|
+
}
|
|
22727
|
+
return throwPluginError(err, plugin.name, { hook: hookName });
|
|
22728
|
+
});
|
|
22613
22729
|
}
|
|
22614
22730
|
/**
|
|
22615
22731
|
* Run a sync plugin hook and return the result.
|
|
@@ -22922,6 +23038,7 @@ const generatedCodePresets = {
|
|
|
22922
23038
|
reservedNamesAsProps: true
|
|
22923
23039
|
}
|
|
22924
23040
|
};
|
|
23041
|
+
const objectifyOption = (value) => value && typeof value === 'object' ? value : {};
|
|
22925
23042
|
const objectifyOptionWithPresets = (presets, optionName, additionalValues) => (value) => {
|
|
22926
23043
|
if (typeof value === 'string') {
|
|
22927
23044
|
const preset = presets[value];
|
|
@@ -22930,7 +23047,7 @@ const objectifyOptionWithPresets = (presets, optionName, additionalValues) => (v
|
|
|
22930
23047
|
}
|
|
22931
23048
|
error(errInvalidOption(optionName, getHashFromObjectOption(optionName), `valid values are ${additionalValues}${printQuotedStringList(Object.keys(presets))}. You can also supply an object for more fine-grained control`, value));
|
|
22932
23049
|
}
|
|
22933
|
-
return value
|
|
23050
|
+
return objectifyOption(value);
|
|
22934
23051
|
};
|
|
22935
23052
|
const getOptionWithPreset = (value, presets, optionName, additionalValues) => {
|
|
22936
23053
|
var _a;
|
|
@@ -23579,9 +23696,8 @@ function defineConfig(options) {
|
|
|
23579
23696
|
let fsEvents;
|
|
23580
23697
|
let fsEventsImportError;
|
|
23581
23698
|
async function loadFsEvents() {
|
|
23582
|
-
const moduleName = 'fsevents';
|
|
23583
23699
|
try {
|
|
23584
|
-
({ default: fsEvents } = await import(
|
|
23700
|
+
({ default: fsEvents } = await import('fsevents'));
|
|
23585
23701
|
}
|
|
23586
23702
|
catch (err) {
|
|
23587
23703
|
fsEventsImportError = err;
|
|
@@ -23622,4 +23738,4 @@ function watch(configs) {
|
|
|
23622
23738
|
return emitter;
|
|
23623
23739
|
}
|
|
23624
23740
|
|
|
23625
|
-
export { createFilter, defaultOnWarn, defineConfig, ensureArray, fseventsImporter, generatedCodePresets, getAugmentedNamespace, objectifyOptionWithPresets, picomatch, rollup, rollupInternal, treeshakePresets, version$1 as version, warnUnknownOptions, watch };
|
|
23741
|
+
export { createFilter, defaultOnWarn, defineConfig, ensureArray, fseventsImporter, generatedCodePresets, getAugmentedNamespace, objectifyOption, objectifyOptionWithPresets, picomatch, rollup, rollupInternal, treeshakePresets, version$1 as version, warnUnknownOptions, watch };
|