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/shared/rollup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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
|
|
@@ -10,10 +10,12 @@
|
|
|
10
10
|
*/
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
-
const
|
|
13
|
+
const require$$0 = require('path');
|
|
14
|
+
const process$1 = require('process');
|
|
15
|
+
const perf_hooks = require('perf_hooks');
|
|
14
16
|
const crypto = require('crypto');
|
|
15
17
|
const fs = require('fs');
|
|
16
|
-
const require$$0 = require('events');
|
|
18
|
+
const require$$0$1 = require('events');
|
|
17
19
|
|
|
18
20
|
function _interopNamespaceDefault(e) {
|
|
19
21
|
const n = Object.create(null);
|
|
@@ -26,7 +28,7 @@ function _interopNamespaceDefault(e) {
|
|
|
26
28
|
return n;
|
|
27
29
|
}
|
|
28
30
|
|
|
29
|
-
var version$1 = "2.
|
|
31
|
+
var version$1 = "2.66.0";
|
|
30
32
|
|
|
31
33
|
function ensureArray$1(items) {
|
|
32
34
|
if (Array.isArray(items)) {
|
|
@@ -140,13 +142,13 @@ function normalize(path) {
|
|
|
140
142
|
}
|
|
141
143
|
|
|
142
144
|
function getAliasName(id) {
|
|
143
|
-
const base =
|
|
144
|
-
return base.substr(0, base.length -
|
|
145
|
+
const base = require$$0.basename(id);
|
|
146
|
+
return base.substr(0, base.length - require$$0.extname(id).length);
|
|
145
147
|
}
|
|
146
148
|
function relativeId(id) {
|
|
147
149
|
if (!isAbsolute(id))
|
|
148
150
|
return id;
|
|
149
|
-
return
|
|
151
|
+
return require$$0.relative(require$$0.resolve(), id);
|
|
150
152
|
}
|
|
151
153
|
function isPathFragment(name) {
|
|
152
154
|
// starting with "/", "./", "../", "C:/"
|
|
@@ -554,6 +556,7 @@ const generatedCodePresets = {
|
|
|
554
556
|
reservedNamesAsProps: true
|
|
555
557
|
}
|
|
556
558
|
};
|
|
559
|
+
const objectifyOption = (value) => value && typeof value === 'object' ? value : {};
|
|
557
560
|
const objectifyOptionWithPresets = (presets, optionName, additionalValues) => (value) => {
|
|
558
561
|
if (typeof value === 'string') {
|
|
559
562
|
const preset = presets[value];
|
|
@@ -562,7 +565,7 @@ const objectifyOptionWithPresets = (presets, optionName, additionalValues) => (v
|
|
|
562
565
|
}
|
|
563
566
|
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));
|
|
564
567
|
}
|
|
565
|
-
return value
|
|
568
|
+
return objectifyOption(value);
|
|
566
569
|
};
|
|
567
570
|
const getOptionWithPreset = (value, presets, optionName, additionalValues) => {
|
|
568
571
|
var _a;
|
|
@@ -583,9 +586,8 @@ const getHashFromObjectOption = (optionName) => optionName.split('.').join('').t
|
|
|
583
586
|
let fsEvents;
|
|
584
587
|
let fsEventsImportError;
|
|
585
588
|
async function loadFsEvents() {
|
|
586
|
-
const moduleName = 'fsevents';
|
|
587
589
|
try {
|
|
588
|
-
({ default: fsEvents } = await Promise.resolve().then(() => /*#__PURE__*/_interopNamespaceDefault(require(
|
|
590
|
+
({ default: fsEvents } = await Promise.resolve().then(() => /*#__PURE__*/_interopNamespaceDefault(require('fsevents'))));
|
|
589
591
|
}
|
|
590
592
|
catch (err) {
|
|
591
593
|
fsEventsImportError = err;
|
|
@@ -623,8 +625,8 @@ function getAugmentedNamespace(n) {
|
|
|
623
625
|
|
|
624
626
|
var charToInteger = {};
|
|
625
627
|
var chars$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
|
626
|
-
for (var i = 0; i < chars$1.length; i++) {
|
|
627
|
-
charToInteger[chars$1.charCodeAt(i)] = i;
|
|
628
|
+
for (var i$1 = 0; i$1 < chars$1.length; i$1++) {
|
|
629
|
+
charToInteger[chars$1.charCodeAt(i$1)] = i$1;
|
|
628
630
|
}
|
|
629
631
|
function decode(mappings) {
|
|
630
632
|
var decoded = [];
|
|
@@ -2342,14 +2344,17 @@ class ExternalModule {
|
|
|
2342
2344
|
this.info = {
|
|
2343
2345
|
ast: null,
|
|
2344
2346
|
code: null,
|
|
2347
|
+
dynamicallyImportedIdResolutions: EMPTY_ARRAY,
|
|
2345
2348
|
dynamicallyImportedIds: EMPTY_ARRAY,
|
|
2346
2349
|
get dynamicImporters() {
|
|
2347
2350
|
return dynamicImporters.sort();
|
|
2348
2351
|
},
|
|
2352
|
+
hasDefaultExport: null,
|
|
2349
2353
|
hasModuleSideEffects,
|
|
2350
2354
|
id,
|
|
2351
2355
|
implicitlyLoadedAfterOneOf: EMPTY_ARRAY,
|
|
2352
2356
|
implicitlyLoadedBefore: EMPTY_ARRAY,
|
|
2357
|
+
importedIdResolutions: EMPTY_ARRAY,
|
|
2353
2358
|
importedIds: EMPTY_ARRAY,
|
|
2354
2359
|
get importers() {
|
|
2355
2360
|
return importers.sort();
|
|
@@ -2374,7 +2379,7 @@ class ExternalModule {
|
|
|
2374
2379
|
typeof options.paths === 'function' ? options.paths(this.id) : options.paths[this.id];
|
|
2375
2380
|
if (!this.renderPath) {
|
|
2376
2381
|
this.renderPath = this.renormalizeRenderPath
|
|
2377
|
-
? normalize(
|
|
2382
|
+
? normalize(require$$0.relative(inputBase, this.id))
|
|
2378
2383
|
: this.id;
|
|
2379
2384
|
}
|
|
2380
2385
|
return this.renderPath;
|
|
@@ -2417,7 +2422,7 @@ class ExternalModule {
|
|
|
2417
2422
|
|
|
2418
2423
|
var utils$3 = {};
|
|
2419
2424
|
|
|
2420
|
-
const path$1 =
|
|
2425
|
+
const path$1 = require$$0;
|
|
2421
2426
|
const WIN_SLASH = '\\\\/';
|
|
2422
2427
|
const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
2423
2428
|
|
|
@@ -2597,7 +2602,7 @@ var constants$2 = {
|
|
|
2597
2602
|
|
|
2598
2603
|
(function (exports) {
|
|
2599
2604
|
|
|
2600
|
-
const path =
|
|
2605
|
+
const path = require$$0;
|
|
2601
2606
|
const win32 = process.platform === 'win32';
|
|
2602
2607
|
const {
|
|
2603
2608
|
REGEX_BACKSLASH,
|
|
@@ -3294,7 +3299,14 @@ const parse$1 = (input, options) => {
|
|
|
3294
3299
|
}
|
|
3295
3300
|
|
|
3296
3301
|
if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
|
|
3297
|
-
|
|
3302
|
+
// Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis.
|
|
3303
|
+
// In this case, we need to parse the string and use it in the output of the original pattern.
|
|
3304
|
+
// Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`.
|
|
3305
|
+
//
|
|
3306
|
+
// Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`.
|
|
3307
|
+
const expression = parse$1(rest, { ...options, fastpaths: false }).output;
|
|
3308
|
+
|
|
3309
|
+
output = token.close = `)${expression})${extglobStar})`;
|
|
3298
3310
|
}
|
|
3299
3311
|
|
|
3300
3312
|
if (token.prev.type === 'bos') {
|
|
@@ -4127,7 +4139,7 @@ parse$1.fastpaths = (input, options) => {
|
|
|
4127
4139
|
|
|
4128
4140
|
var parse_1 = parse$1;
|
|
4129
4141
|
|
|
4130
|
-
const path =
|
|
4142
|
+
const path = require$$0;
|
|
4131
4143
|
const scan = scan_1;
|
|
4132
4144
|
const parse = parse_1;
|
|
4133
4145
|
const utils = utils$3;
|
|
@@ -4520,22 +4532,22 @@ function ensureArray(thing) {
|
|
|
4520
4532
|
}
|
|
4521
4533
|
|
|
4522
4534
|
const normalizePath = function normalizePath(filename) {
|
|
4523
|
-
return filename.split(
|
|
4535
|
+
return filename.split(require$$0.win32.sep).join(require$$0.posix.sep);
|
|
4524
4536
|
};
|
|
4525
4537
|
|
|
4526
4538
|
function getMatcherString(id, resolutionBase) {
|
|
4527
|
-
if (resolutionBase === false ||
|
|
4539
|
+
if (resolutionBase === false || require$$0.isAbsolute(id) || id.startsWith('*')) {
|
|
4528
4540
|
return id;
|
|
4529
4541
|
}
|
|
4530
4542
|
// resolve('') is valid and will default to process.cwd()
|
|
4531
|
-
const basePath = normalizePath(
|
|
4543
|
+
const basePath = normalizePath(require$$0.resolve(resolutionBase || ''))
|
|
4532
4544
|
// escape all possible (posix + win) path characters that might interfere with regex
|
|
4533
4545
|
.replace(/[-^$*+?.()|[\]{}]/g, '\\$&');
|
|
4534
4546
|
// Note that we use posix.join because:
|
|
4535
4547
|
// 1. the basePath has been normalized to use /
|
|
4536
4548
|
// 2. the incoming glob (id) matcher, also uses /
|
|
4537
4549
|
// otherwise Node will force backslash (\) on windows
|
|
4538
|
-
return
|
|
4550
|
+
return require$$0.posix.join(basePath, id);
|
|
4539
4551
|
}
|
|
4540
4552
|
const createFilter = function createFilter(include, exclude, options) {
|
|
4541
4553
|
const resolutionBase = options && options.resolve;
|
|
@@ -4889,10 +4901,10 @@ const SequenceExpression$1 = 'SequenceExpression';
|
|
|
4889
4901
|
|
|
4890
4902
|
// this looks ridiculous, but it prevents sourcemap tooling from mistaking
|
|
4891
4903
|
// this for an actual sourceMappingURL
|
|
4892
|
-
|
|
4893
|
-
SOURCEMAPPING_URL += 'ppingURL';
|
|
4904
|
+
exports.SOURCEMAPPING_URL = 'sourceMa';
|
|
4905
|
+
exports.SOURCEMAPPING_URL += 'ppingURL';
|
|
4894
4906
|
const whiteSpaceNoNewline = '[ \\f\\r\\t\\v\\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]';
|
|
4895
|
-
const SOURCEMAPPING_URL_RE = new RegExp(`^#${whiteSpaceNoNewline}+${SOURCEMAPPING_URL}=.+`);
|
|
4907
|
+
const SOURCEMAPPING_URL_RE = new RegExp(`^#${whiteSpaceNoNewline}+${exports.SOURCEMAPPING_URL}=.+`);
|
|
4896
4908
|
|
|
4897
4909
|
// patch up acorn-walk until class-fields are officially supported
|
|
4898
4910
|
base$1.PropertyDefinition = function (node, st, c) {
|
|
@@ -8626,6 +8638,8 @@ const ARRAY_PROTOTYPE = new ObjectEntity({
|
|
|
8626
8638
|
filter: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NEW_ARRAY,
|
|
8627
8639
|
find: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN,
|
|
8628
8640
|
findIndex: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NUMBER,
|
|
8641
|
+
findLast: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN,
|
|
8642
|
+
findLastIndex: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NUMBER,
|
|
8629
8643
|
flat: METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY,
|
|
8630
8644
|
flatMap: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NEW_ARRAY,
|
|
8631
8645
|
forEach: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN,
|
|
@@ -10898,7 +10912,7 @@ class MetaProperty extends NodeBase {
|
|
|
10898
10912
|
chunkReferenceId = metaProperty.substr(CHUNK_PREFIX.length);
|
|
10899
10913
|
fileName = outputPluginDriver.getFileName(chunkReferenceId);
|
|
10900
10914
|
}
|
|
10901
|
-
const relativePath = normalize(
|
|
10915
|
+
const relativePath = normalize(require$$0.relative(require$$0.dirname(chunkId), fileName));
|
|
10902
10916
|
let replacement;
|
|
10903
10917
|
if (assetReferenceId !== null) {
|
|
10904
10918
|
replacement = outputPluginDriver.hookFirstSync('resolveAssetUrl', [
|
|
@@ -12140,24 +12154,7 @@ function getOriginalLocation(sourcemapChain, location) {
|
|
|
12140
12154
|
}
|
|
12141
12155
|
|
|
12142
12156
|
const NOOP = () => { };
|
|
12143
|
-
let
|
|
12144
|
-
let getElapsedTime = () => 0;
|
|
12145
|
-
let getMemory = () => 0;
|
|
12146
|
-
let timers = {};
|
|
12147
|
-
const normalizeHrTime = (time) => time[0] * 1e3 + time[1] / 1e6;
|
|
12148
|
-
function setTimeHelpers() {
|
|
12149
|
-
if (typeof process !== 'undefined' && typeof process.hrtime === 'function') {
|
|
12150
|
-
getStartTime = process.hrtime.bind(process);
|
|
12151
|
-
getElapsedTime = previous => normalizeHrTime(process.hrtime(previous));
|
|
12152
|
-
}
|
|
12153
|
-
else if (typeof performance !== 'undefined' && typeof performance.now === 'function') {
|
|
12154
|
-
getStartTime = () => [performance.now(), 0];
|
|
12155
|
-
getElapsedTime = previous => performance.now() - previous[0];
|
|
12156
|
-
}
|
|
12157
|
-
if (typeof process !== 'undefined' && typeof process.memoryUsage === 'function') {
|
|
12158
|
-
getMemory = () => process.memoryUsage().heapUsed;
|
|
12159
|
-
}
|
|
12160
|
-
}
|
|
12157
|
+
let timers = new Map();
|
|
12161
12158
|
function getPersistedLabel(label, level) {
|
|
12162
12159
|
switch (level) {
|
|
12163
12160
|
case 1:
|
|
@@ -12172,58 +12169,59 @@ function getPersistedLabel(label, level) {
|
|
|
12172
12169
|
}
|
|
12173
12170
|
function timeStartImpl(label, level = 3) {
|
|
12174
12171
|
label = getPersistedLabel(label, level);
|
|
12175
|
-
|
|
12176
|
-
|
|
12172
|
+
const startMemory = process$1.memoryUsage().heapUsed;
|
|
12173
|
+
const startTime = perf_hooks.performance.now();
|
|
12174
|
+
const timer = timers.get(label);
|
|
12175
|
+
if (timer === undefined) {
|
|
12176
|
+
timers.set(label, {
|
|
12177
12177
|
memory: 0,
|
|
12178
|
-
startMemory
|
|
12179
|
-
startTime
|
|
12178
|
+
startMemory,
|
|
12179
|
+
startTime,
|
|
12180
12180
|
time: 0,
|
|
12181
12181
|
totalMemory: 0
|
|
12182
|
-
};
|
|
12182
|
+
});
|
|
12183
|
+
}
|
|
12184
|
+
else {
|
|
12185
|
+
timer.startMemory = startMemory;
|
|
12186
|
+
timer.startTime = startTime;
|
|
12183
12187
|
}
|
|
12184
|
-
const currentMemory = getMemory();
|
|
12185
|
-
timers[label].startTime = getStartTime();
|
|
12186
|
-
timers[label].startMemory = currentMemory;
|
|
12187
12188
|
}
|
|
12188
12189
|
function timeEndImpl(label, level = 3) {
|
|
12189
12190
|
label = getPersistedLabel(label, level);
|
|
12190
|
-
|
|
12191
|
-
|
|
12192
|
-
|
|
12193
|
-
|
|
12194
|
-
|
|
12191
|
+
const timer = timers.get(label);
|
|
12192
|
+
if (timer !== undefined) {
|
|
12193
|
+
const currentMemory = process$1.memoryUsage().heapUsed;
|
|
12194
|
+
timer.memory += currentMemory - timer.startMemory;
|
|
12195
|
+
timer.time += perf_hooks.performance.now() - timer.startTime;
|
|
12196
|
+
timer.totalMemory = Math.max(timer.totalMemory, currentMemory);
|
|
12195
12197
|
}
|
|
12196
12198
|
}
|
|
12197
12199
|
function getTimings() {
|
|
12198
12200
|
const newTimings = {};
|
|
12199
|
-
for (const [label, {
|
|
12201
|
+
for (const [label, { memory, time, totalMemory }] of timers) {
|
|
12200
12202
|
newTimings[label] = [time, memory, totalMemory];
|
|
12201
12203
|
}
|
|
12202
12204
|
return newTimings;
|
|
12203
12205
|
}
|
|
12204
|
-
let timeStart = NOOP
|
|
12205
|
-
|
|
12206
|
-
|
|
12207
|
-
resolveDynamicImport: true,
|
|
12208
|
-
resolveId: true,
|
|
12209
|
-
transform: true
|
|
12210
|
-
};
|
|
12206
|
+
let timeStart = NOOP;
|
|
12207
|
+
let timeEnd = NOOP;
|
|
12208
|
+
const TIMED_PLUGIN_HOOKS = ['load', 'resolveDynamicImport', 'resolveId', 'transform'];
|
|
12211
12209
|
function getPluginWithTimers(plugin, index) {
|
|
12212
|
-
const
|
|
12213
|
-
|
|
12214
|
-
if (TIMED_PLUGIN_HOOKS[hook] === true) {
|
|
12210
|
+
for (const hook of TIMED_PLUGIN_HOOKS) {
|
|
12211
|
+
if (hook in plugin) {
|
|
12215
12212
|
let timerLabel = `plugin ${index}`;
|
|
12216
12213
|
if (plugin.name) {
|
|
12217
12214
|
timerLabel += ` (${plugin.name})`;
|
|
12218
12215
|
}
|
|
12219
12216
|
timerLabel += ` - ${hook}`;
|
|
12220
|
-
|
|
12217
|
+
const func = plugin[hook];
|
|
12218
|
+
plugin[hook] = function (...args) {
|
|
12221
12219
|
timeStart(timerLabel, 4);
|
|
12222
|
-
|
|
12220
|
+
const result = func.apply(this, args);
|
|
12223
12221
|
timeEnd(timerLabel, 4);
|
|
12224
12222
|
if (result && typeof result.then === 'function') {
|
|
12225
12223
|
timeStart(`${timerLabel} (async)`, 4);
|
|
12226
|
-
|
|
12224
|
+
return result.then((hookResult) => {
|
|
12227
12225
|
timeEnd(`${timerLabel} (async)`, 4);
|
|
12228
12226
|
return hookResult;
|
|
12229
12227
|
});
|
|
@@ -12231,16 +12229,12 @@ function getPluginWithTimers(plugin, index) {
|
|
|
12231
12229
|
return result;
|
|
12232
12230
|
};
|
|
12233
12231
|
}
|
|
12234
|
-
else {
|
|
12235
|
-
timedPlugin[hook] = plugin[hook];
|
|
12236
|
-
}
|
|
12237
12232
|
}
|
|
12238
|
-
return
|
|
12233
|
+
return plugin;
|
|
12239
12234
|
}
|
|
12240
12235
|
function initialiseTimers(inputOptions) {
|
|
12241
12236
|
if (inputOptions.perf) {
|
|
12242
|
-
timers =
|
|
12243
|
-
setTimeHelpers();
|
|
12237
|
+
timers = new Map();
|
|
12244
12238
|
timeStart = timeStartImpl;
|
|
12245
12239
|
timeEnd = timeEndImpl;
|
|
12246
12240
|
inputOptions.plugins = inputOptions.plugins.map(getPluginWithTimers);
|
|
@@ -12369,6 +12363,11 @@ class Module {
|
|
|
12369
12363
|
this.info = {
|
|
12370
12364
|
ast: null,
|
|
12371
12365
|
code: null,
|
|
12366
|
+
get dynamicallyImportedIdResolutions() {
|
|
12367
|
+
return module.dynamicImports
|
|
12368
|
+
.map(({ argument }) => typeof argument === 'string' && module.resolvedIds[argument])
|
|
12369
|
+
.filter(Boolean);
|
|
12370
|
+
},
|
|
12372
12371
|
get dynamicallyImportedIds() {
|
|
12373
12372
|
const dynamicallyImportedIds = [];
|
|
12374
12373
|
for (const { id } of module.dynamicImports) {
|
|
@@ -12381,6 +12380,13 @@ class Module {
|
|
|
12381
12380
|
get dynamicImporters() {
|
|
12382
12381
|
return module.dynamicImporters.sort();
|
|
12383
12382
|
},
|
|
12383
|
+
get hasDefaultExport() {
|
|
12384
|
+
// This information is only valid after parsing
|
|
12385
|
+
if (!module.ast) {
|
|
12386
|
+
return null;
|
|
12387
|
+
}
|
|
12388
|
+
return 'default' in module.exports || 'default' in module.reexportDescriptions;
|
|
12389
|
+
},
|
|
12384
12390
|
hasModuleSideEffects,
|
|
12385
12391
|
id,
|
|
12386
12392
|
get implicitlyLoadedAfterOneOf() {
|
|
@@ -12389,6 +12395,9 @@ class Module {
|
|
|
12389
12395
|
get implicitlyLoadedBefore() {
|
|
12390
12396
|
return Array.from(module.implicitlyLoadedBefore, getId).sort();
|
|
12391
12397
|
},
|
|
12398
|
+
get importedIdResolutions() {
|
|
12399
|
+
return Array.from(module.sources, source => module.resolvedIds[source]).filter(Boolean);
|
|
12400
|
+
},
|
|
12392
12401
|
get importedIds() {
|
|
12393
12402
|
return Array.from(module.sources, source => { var _a; return (_a = module.resolvedIds[source]) === null || _a === void 0 ? void 0 : _a.id; }).filter(Boolean);
|
|
12394
12403
|
},
|
|
@@ -12403,13 +12412,13 @@ class Module {
|
|
|
12403
12412
|
}
|
|
12404
12413
|
return module.isIncluded();
|
|
12405
12414
|
},
|
|
12406
|
-
meta,
|
|
12415
|
+
meta: { ...meta },
|
|
12407
12416
|
syntheticNamedExports
|
|
12408
12417
|
};
|
|
12409
12418
|
}
|
|
12410
12419
|
basename() {
|
|
12411
|
-
const base =
|
|
12412
|
-
const ext =
|
|
12420
|
+
const base = require$$0.basename(this.id);
|
|
12421
|
+
const ext = require$$0.extname(this.id);
|
|
12413
12422
|
return makeLegal(ext ? base.slice(0, -ext.length) : base);
|
|
12414
12423
|
}
|
|
12415
12424
|
bindReferences() {
|
|
@@ -12424,7 +12433,7 @@ class Module {
|
|
|
12424
12433
|
return this.allExportNames;
|
|
12425
12434
|
}
|
|
12426
12435
|
const allExportNames = (this.allExportNames = new Set());
|
|
12427
|
-
for (const name of
|
|
12436
|
+
for (const name of this.getExports()) {
|
|
12428
12437
|
allExportNames.add(name);
|
|
12429
12438
|
}
|
|
12430
12439
|
for (const name of Object.keys(this.reexportDescriptions)) {
|
|
@@ -12448,12 +12457,11 @@ class Module {
|
|
|
12448
12457
|
const relevantDependencies = new Set();
|
|
12449
12458
|
const necessaryDependencies = new Set();
|
|
12450
12459
|
const alwaysCheckedDependencies = new Set();
|
|
12451
|
-
|
|
12460
|
+
const dependencyVariables = new Set(this.imports);
|
|
12452
12461
|
if (this.info.isEntry ||
|
|
12453
12462
|
this.includedDynamicImporters.length > 0 ||
|
|
12454
12463
|
this.namespace.included ||
|
|
12455
12464
|
this.implicitlyLoadedAfter.size > 0) {
|
|
12456
|
-
dependencyVariables = new Set(dependencyVariables);
|
|
12457
12465
|
for (const exportName of [...this.getReexports(), ...this.getExports()]) {
|
|
12458
12466
|
const exportedVariable = this.getVariableForExportName(exportName);
|
|
12459
12467
|
if (exportedVariable) {
|
|
@@ -12835,7 +12843,7 @@ class Module {
|
|
|
12835
12843
|
this.info.syntheticNamedExports = syntheticNamedExports;
|
|
12836
12844
|
}
|
|
12837
12845
|
if (meta != null) {
|
|
12838
|
-
|
|
12846
|
+
Object.assign(this.info.meta, meta);
|
|
12839
12847
|
}
|
|
12840
12848
|
}
|
|
12841
12849
|
warn(props, pos) {
|
|
@@ -12926,11 +12934,7 @@ class Module {
|
|
|
12926
12934
|
for (const specifier of node.specifiers) {
|
|
12927
12935
|
const isDefault = specifier.type === ImportDefaultSpecifier$1;
|
|
12928
12936
|
const isNamespace = specifier.type === ImportNamespaceSpecifier$1;
|
|
12929
|
-
const name = isDefault
|
|
12930
|
-
? 'default'
|
|
12931
|
-
: isNamespace
|
|
12932
|
-
? '*'
|
|
12933
|
-
: specifier.imported.name;
|
|
12937
|
+
const name = isDefault ? 'default' : isNamespace ? '*' : specifier.imported.name;
|
|
12934
12938
|
this.importDescriptions[specifier.local.name] = {
|
|
12935
12939
|
module: null,
|
|
12936
12940
|
name,
|
|
@@ -13077,7 +13081,7 @@ class Module {
|
|
|
13077
13081
|
variable.include();
|
|
13078
13082
|
this.graph.needsTreeshakingPass = true;
|
|
13079
13083
|
const variableModule = variable.module;
|
|
13080
|
-
if (variableModule
|
|
13084
|
+
if (variableModule instanceof Module) {
|
|
13081
13085
|
if (!variableModule.isExecuted) {
|
|
13082
13086
|
markModuleAndImpureDependenciesAsExecuted(variableModule);
|
|
13083
13087
|
}
|
|
@@ -14027,9 +14031,9 @@ function getCollapsedSourcemap(id, originalCode, originalSourcemap, sourcemapCha
|
|
|
14027
14031
|
else {
|
|
14028
14032
|
const sources = originalSourcemap.sources;
|
|
14029
14033
|
const sourcesContent = originalSourcemap.sourcesContent || [];
|
|
14030
|
-
const directory =
|
|
14034
|
+
const directory = require$$0.dirname(id) || '.';
|
|
14031
14035
|
const sourceRoot = originalSourcemap.sourceRoot || '.';
|
|
14032
|
-
const baseSources = sources.map((source, i) => new Source(
|
|
14036
|
+
const baseSources = sources.map((source, i) => new Source(require$$0.resolve(directory, sourceRoot, source), sourcesContent[i]));
|
|
14033
14037
|
source = new Link(originalSourcemap, baseSources);
|
|
14034
14038
|
}
|
|
14035
14039
|
return sourcemapChain.reduce(linkMap, source);
|
|
@@ -14045,9 +14049,9 @@ function collapseSourcemaps(file, map, modules, bundleSourcemapChain, excludeCon
|
|
|
14045
14049
|
source = bundleSourcemapChain.reduce(linkMap, source);
|
|
14046
14050
|
let { sources, sourcesContent, names, mappings } = source.traceMappings();
|
|
14047
14051
|
if (file) {
|
|
14048
|
-
const directory =
|
|
14049
|
-
sources = sources.map((source) =>
|
|
14050
|
-
file =
|
|
14052
|
+
const directory = require$$0.dirname(file);
|
|
14053
|
+
sources = sources.map((source) => require$$0.relative(directory, source));
|
|
14054
|
+
file = require$$0.basename(file);
|
|
14051
14055
|
}
|
|
14052
14056
|
sourcesContent = (excludeContent ? null : sourcesContent);
|
|
14053
14057
|
return new SourceMap({ file, mappings, names, sources, sourcesContent });
|
|
@@ -14379,7 +14383,7 @@ function makeUnique(name, existingNames) {
|
|
|
14379
14383
|
const existingNamesLowercase = new Set(Object.keys(existingNames).map(key => key.toLowerCase()));
|
|
14380
14384
|
if (!existingNamesLowercase.has(name.toLocaleLowerCase()))
|
|
14381
14385
|
return name;
|
|
14382
|
-
const ext =
|
|
14386
|
+
const ext = require$$0.extname(name);
|
|
14383
14387
|
name = name.substr(0, name.length - ext.length);
|
|
14384
14388
|
let uniqueName, uniqueIndex = 1;
|
|
14385
14389
|
while (existingNamesLowercase.has((uniqueName = name + ++uniqueIndex + ext).toLowerCase()))
|
|
@@ -14435,6 +14439,7 @@ class Chunk {
|
|
|
14435
14439
|
this.implicitlyLoadedBefore = new Set();
|
|
14436
14440
|
this.imports = new Set();
|
|
14437
14441
|
this.indentString = undefined;
|
|
14442
|
+
// This may only be updated in the constructor
|
|
14438
14443
|
this.isEmpty = true;
|
|
14439
14444
|
this.name = null;
|
|
14440
14445
|
this.renderedDependencies = null;
|
|
@@ -14620,7 +14625,7 @@ class Chunk {
|
|
|
14620
14625
|
}), existingNames);
|
|
14621
14626
|
}
|
|
14622
14627
|
generateIdPreserveModules(preserveModulesRelativeDir, options, existingNames, unsetOptions) {
|
|
14623
|
-
const id = this.orderedModules
|
|
14628
|
+
const [{ id }] = this.orderedModules;
|
|
14624
14629
|
const sanitizedId = this.outputOptions.sanitizeFileName(id);
|
|
14625
14630
|
let path;
|
|
14626
14631
|
const patternOpt = unsetOptions.has('entryFileNames')
|
|
@@ -14628,8 +14633,8 @@ class Chunk {
|
|
|
14628
14633
|
: options.entryFileNames;
|
|
14629
14634
|
const pattern = typeof patternOpt === 'function' ? patternOpt(this.getChunkInfo()) : patternOpt;
|
|
14630
14635
|
if (isAbsolute(id)) {
|
|
14631
|
-
const currentDir =
|
|
14632
|
-
const extension =
|
|
14636
|
+
const currentDir = require$$0.dirname(sanitizedId);
|
|
14637
|
+
const extension = require$$0.extname(id);
|
|
14633
14638
|
const fileName = renderNamePattern(pattern, 'output.entryFileNames', {
|
|
14634
14639
|
assetExtname: () => (NON_ASSET_EXTENSIONS.includes(extension) ? '' : extension),
|
|
14635
14640
|
ext: () => extension.substr(1),
|
|
@@ -14647,7 +14652,7 @@ class Chunk {
|
|
|
14647
14652
|
}
|
|
14648
14653
|
}
|
|
14649
14654
|
else {
|
|
14650
|
-
const extension =
|
|
14655
|
+
const extension = require$$0.extname(sanitizedId);
|
|
14651
14656
|
const fileName = renderNamePattern(pattern, 'output.entryFileNames', {
|
|
14652
14657
|
assetExtname: () => (NON_ASSET_EXTENSIONS.includes(extension) ? '' : extension),
|
|
14653
14658
|
ext: () => extension.substr(1),
|
|
@@ -14900,11 +14905,11 @@ class Chunk {
|
|
|
14900
14905
|
timeStart('sourcemap', 2);
|
|
14901
14906
|
let file;
|
|
14902
14907
|
if (options.file)
|
|
14903
|
-
file =
|
|
14908
|
+
file = require$$0.resolve(options.sourcemapFile || options.file);
|
|
14904
14909
|
else if (options.dir)
|
|
14905
|
-
file =
|
|
14910
|
+
file = require$$0.resolve(options.dir, this.id);
|
|
14906
14911
|
else
|
|
14907
|
-
file =
|
|
14912
|
+
file = require$$0.resolve(this.id);
|
|
14908
14913
|
const decodedMap = magicString.generateDecodedMap({});
|
|
14909
14914
|
map = collapseSourcemaps(file, decodedMap, this.usedModules, chunkSourcemapChain, options.sourcemapExcludeSources, this.inputOptions.onwarn);
|
|
14910
14915
|
map.sources = map.sources
|
|
@@ -15269,14 +15274,14 @@ class Chunk {
|
|
|
15269
15274
|
return referencedFiles;
|
|
15270
15275
|
}
|
|
15271
15276
|
getRelativePath(targetPath, stripJsExtension) {
|
|
15272
|
-
let relativePath = normalize(relative(
|
|
15277
|
+
let relativePath = normalize(relative(require$$0.dirname(this.id), targetPath));
|
|
15273
15278
|
if (stripJsExtension && relativePath.endsWith('.js')) {
|
|
15274
15279
|
relativePath = relativePath.slice(0, -3);
|
|
15275
15280
|
}
|
|
15276
15281
|
if (relativePath === '..')
|
|
15277
|
-
return '../../' +
|
|
15282
|
+
return '../../' + require$$0.basename(targetPath);
|
|
15278
15283
|
if (relativePath === '')
|
|
15279
|
-
return '../' +
|
|
15284
|
+
return '../' + require$$0.basename(targetPath);
|
|
15280
15285
|
return relativePath.startsWith('../') ? relativePath : './' + relativePath;
|
|
15281
15286
|
}
|
|
15282
15287
|
inlineChunkDependencies(chunk) {
|
|
@@ -15425,8 +15430,8 @@ function generateAssetFileName(name, source, outputOptions, bundle) {
|
|
|
15425
15430
|
return makeUnique(renderNamePattern(typeof outputOptions.assetFileNames === 'function'
|
|
15426
15431
|
? outputOptions.assetFileNames({ name, source, type: 'asset' })
|
|
15427
15432
|
: outputOptions.assetFileNames, 'output.assetFileNames', {
|
|
15428
|
-
ext: () =>
|
|
15429
|
-
extname: () =>
|
|
15433
|
+
ext: () => require$$0.extname(emittedName).substr(1),
|
|
15434
|
+
extname: () => require$$0.extname(emittedName),
|
|
15430
15435
|
hash() {
|
|
15431
15436
|
const hash = createHash();
|
|
15432
15437
|
hash.update(emittedName);
|
|
@@ -15434,7 +15439,7 @@ function generateAssetFileName(name, source, outputOptions, bundle) {
|
|
|
15434
15439
|
hash.update(source);
|
|
15435
15440
|
return hash.digest('hex').substr(0, 8);
|
|
15436
15441
|
},
|
|
15437
|
-
name: () => emittedName.substr(0, emittedName.length -
|
|
15442
|
+
name: () => emittedName.substr(0, emittedName.length - require$$0.extname(emittedName).length)
|
|
15438
15443
|
}), bundle);
|
|
15439
15444
|
}
|
|
15440
15445
|
function reserveFileNameInBundle(fileName, bundle, warn) {
|
|
@@ -15826,7 +15831,7 @@ function commondir(files) {
|
|
|
15826
15831
|
if (files.length === 0)
|
|
15827
15832
|
return '/';
|
|
15828
15833
|
if (files.length === 1)
|
|
15829
|
-
return
|
|
15834
|
+
return require$$0.dirname(files[0]);
|
|
15830
15835
|
const commonSegments = files.slice(1).reduce((commonSegments, file) => {
|
|
15831
15836
|
const pathSegements = file.split(/\/+|\\+/);
|
|
15832
15837
|
let i;
|
|
@@ -16046,7 +16051,7 @@ class Bundle {
|
|
|
16046
16051
|
const chunksForNaming = entryChunks.concat(otherChunks);
|
|
16047
16052
|
for (const chunk of chunksForNaming) {
|
|
16048
16053
|
if (this.outputOptions.file) {
|
|
16049
|
-
chunk.id =
|
|
16054
|
+
chunk.id = require$$0.basename(this.outputOptions.file);
|
|
16050
16055
|
}
|
|
16051
16056
|
else if (this.outputOptions.preserveModules) {
|
|
16052
16057
|
chunk.id = chunk.generateIdPreserveModules(inputBase, this.outputOptions, bundle, this.unsetOptions);
|
|
@@ -16195,8 +16200,8 @@ var keywordRelationalOperator = /^in(stanceof)?$/;
|
|
|
16195
16200
|
// are only applied when a character is found to actually have a
|
|
16196
16201
|
// code point above 128.
|
|
16197
16202
|
// Generated by `bin/generate-identifier-regex.js`.
|
|
16198
|
-
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\
|
|
16199
|
-
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\
|
|
16203
|
+
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";
|
|
16204
|
+
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";
|
|
16200
16205
|
|
|
16201
16206
|
var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
|
|
16202
16207
|
var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
|
|
@@ -16210,10 +16215,10 @@ nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
|
|
|
16210
16215
|
// generated by bin/generate-identifier-regex.js
|
|
16211
16216
|
|
|
16212
16217
|
// eslint-disable-next-line comma-spacing
|
|
16213
|
-
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,
|
|
16218
|
+
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];
|
|
16214
16219
|
|
|
16215
16220
|
// eslint-disable-next-line comma-spacing
|
|
16216
|
-
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,
|
|
16221
|
+
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];
|
|
16217
16222
|
|
|
16218
16223
|
// This has a complexity linear to the value of the code. The
|
|
16219
16224
|
// assumption is that looking up astral identifier characters is
|
|
@@ -16418,6 +16423,17 @@ function isNewLine(code) {
|
|
|
16418
16423
|
return code === 10 || code === 13 || code === 0x2028 || code === 0x2029
|
|
16419
16424
|
}
|
|
16420
16425
|
|
|
16426
|
+
function nextLineBreak(code, from, end) {
|
|
16427
|
+
if ( end === void 0 ) end = code.length;
|
|
16428
|
+
|
|
16429
|
+
for (var i = from; i < end; i++) {
|
|
16430
|
+
var next = code.charCodeAt(i);
|
|
16431
|
+
if (isNewLine(next))
|
|
16432
|
+
{ return i < end - 1 && next === 13 && code.charCodeAt(i + 1) === 10 ? i + 2 : i + 1 }
|
|
16433
|
+
}
|
|
16434
|
+
return -1
|
|
16435
|
+
}
|
|
16436
|
+
|
|
16421
16437
|
var nonASCIIwhitespace = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/;
|
|
16422
16438
|
|
|
16423
16439
|
var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;
|
|
@@ -16426,11 +16442,9 @@ var ref = Object.prototype;
|
|
|
16426
16442
|
var hasOwnProperty = ref.hasOwnProperty;
|
|
16427
16443
|
var toString = ref.toString;
|
|
16428
16444
|
|
|
16429
|
-
|
|
16430
|
-
|
|
16431
|
-
|
|
16432
|
-
return hasOwnProperty.call(obj, propName)
|
|
16433
|
-
}
|
|
16445
|
+
var hasOwn = Object.hasOwn || (function (obj, propName) { return (
|
|
16446
|
+
hasOwnProperty.call(obj, propName)
|
|
16447
|
+
); });
|
|
16434
16448
|
|
|
16435
16449
|
var isArray = Array.isArray || (function (obj) { return (
|
|
16436
16450
|
toString.call(obj) === "[object Array]"
|
|
@@ -16440,6 +16454,8 @@ function wordsRegexp(words) {
|
|
|
16440
16454
|
return new RegExp("^(?:" + words.replace(/ /g, "|") + ")$")
|
|
16441
16455
|
}
|
|
16442
16456
|
|
|
16457
|
+
var loneSurrogate = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/;
|
|
16458
|
+
|
|
16443
16459
|
// These are used when `options.locations` is on, for the
|
|
16444
16460
|
// `startLoc` and `endLoc` properties.
|
|
16445
16461
|
|
|
@@ -16466,14 +16482,10 @@ var SourceLocation = function SourceLocation(p, start, end) {
|
|
|
16466
16482
|
|
|
16467
16483
|
function getLineInfo(input, offset) {
|
|
16468
16484
|
for (var line = 1, cur = 0;;) {
|
|
16469
|
-
|
|
16470
|
-
|
|
16471
|
-
|
|
16472
|
-
|
|
16473
|
-
cur = match.index + match[0].length;
|
|
16474
|
-
} else {
|
|
16475
|
-
return new Position(line, offset - cur)
|
|
16476
|
-
}
|
|
16485
|
+
var nextBreak = nextLineBreak(input, cur, offset);
|
|
16486
|
+
if (nextBreak < 0) { return new Position(line, offset - cur) }
|
|
16487
|
+
++line;
|
|
16488
|
+
cur = nextBreak;
|
|
16477
16489
|
}
|
|
16478
16490
|
}
|
|
16479
16491
|
|
|
@@ -16579,7 +16591,7 @@ function getOptions(opts) {
|
|
|
16579
16591
|
var options = {};
|
|
16580
16592
|
|
|
16581
16593
|
for (var opt in defaultOptions)
|
|
16582
|
-
{ options[opt] = opts &&
|
|
16594
|
+
{ options[opt] = opts && hasOwn(opts, opt) ? opts[opt] : defaultOptions[opt]; }
|
|
16583
16595
|
|
|
16584
16596
|
if (options.ecmaVersion === "latest") {
|
|
16585
16597
|
options.ecmaVersion = 1e8;
|
|
@@ -17745,7 +17757,7 @@ pp$8.exitClassBody = function() {
|
|
|
17745
17757
|
var parent = len === 0 ? null : this.privateNameStack[len - 1];
|
|
17746
17758
|
for (var i = 0; i < used.length; ++i) {
|
|
17747
17759
|
var id = used[i];
|
|
17748
|
-
if (!
|
|
17760
|
+
if (!hasOwn(declared, id.name)) {
|
|
17749
17761
|
if (parent) {
|
|
17750
17762
|
parent.used.push(id);
|
|
17751
17763
|
} else {
|
|
@@ -17798,7 +17810,7 @@ pp$8.parseExport = function(node, exports) {
|
|
|
17798
17810
|
if (this.eat(types$1.star)) {
|
|
17799
17811
|
if (this.options.ecmaVersion >= 11) {
|
|
17800
17812
|
if (this.eatContextual("as")) {
|
|
17801
|
-
node.exported = this.
|
|
17813
|
+
node.exported = this.parseModuleExportName();
|
|
17802
17814
|
this.checkExport(exports, node.exported.name, this.lastTokStart);
|
|
17803
17815
|
} else {
|
|
17804
17816
|
node.exported = null;
|
|
@@ -17850,6 +17862,10 @@ pp$8.parseExport = function(node, exports) {
|
|
|
17850
17862
|
this.checkUnreserved(spec.local);
|
|
17851
17863
|
// check if export is defined
|
|
17852
17864
|
this.checkLocalExport(spec.local);
|
|
17865
|
+
|
|
17866
|
+
if (spec.local.type === "Literal") {
|
|
17867
|
+
this.raise(spec.local.start, "A string literal cannot be used as an exported binding without `from`.");
|
|
17868
|
+
}
|
|
17853
17869
|
}
|
|
17854
17870
|
|
|
17855
17871
|
node.source = null;
|
|
@@ -17861,7 +17877,7 @@ pp$8.parseExport = function(node, exports) {
|
|
|
17861
17877
|
|
|
17862
17878
|
pp$8.checkExport = function(exports, name, pos) {
|
|
17863
17879
|
if (!exports) { return }
|
|
17864
|
-
if (
|
|
17880
|
+
if (hasOwn(exports, name))
|
|
17865
17881
|
{ this.raiseRecoverable(pos, "Duplicate export '" + name + "'"); }
|
|
17866
17882
|
exports[name] = true;
|
|
17867
17883
|
};
|
|
@@ -17925,9 +17941,13 @@ pp$8.parseExportSpecifiers = function(exports) {
|
|
|
17925
17941
|
} else { first = false; }
|
|
17926
17942
|
|
|
17927
17943
|
var node = this.startNode();
|
|
17928
|
-
node.local = this.
|
|
17929
|
-
node.exported = this.eatContextual("as") ? this.
|
|
17930
|
-
this.checkExport(
|
|
17944
|
+
node.local = this.parseModuleExportName();
|
|
17945
|
+
node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local;
|
|
17946
|
+
this.checkExport(
|
|
17947
|
+
exports,
|
|
17948
|
+
node.exported[node.exported.type === "Identifier" ? "name" : "value"],
|
|
17949
|
+
node.exported.start
|
|
17950
|
+
);
|
|
17931
17951
|
nodes.push(this.finishNode(node, "ExportSpecifier"));
|
|
17932
17952
|
}
|
|
17933
17953
|
return nodes
|
|
@@ -17979,7 +17999,7 @@ pp$8.parseImportSpecifiers = function() {
|
|
|
17979
17999
|
} else { first = false; }
|
|
17980
18000
|
|
|
17981
18001
|
var node$2 = this.startNode();
|
|
17982
|
-
node$2.imported = this.
|
|
18002
|
+
node$2.imported = this.parseModuleExportName();
|
|
17983
18003
|
if (this.eatContextual("as")) {
|
|
17984
18004
|
node$2.local = this.parseIdent();
|
|
17985
18005
|
} else {
|
|
@@ -17992,6 +18012,17 @@ pp$8.parseImportSpecifiers = function() {
|
|
|
17992
18012
|
return nodes
|
|
17993
18013
|
};
|
|
17994
18014
|
|
|
18015
|
+
pp$8.parseModuleExportName = function() {
|
|
18016
|
+
if (this.options.ecmaVersion >= 13 && this.type === types$1.string) {
|
|
18017
|
+
var stringLiteral = this.parseLiteral(this.value);
|
|
18018
|
+
if (loneSurrogate.test(stringLiteral.value)) {
|
|
18019
|
+
this.raise(stringLiteral.start, "An export name cannot include a lone surrogate.");
|
|
18020
|
+
}
|
|
18021
|
+
return stringLiteral
|
|
18022
|
+
}
|
|
18023
|
+
return this.parseIdent(true)
|
|
18024
|
+
};
|
|
18025
|
+
|
|
17995
18026
|
// Set `ExpressionStatement#directive` property for directive prologues.
|
|
17996
18027
|
pp$8.adaptDirectivePrologue = function(statements) {
|
|
17997
18028
|
for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) {
|
|
@@ -18265,7 +18296,7 @@ pp$7.checkLValSimple = function(expr, bindingType, checkClashes) {
|
|
|
18265
18296
|
if (bindingType === BIND_LEXICAL && expr.name === "let")
|
|
18266
18297
|
{ this.raiseRecoverable(expr.start, "let is disallowed as a lexically bound name"); }
|
|
18267
18298
|
if (checkClashes) {
|
|
18268
|
-
if (
|
|
18299
|
+
if (hasOwn(checkClashes, expr.name))
|
|
18269
18300
|
{ this.raiseRecoverable(expr.start, "Argument name clash"); }
|
|
18270
18301
|
checkClashes[expr.name] = true;
|
|
18271
18302
|
}
|
|
@@ -19760,26 +19791,30 @@ var ecma9BinaryProperties = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Ass
|
|
|
19760
19791
|
var ecma10BinaryProperties = ecma9BinaryProperties + " Extended_Pictographic";
|
|
19761
19792
|
var ecma11BinaryProperties = ecma10BinaryProperties;
|
|
19762
19793
|
var ecma12BinaryProperties = ecma11BinaryProperties + " EBase EComp EMod EPres ExtPict";
|
|
19794
|
+
var ecma13BinaryProperties = ecma12BinaryProperties;
|
|
19763
19795
|
var unicodeBinaryProperties = {
|
|
19764
19796
|
9: ecma9BinaryProperties,
|
|
19765
19797
|
10: ecma10BinaryProperties,
|
|
19766
19798
|
11: ecma11BinaryProperties,
|
|
19767
|
-
12: ecma12BinaryProperties
|
|
19799
|
+
12: ecma12BinaryProperties,
|
|
19800
|
+
13: ecma13BinaryProperties
|
|
19768
19801
|
};
|
|
19769
19802
|
|
|
19770
19803
|
// #table-unicode-general-category-values
|
|
19771
19804
|
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";
|
|
19772
19805
|
|
|
19773
19806
|
// #table-unicode-script-values
|
|
19774
|
-
var ecma9ScriptValues = "Adlam Adlm Ahom
|
|
19807
|
+
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";
|
|
19775
19808
|
var ecma10ScriptValues = ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd";
|
|
19776
19809
|
var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho";
|
|
19777
19810
|
var ecma12ScriptValues = ecma11ScriptValues + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi";
|
|
19811
|
+
var ecma13ScriptValues = ecma12ScriptValues + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith";
|
|
19778
19812
|
var unicodeScriptValues = {
|
|
19779
19813
|
9: ecma9ScriptValues,
|
|
19780
19814
|
10: ecma10ScriptValues,
|
|
19781
19815
|
11: ecma11ScriptValues,
|
|
19782
|
-
12: ecma12ScriptValues
|
|
19816
|
+
12: ecma12ScriptValues,
|
|
19817
|
+
13: ecma13ScriptValues
|
|
19783
19818
|
};
|
|
19784
19819
|
|
|
19785
19820
|
var data = {};
|
|
@@ -19797,17 +19832,19 @@ function buildUnicodeData(ecmaVersion) {
|
|
|
19797
19832
|
d.nonBinary.sc = d.nonBinary.Script;
|
|
19798
19833
|
d.nonBinary.scx = d.nonBinary.Script_Extensions;
|
|
19799
19834
|
}
|
|
19800
|
-
|
|
19801
|
-
|
|
19802
|
-
|
|
19803
|
-
|
|
19835
|
+
|
|
19836
|
+
for (var i = 0, list = [9, 10, 11, 12, 13]; i < list.length; i += 1) {
|
|
19837
|
+
var ecmaVersion = list[i];
|
|
19838
|
+
|
|
19839
|
+
buildUnicodeData(ecmaVersion);
|
|
19840
|
+
}
|
|
19804
19841
|
|
|
19805
19842
|
var pp$1 = Parser.prototype;
|
|
19806
19843
|
|
|
19807
19844
|
var RegExpValidationState = function RegExpValidationState(parser) {
|
|
19808
19845
|
this.parser = parser;
|
|
19809
19846
|
this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "") + (parser.options.ecmaVersion >= 13 ? "d" : "");
|
|
19810
|
-
this.unicodeProperties = data[parser.options.ecmaVersion >=
|
|
19847
|
+
this.unicodeProperties = data[parser.options.ecmaVersion >= 13 ? 13 : parser.options.ecmaVersion];
|
|
19811
19848
|
this.source = "";
|
|
19812
19849
|
this.flags = "";
|
|
19813
19850
|
this.start = 0;
|
|
@@ -20606,7 +20643,7 @@ pp$1.regexp_eatUnicodePropertyValueExpression = function(state) {
|
|
|
20606
20643
|
return false
|
|
20607
20644
|
};
|
|
20608
20645
|
pp$1.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) {
|
|
20609
|
-
if (!
|
|
20646
|
+
if (!hasOwn(state.unicodeProperties.nonBinary, name))
|
|
20610
20647
|
{ state.raise("Invalid property name"); }
|
|
20611
20648
|
if (!state.unicodeProperties.nonBinary[name].test(value))
|
|
20612
20649
|
{ state.raise("Invalid property value"); }
|
|
@@ -20958,11 +20995,9 @@ pp.skipBlockComment = function() {
|
|
|
20958
20995
|
if (end === -1) { this.raise(this.pos - 2, "Unterminated comment"); }
|
|
20959
20996
|
this.pos = end + 2;
|
|
20960
20997
|
if (this.options.locations) {
|
|
20961
|
-
|
|
20962
|
-
var match;
|
|
20963
|
-
while ((match = lineBreakG.exec(this.input)) && match.index < this.pos) {
|
|
20998
|
+
for (var nextBreak = (void 0), pos = start; (nextBreak = nextLineBreak(this.input, pos, this.pos)) > -1;) {
|
|
20964
20999
|
++this.curLine;
|
|
20965
|
-
this.lineStart =
|
|
21000
|
+
pos = this.lineStart = nextBreak;
|
|
20966
21001
|
}
|
|
20967
21002
|
}
|
|
20968
21003
|
if (this.options.onComment)
|
|
@@ -21673,7 +21708,7 @@ pp.readWord = function() {
|
|
|
21673
21708
|
|
|
21674
21709
|
// Acorn is a tiny, fast JavaScript parser written in JavaScript.
|
|
21675
21710
|
|
|
21676
|
-
var version = "8.
|
|
21711
|
+
var version = "8.7.0";
|
|
21677
21712
|
|
|
21678
21713
|
Parser.acorn = {
|
|
21679
21714
|
Parser: Parser,
|
|
@@ -21699,7 +21734,7 @@ Parser.acorn = {
|
|
|
21699
21734
|
|
|
21700
21735
|
const readFile = (file) => new Promise((fulfil, reject) => fs.readFile(file, 'utf-8', (err, contents) => (err ? reject(err) : fulfil(contents))));
|
|
21701
21736
|
function mkdirpath(path) {
|
|
21702
|
-
const dir =
|
|
21737
|
+
const dir = require$$0.dirname(path);
|
|
21703
21738
|
fs.mkdirSync(dir, { recursive: true });
|
|
21704
21739
|
}
|
|
21705
21740
|
function writeFile(dest, data) {
|
|
@@ -21717,9 +21752,9 @@ function writeFile(dest, data) {
|
|
|
21717
21752
|
}
|
|
21718
21753
|
|
|
21719
21754
|
class Queue {
|
|
21720
|
-
constructor(maxParallel
|
|
21755
|
+
constructor(maxParallel) {
|
|
21721
21756
|
this.maxParallel = maxParallel;
|
|
21722
|
-
this.queue =
|
|
21757
|
+
this.queue = [];
|
|
21723
21758
|
this.workerCount = 0;
|
|
21724
21759
|
}
|
|
21725
21760
|
run(task) {
|
|
@@ -21779,7 +21814,7 @@ async function resolveId(source, importer, preserveSymlinks, pluginDriver, modul
|
|
|
21779
21814
|
// absolute path is created. Absolute importees therefore shortcircuit the
|
|
21780
21815
|
// resolve call and require no special handing on our part.
|
|
21781
21816
|
// See https://nodejs.org/api/path.html#path_path_resolve_paths
|
|
21782
|
-
return addJsExtensionIfNecessary(importer ?
|
|
21817
|
+
return addJsExtensionIfNecessary(importer ? require$$0.resolve(require$$0.dirname(importer), source) : require$$0.resolve(source), preserveSymlinks);
|
|
21783
21818
|
}
|
|
21784
21819
|
function addJsExtensionIfNecessary(file, preserveSymlinks) {
|
|
21785
21820
|
let found = findFile(file, preserveSymlinks);
|
|
@@ -21798,8 +21833,8 @@ function findFile(file, preserveSymlinks) {
|
|
|
21798
21833
|
return findFile(fs.realpathSync(file), preserveSymlinks);
|
|
21799
21834
|
if ((preserveSymlinks && stats.isSymbolicLink()) || stats.isFile()) {
|
|
21800
21835
|
// check case
|
|
21801
|
-
const name =
|
|
21802
|
-
const files = fs.readdirSync(
|
|
21836
|
+
const name = require$$0.basename(file);
|
|
21837
|
+
const files = fs.readdirSync(require$$0.dirname(file));
|
|
21803
21838
|
if (files.indexOf(name) !== -1)
|
|
21804
21839
|
return file;
|
|
21805
21840
|
}
|
|
@@ -21929,7 +21964,7 @@ function getCacheForUncacheablePlugin(pluginName) {
|
|
|
21929
21964
|
};
|
|
21930
21965
|
}
|
|
21931
21966
|
|
|
21932
|
-
function transform(source, module, pluginDriver, warn) {
|
|
21967
|
+
async function transform(source, module, pluginDriver, warn) {
|
|
21933
21968
|
const id = module.id;
|
|
21934
21969
|
const sourcemapChain = [];
|
|
21935
21970
|
let originalSourcemap = source.map === null ? null : decodedSourcemap(source.map);
|
|
@@ -21939,7 +21974,7 @@ function transform(source, module, pluginDriver, warn) {
|
|
|
21939
21974
|
const emittedFiles = [];
|
|
21940
21975
|
let customTransformCache = false;
|
|
21941
21976
|
const useCustomTransformCache = () => (customTransformCache = true);
|
|
21942
|
-
let
|
|
21977
|
+
let pluginName = '';
|
|
21943
21978
|
const curSource = source.code;
|
|
21944
21979
|
function transformReducer(previousCode, result, plugin) {
|
|
21945
21980
|
let code;
|
|
@@ -21970,92 +22005,94 @@ function transform(source, module, pluginDriver, warn) {
|
|
|
21970
22005
|
}
|
|
21971
22006
|
return code;
|
|
21972
22007
|
}
|
|
21973
|
-
|
|
21974
|
-
|
|
21975
|
-
|
|
21976
|
-
|
|
21977
|
-
|
|
21978
|
-
|
|
21979
|
-
|
|
21980
|
-
|
|
21981
|
-
|
|
21982
|
-
|
|
21983
|
-
|
|
21984
|
-
|
|
21985
|
-
|
|
21986
|
-
|
|
21987
|
-
|
|
21988
|
-
|
|
21989
|
-
|
|
21990
|
-
|
|
21991
|
-
|
|
21992
|
-
|
|
21993
|
-
|
|
21994
|
-
|
|
21995
|
-
|
|
21996
|
-
|
|
21997
|
-
|
|
21998
|
-
|
|
21999
|
-
|
|
22000
|
-
|
|
22001
|
-
|
|
22002
|
-
|
|
22003
|
-
|
|
22004
|
-
|
|
22005
|
-
|
|
22006
|
-
|
|
22007
|
-
|
|
22008
|
-
|
|
22009
|
-
|
|
22010
|
-
|
|
22011
|
-
|
|
22012
|
-
|
|
22013
|
-
originalSourcemap
|
|
22014
|
-
|
|
22008
|
+
let code;
|
|
22009
|
+
try {
|
|
22010
|
+
code = await pluginDriver.hookReduceArg0('transform', [curSource, id], transformReducer, (pluginContext, plugin) => {
|
|
22011
|
+
pluginName = plugin.name;
|
|
22012
|
+
return {
|
|
22013
|
+
...pluginContext,
|
|
22014
|
+
addWatchFile(id) {
|
|
22015
|
+
transformDependencies.push(id);
|
|
22016
|
+
pluginContext.addWatchFile(id);
|
|
22017
|
+
},
|
|
22018
|
+
cache: customTransformCache
|
|
22019
|
+
? pluginContext.cache
|
|
22020
|
+
: getTrackedPluginCache(pluginContext.cache, useCustomTransformCache),
|
|
22021
|
+
emitAsset(name, source) {
|
|
22022
|
+
emittedFiles.push({ name, source, type: 'asset' });
|
|
22023
|
+
return pluginContext.emitAsset(name, source);
|
|
22024
|
+
},
|
|
22025
|
+
emitChunk(id, options) {
|
|
22026
|
+
emittedFiles.push({ id, name: options && options.name, type: 'chunk' });
|
|
22027
|
+
return pluginContext.emitChunk(id, options);
|
|
22028
|
+
},
|
|
22029
|
+
emitFile(emittedFile) {
|
|
22030
|
+
emittedFiles.push(emittedFile);
|
|
22031
|
+
return pluginDriver.emitFile(emittedFile);
|
|
22032
|
+
},
|
|
22033
|
+
error(err, pos) {
|
|
22034
|
+
if (typeof err === 'string')
|
|
22035
|
+
err = { message: err };
|
|
22036
|
+
if (pos)
|
|
22037
|
+
augmentCodeLocation(err, pos, curSource, id);
|
|
22038
|
+
err.id = id;
|
|
22039
|
+
err.hook = 'transform';
|
|
22040
|
+
return pluginContext.error(err);
|
|
22041
|
+
},
|
|
22042
|
+
getCombinedSourcemap() {
|
|
22043
|
+
const combinedMap = collapseSourcemap(id, originalCode, originalSourcemap, sourcemapChain, warn);
|
|
22044
|
+
if (!combinedMap) {
|
|
22045
|
+
const magicString = new MagicString$1(originalCode);
|
|
22046
|
+
return magicString.generateMap({ hires: true, includeContent: true, source: id });
|
|
22047
|
+
}
|
|
22048
|
+
if (originalSourcemap !== combinedMap) {
|
|
22049
|
+
originalSourcemap = combinedMap;
|
|
22050
|
+
sourcemapChain.length = 0;
|
|
22051
|
+
}
|
|
22052
|
+
return new SourceMap({
|
|
22053
|
+
...combinedMap,
|
|
22054
|
+
file: null,
|
|
22055
|
+
sourcesContent: combinedMap.sourcesContent
|
|
22056
|
+
});
|
|
22057
|
+
},
|
|
22058
|
+
setAssetSource() {
|
|
22059
|
+
return this.error({
|
|
22060
|
+
code: 'INVALID_SETASSETSOURCE',
|
|
22061
|
+
message: `setAssetSource cannot be called in transform for caching reasons. Use emitFile with a source, or call setAssetSource in another hook.`
|
|
22062
|
+
});
|
|
22063
|
+
},
|
|
22064
|
+
warn(warning, pos) {
|
|
22065
|
+
if (typeof warning === 'string')
|
|
22066
|
+
warning = { message: warning };
|
|
22067
|
+
if (pos)
|
|
22068
|
+
augmentCodeLocation(warning, pos, curSource, id);
|
|
22069
|
+
warning.id = id;
|
|
22070
|
+
warning.hook = 'transform';
|
|
22071
|
+
pluginContext.warn(warning);
|
|
22015
22072
|
}
|
|
22016
|
-
|
|
22017
|
-
|
|
22018
|
-
|
|
22019
|
-
|
|
22020
|
-
|
|
22021
|
-
|
|
22022
|
-
|
|
22023
|
-
|
|
22024
|
-
|
|
22025
|
-
|
|
22026
|
-
|
|
22027
|
-
|
|
22028
|
-
|
|
22029
|
-
|
|
22030
|
-
|
|
22031
|
-
|
|
22032
|
-
|
|
22033
|
-
|
|
22034
|
-
|
|
22035
|
-
|
|
22036
|
-
}
|
|
22037
|
-
};
|
|
22038
|
-
})
|
|
22039
|
-
.catch(err => throwPluginError(err, curPlugin.name, { hook: 'transform', id }))
|
|
22040
|
-
.then(code => {
|
|
22041
|
-
if (!customTransformCache) {
|
|
22042
|
-
// files emitted by a transform hook need to be emitted again if the hook is skipped
|
|
22043
|
-
if (emittedFiles.length)
|
|
22044
|
-
module.transformFiles = emittedFiles;
|
|
22045
|
-
}
|
|
22046
|
-
return {
|
|
22047
|
-
ast,
|
|
22048
|
-
code,
|
|
22049
|
-
customTransformCache,
|
|
22050
|
-
meta: module.info.meta,
|
|
22051
|
-
originalCode,
|
|
22052
|
-
originalSourcemap,
|
|
22053
|
-
sourcemapChain,
|
|
22054
|
-
transformDependencies
|
|
22055
|
-
};
|
|
22056
|
-
});
|
|
22073
|
+
};
|
|
22074
|
+
});
|
|
22075
|
+
}
|
|
22076
|
+
catch (err) {
|
|
22077
|
+
throwPluginError(err, pluginName, { hook: 'transform', id });
|
|
22078
|
+
}
|
|
22079
|
+
if (!customTransformCache) {
|
|
22080
|
+
// files emitted by a transform hook need to be emitted again if the hook is skipped
|
|
22081
|
+
if (emittedFiles.length)
|
|
22082
|
+
module.transformFiles = emittedFiles;
|
|
22083
|
+
}
|
|
22084
|
+
return {
|
|
22085
|
+
ast,
|
|
22086
|
+
code,
|
|
22087
|
+
customTransformCache,
|
|
22088
|
+
originalCode,
|
|
22089
|
+
originalSourcemap,
|
|
22090
|
+
sourcemapChain,
|
|
22091
|
+
transformDependencies
|
|
22092
|
+
};
|
|
22057
22093
|
}
|
|
22058
22094
|
|
|
22095
|
+
const RESOLVE_DEPENDENCIES = 'resolveDependencies';
|
|
22059
22096
|
class ModuleLoader {
|
|
22060
22097
|
constructor(graph, modulesById, options, pluginDriver) {
|
|
22061
22098
|
this.graph = graph;
|
|
@@ -22068,16 +22105,15 @@ class ModuleLoader {
|
|
|
22068
22105
|
this.moduleLoadPromises = new Map();
|
|
22069
22106
|
this.modulesWithLoadedDependencies = new Set();
|
|
22070
22107
|
this.nextEntryModuleIndex = 0;
|
|
22071
|
-
this.readQueue = new Queue();
|
|
22072
22108
|
this.resolveId = async (source, importer, customOptions, isEntry, skip = null) => {
|
|
22073
|
-
return this.
|
|
22109
|
+
return this.getResolvedIdWithDefaults(this.getNormalizedResolvedIdWithoutDefaults(this.options.external(source, importer, false)
|
|
22074
22110
|
? false
|
|
22075
22111
|
: await resolveId(source, importer, this.options.preserveSymlinks, this.pluginDriver, this.resolveId, skip, customOptions, typeof isEntry === 'boolean' ? isEntry : !importer), importer, source));
|
|
22076
22112
|
};
|
|
22077
22113
|
this.hasModuleSideEffects = options.treeshake
|
|
22078
22114
|
? options.treeshake.moduleSideEffects
|
|
22079
22115
|
: () => true;
|
|
22080
|
-
this.readQueue
|
|
22116
|
+
this.readQueue = new Queue(options.maxParallelFileReads);
|
|
22081
22117
|
}
|
|
22082
22118
|
async addAdditionalModules(unresolvedModules) {
|
|
22083
22119
|
const result = this.extendLoadModulesPromise(Promise.all(unresolvedModules.map(id => this.loadEntryModule(id, false, undefined, null))));
|
|
@@ -22128,22 +22164,9 @@ class ModuleLoader {
|
|
|
22128
22164
|
}
|
|
22129
22165
|
return module;
|
|
22130
22166
|
}
|
|
22131
|
-
preloadModule(resolvedId) {
|
|
22132
|
-
|
|
22133
|
-
|
|
22134
|
-
addDefaultsToResolvedId(resolvedId) {
|
|
22135
|
-
var _a, _b;
|
|
22136
|
-
if (!resolvedId) {
|
|
22137
|
-
return null;
|
|
22138
|
-
}
|
|
22139
|
-
const external = resolvedId.external || false;
|
|
22140
|
-
return {
|
|
22141
|
-
external,
|
|
22142
|
-
id: resolvedId.id,
|
|
22143
|
-
meta: resolvedId.meta || EMPTY_OBJECT,
|
|
22144
|
-
moduleSideEffects: (_a = resolvedId.moduleSideEffects) !== null && _a !== void 0 ? _a : this.hasModuleSideEffects(resolvedId.id, !!external),
|
|
22145
|
-
syntheticNamedExports: (_b = resolvedId.syntheticNamedExports) !== null && _b !== void 0 ? _b : false
|
|
22146
|
-
};
|
|
22167
|
+
async preloadModule(resolvedId) {
|
|
22168
|
+
const module = await this.fetchModule(this.getResolvedIdWithDefaults(resolvedId), undefined, false, resolvedId.resolveDependencies ? RESOLVE_DEPENDENCIES : true);
|
|
22169
|
+
return module.info;
|
|
22147
22170
|
}
|
|
22148
22171
|
addEntryWithImplicitDependants(unresolvedModule, implicitlyLoadedAfter) {
|
|
22149
22172
|
return this.extendLoadModulesPromise(this.loadEntryModule(unresolvedModule.id, false, unresolvedModule.importer, null).then(async (entryModule) => {
|
|
@@ -22179,13 +22202,23 @@ class ModuleLoader {
|
|
|
22179
22202
|
timeEnd('load modules', 3);
|
|
22180
22203
|
const sourceDescription = typeof source === 'string'
|
|
22181
22204
|
? { code: source }
|
|
22182
|
-
: typeof source === 'object' && typeof source.code === 'string'
|
|
22205
|
+
: source != null && typeof source === 'object' && typeof source.code === 'string'
|
|
22183
22206
|
? source
|
|
22184
22207
|
: error(errBadLoader(id));
|
|
22185
22208
|
const cachedModule = this.graph.cachedModules.get(id);
|
|
22186
22209
|
if (cachedModule &&
|
|
22187
22210
|
!cachedModule.customTransformCache &&
|
|
22188
|
-
cachedModule.originalCode === sourceDescription.code
|
|
22211
|
+
cachedModule.originalCode === sourceDescription.code &&
|
|
22212
|
+
!(await this.pluginDriver.hookFirst('shouldTransformCachedModule', [
|
|
22213
|
+
{
|
|
22214
|
+
ast: cachedModule.ast,
|
|
22215
|
+
code: cachedModule.code,
|
|
22216
|
+
id: cachedModule.id,
|
|
22217
|
+
meta: cachedModule.meta,
|
|
22218
|
+
moduleSideEffects: cachedModule.moduleSideEffects,
|
|
22219
|
+
syntheticNamedExports: cachedModule.syntheticNamedExports
|
|
22220
|
+
}
|
|
22221
|
+
]))) {
|
|
22189
22222
|
if (cachedModule.transformFiles) {
|
|
22190
22223
|
for (const emittedFile of cachedModule.transformFiles)
|
|
22191
22224
|
this.pluginDriver.emitFile(emittedFile);
|
|
@@ -22248,9 +22281,7 @@ class ModuleLoader {
|
|
|
22248
22281
|
this.getResolveDynamicImportPromises(module),
|
|
22249
22282
|
loadAndResolveDependenciesPromise
|
|
22250
22283
|
]);
|
|
22251
|
-
const loadAndResolveDependenciesPromise = loadPromise
|
|
22252
|
-
.then(([resolveStaticDependencyPromises, resolveDynamicImportPromises]) => Promise.all([...resolveStaticDependencyPromises, ...resolveDynamicImportPromises]))
|
|
22253
|
-
.then(() => this.pluginDriver.hookParallel('moduleParsed', [module.info]));
|
|
22284
|
+
const loadAndResolveDependenciesPromise = waitForDependencyResolution(loadPromise).then(() => this.pluginDriver.hookParallel('moduleParsed', [module.info]));
|
|
22254
22285
|
loadAndResolveDependenciesPromise.catch(() => {
|
|
22255
22286
|
/* avoid unhandled promise rejections */
|
|
22256
22287
|
});
|
|
@@ -22259,6 +22290,9 @@ class ModuleLoader {
|
|
|
22259
22290
|
if (!isPreload) {
|
|
22260
22291
|
await this.fetchModuleDependencies(module, ...resolveDependencyPromises);
|
|
22261
22292
|
}
|
|
22293
|
+
else if (isPreload === RESOLVE_DEPENDENCIES) {
|
|
22294
|
+
await loadAndResolveDependenciesPromise;
|
|
22295
|
+
}
|
|
22262
22296
|
return module;
|
|
22263
22297
|
}
|
|
22264
22298
|
async fetchModuleDependencies(module, resolveStaticDependencyPromises, resolveDynamicDependencyPromises, loadAndResolveDependenciesPromise) {
|
|
@@ -22358,10 +22392,26 @@ class ModuleLoader {
|
|
|
22358
22392
|
this.handleResolveId(await this.resolveId(source, module.id, EMPTY_OBJECT, false), source, module.id))
|
|
22359
22393
|
]);
|
|
22360
22394
|
}
|
|
22395
|
+
getResolvedIdWithDefaults(resolvedId) {
|
|
22396
|
+
var _a, _b;
|
|
22397
|
+
if (!resolvedId) {
|
|
22398
|
+
return null;
|
|
22399
|
+
}
|
|
22400
|
+
const external = resolvedId.external || false;
|
|
22401
|
+
return {
|
|
22402
|
+
external,
|
|
22403
|
+
id: resolvedId.id,
|
|
22404
|
+
meta: resolvedId.meta || {},
|
|
22405
|
+
moduleSideEffects: (_a = resolvedId.moduleSideEffects) !== null && _a !== void 0 ? _a : this.hasModuleSideEffects(resolvedId.id, !!external),
|
|
22406
|
+
syntheticNamedExports: (_b = resolvedId.syntheticNamedExports) !== null && _b !== void 0 ? _b : false
|
|
22407
|
+
};
|
|
22408
|
+
}
|
|
22361
22409
|
async handleExistingModule(module, isEntry, isPreload) {
|
|
22362
22410
|
const loadPromise = this.moduleLoadPromises.get(module);
|
|
22363
22411
|
if (isPreload) {
|
|
22364
|
-
return
|
|
22412
|
+
return isPreload === RESOLVE_DEPENDENCIES
|
|
22413
|
+
? waitForDependencyResolution(loadPromise)
|
|
22414
|
+
: loadPromise;
|
|
22365
22415
|
}
|
|
22366
22416
|
if (isEntry) {
|
|
22367
22417
|
module.info.isEntry = true;
|
|
@@ -22382,7 +22432,7 @@ class ModuleLoader {
|
|
|
22382
22432
|
return {
|
|
22383
22433
|
external: true,
|
|
22384
22434
|
id: source,
|
|
22385
|
-
meta:
|
|
22435
|
+
meta: {},
|
|
22386
22436
|
moduleSideEffects: this.hasModuleSideEffects(source, true),
|
|
22387
22437
|
syntheticNamedExports: false
|
|
22388
22438
|
};
|
|
@@ -22407,7 +22457,7 @@ class ModuleLoader {
|
|
|
22407
22457
|
? errEntryCannotBeExternal(unresolvedId)
|
|
22408
22458
|
: errImplicitDependantCannotBeExternal(unresolvedId, implicitlyLoadedBefore));
|
|
22409
22459
|
}
|
|
22410
|
-
return this.fetchModule(this.
|
|
22460
|
+
return this.fetchModule(this.getResolvedIdWithDefaults(typeof resolveIdResult === 'object'
|
|
22411
22461
|
? resolveIdResult
|
|
22412
22462
|
: { id: resolveIdResult }), undefined, isEntry, false);
|
|
22413
22463
|
}
|
|
@@ -22434,14 +22484,14 @@ class ModuleLoader {
|
|
|
22434
22484
|
module.resolvedIds[specifier] ||
|
|
22435
22485
|
this.handleResolveId(await this.resolveId(specifier, module.id, EMPTY_OBJECT, false), specifier, module.id));
|
|
22436
22486
|
}
|
|
22437
|
-
return this.handleResolveId(this.
|
|
22487
|
+
return this.handleResolveId(this.getResolvedIdWithDefaults(this.getNormalizedResolvedIdWithoutDefaults(resolution, importer, specifier)), specifier, importer);
|
|
22438
22488
|
}
|
|
22439
22489
|
}
|
|
22440
22490
|
function normalizeRelativeExternalId(source, importer) {
|
|
22441
22491
|
return isRelative(source)
|
|
22442
22492
|
? importer
|
|
22443
|
-
?
|
|
22444
|
-
:
|
|
22493
|
+
? require$$0.resolve(importer, '..', source)
|
|
22494
|
+
: require$$0.resolve(source)
|
|
22445
22495
|
: source;
|
|
22446
22496
|
}
|
|
22447
22497
|
function addChunkNamesToModule(module, { fileName, name }, isUserDefined) {
|
|
@@ -22462,6 +22512,10 @@ function isNotAbsoluteExternal(id, source, makeAbsoluteExternalsRelative) {
|
|
|
22462
22512
|
(makeAbsoluteExternalsRelative === 'ifRelativeSource' && isRelative(source)) ||
|
|
22463
22513
|
!isAbsolute(id));
|
|
22464
22514
|
}
|
|
22515
|
+
async function waitForDependencyResolution(loadPromise) {
|
|
22516
|
+
const [resolveStaticDependencyPromises, resolveDynamicImportPromises] = await loadPromise;
|
|
22517
|
+
return Promise.all([...resolveStaticDependencyPromises, ...resolveDynamicImportPromises]);
|
|
22518
|
+
}
|
|
22465
22519
|
|
|
22466
22520
|
class GlobalScope extends Scope$1 {
|
|
22467
22521
|
constructor() {
|
|
@@ -22577,6 +22631,40 @@ function getPluginContext(plugin, pluginCache, graph, options, fileEmitter, exis
|
|
|
22577
22631
|
return context;
|
|
22578
22632
|
}
|
|
22579
22633
|
|
|
22634
|
+
const unfulfilledActions = new Set();
|
|
22635
|
+
function addUnresolvedAction(actionTuple) {
|
|
22636
|
+
unfulfilledActions.add(actionTuple);
|
|
22637
|
+
}
|
|
22638
|
+
function resolveAction(actionTuple) {
|
|
22639
|
+
unfulfilledActions.delete(actionTuple);
|
|
22640
|
+
}
|
|
22641
|
+
function formatAction([pluginName, hookName, args]) {
|
|
22642
|
+
let action = `(${pluginName}) ${hookName}`;
|
|
22643
|
+
const s = JSON.stringify;
|
|
22644
|
+
switch (hookName) {
|
|
22645
|
+
case 'resolveId':
|
|
22646
|
+
action += ` ${s(args[0])} ${s(args[1])}`;
|
|
22647
|
+
break;
|
|
22648
|
+
case 'load':
|
|
22649
|
+
action += ` ${s(args[0])}`;
|
|
22650
|
+
break;
|
|
22651
|
+
case 'transform':
|
|
22652
|
+
action += ` ${s(args[1])}`;
|
|
22653
|
+
break;
|
|
22654
|
+
}
|
|
22655
|
+
return action;
|
|
22656
|
+
}
|
|
22657
|
+
process.on('exit', () => {
|
|
22658
|
+
if (unfulfilledActions.size) {
|
|
22659
|
+
let err = '[!] Error: unfinished hook action(s) on exit:\n';
|
|
22660
|
+
for (const action of unfulfilledActions) {
|
|
22661
|
+
err += formatAction(action) + '\n';
|
|
22662
|
+
}
|
|
22663
|
+
console.error('%s', err);
|
|
22664
|
+
process.exit(1);
|
|
22665
|
+
}
|
|
22666
|
+
});
|
|
22667
|
+
|
|
22580
22668
|
const inputHookNames = {
|
|
22581
22669
|
buildEnd: 1,
|
|
22582
22670
|
buildStart: 1,
|
|
@@ -22587,6 +22675,7 @@ const inputHookNames = {
|
|
|
22587
22675
|
options: 1,
|
|
22588
22676
|
resolveDynamicImport: 1,
|
|
22589
22677
|
resolveId: 1,
|
|
22678
|
+
shouldTransformCachedModule: 1,
|
|
22590
22679
|
transform: 1,
|
|
22591
22680
|
watchChange: 1
|
|
22592
22681
|
};
|
|
@@ -22728,6 +22817,7 @@ class PluginDriver {
|
|
|
22728
22817
|
if (hookContext) {
|
|
22729
22818
|
context = hookContext(context, plugin);
|
|
22730
22819
|
}
|
|
22820
|
+
let action = null;
|
|
22731
22821
|
return Promise.resolve()
|
|
22732
22822
|
.then(() => {
|
|
22733
22823
|
// permit values allows values to be returned instead of a functional hook
|
|
@@ -22737,9 +22827,35 @@ class PluginDriver {
|
|
|
22737
22827
|
return throwInvalidHookError(hookName, plugin.name);
|
|
22738
22828
|
}
|
|
22739
22829
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
22740
|
-
|
|
22830
|
+
const hookResult = hook.apply(context, args);
|
|
22831
|
+
if (!hookResult || !hookResult.then) {
|
|
22832
|
+
// short circuit for non-thenables and non-Promises
|
|
22833
|
+
return hookResult;
|
|
22834
|
+
}
|
|
22835
|
+
// Track pending hook actions to properly error out when
|
|
22836
|
+
// unfulfilled promises cause rollup to abruptly and confusingly
|
|
22837
|
+
// exit with a successful 0 return code but without producing any
|
|
22838
|
+
// output, errors or warnings.
|
|
22839
|
+
action = [plugin.name, hookName, args];
|
|
22840
|
+
addUnresolvedAction(action);
|
|
22841
|
+
// Although it would be more elegant to just return hookResult here
|
|
22842
|
+
// and put the .then() handler just above the .catch() handler below,
|
|
22843
|
+
// doing so would subtly change the defacto async event dispatch order
|
|
22844
|
+
// which at least one test and some plugins in the wild may depend on.
|
|
22845
|
+
const promise = Promise.resolve(hookResult);
|
|
22846
|
+
return promise.then(() => {
|
|
22847
|
+
// action was fulfilled
|
|
22848
|
+
resolveAction(action);
|
|
22849
|
+
return promise;
|
|
22850
|
+
});
|
|
22741
22851
|
})
|
|
22742
|
-
.catch(err =>
|
|
22852
|
+
.catch(err => {
|
|
22853
|
+
if (action !== null) {
|
|
22854
|
+
// action considered to be fulfilled since error being handled
|
|
22855
|
+
resolveAction(action);
|
|
22856
|
+
}
|
|
22857
|
+
return throwPluginError(err, plugin.name, { hook: hookName });
|
|
22858
|
+
});
|
|
22743
22859
|
}
|
|
22744
22860
|
/**
|
|
22745
22861
|
* Run a sync plugin hook and return the result.
|
|
@@ -23104,7 +23220,7 @@ const getModuleContext = (config, context) => {
|
|
|
23104
23220
|
if (configModuleContext) {
|
|
23105
23221
|
const contextByModuleId = Object.create(null);
|
|
23106
23222
|
for (const [key, moduleContext] of Object.entries(configModuleContext)) {
|
|
23107
|
-
contextByModuleId[
|
|
23223
|
+
contextByModuleId[require$$0.resolve(key)] = moduleContext;
|
|
23108
23224
|
}
|
|
23109
23225
|
return id => contextByModuleId[id] || context;
|
|
23110
23226
|
}
|
|
@@ -23310,7 +23426,7 @@ const getPreserveModulesRoot = (config) => {
|
|
|
23310
23426
|
if (preserveModulesRoot === null || preserveModulesRoot === undefined) {
|
|
23311
23427
|
return undefined;
|
|
23312
23428
|
}
|
|
23313
|
-
return
|
|
23429
|
+
return require$$0.resolve(preserveModulesRoot);
|
|
23314
23430
|
};
|
|
23315
23431
|
const getAmd = (config) => {
|
|
23316
23432
|
const mergedOption = {
|
|
@@ -23582,7 +23698,7 @@ function getSortingFileType(file) {
|
|
|
23582
23698
|
return SortingFileType.SECONDARY_CHUNK;
|
|
23583
23699
|
}
|
|
23584
23700
|
function writeOutputFile(outputFile, outputOptions) {
|
|
23585
|
-
const fileName =
|
|
23701
|
+
const fileName = require$$0.resolve(outputOptions.dir || require$$0.dirname(outputOptions.file), outputFile.fileName);
|
|
23586
23702
|
let writeSourceMapPromise;
|
|
23587
23703
|
let source;
|
|
23588
23704
|
if (outputFile.type === 'asset') {
|
|
@@ -23596,11 +23712,11 @@ function writeOutputFile(outputFile, outputOptions) {
|
|
|
23596
23712
|
url = outputFile.map.toUrl();
|
|
23597
23713
|
}
|
|
23598
23714
|
else {
|
|
23599
|
-
url = `${
|
|
23715
|
+
url = `${require$$0.basename(outputFile.fileName)}.map`;
|
|
23600
23716
|
writeSourceMapPromise = writeFile(`${fileName}.map`, outputFile.map.toString());
|
|
23601
23717
|
}
|
|
23602
23718
|
if (outputOptions.sourcemap !== 'hidden') {
|
|
23603
|
-
source += `//# ${SOURCEMAPPING_URL}=${url}\n`;
|
|
23719
|
+
source += `//# ${exports.SOURCEMAPPING_URL}=${url}\n`;
|
|
23604
23720
|
}
|
|
23605
23721
|
}
|
|
23606
23722
|
}
|
|
@@ -23615,7 +23731,7 @@ function defineConfig(options) {
|
|
|
23615
23731
|
return options;
|
|
23616
23732
|
}
|
|
23617
23733
|
|
|
23618
|
-
class WatchEmitter extends require$$0.EventEmitter {
|
|
23734
|
+
class WatchEmitter extends require$$0$1.EventEmitter {
|
|
23619
23735
|
constructor() {
|
|
23620
23736
|
super();
|
|
23621
23737
|
// Allows more than 10 bundles to be watched without
|
|
@@ -23649,6 +23765,7 @@ exports.getAliasName = getAliasName;
|
|
|
23649
23765
|
exports.getAugmentedNamespace = getAugmentedNamespace;
|
|
23650
23766
|
exports.getOrCreate = getOrCreate;
|
|
23651
23767
|
exports.loadFsEvents = loadFsEvents;
|
|
23768
|
+
exports.objectifyOption = objectifyOption;
|
|
23652
23769
|
exports.objectifyOptionWithPresets = objectifyOptionWithPresets;
|
|
23653
23770
|
exports.picomatch = picomatch;
|
|
23654
23771
|
exports.printQuotedStringList = printQuotedStringList;
|