rollup 2.61.1 → 2.65.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 +96 -0
- 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 +453 -294
- package/dist/es/shared/watch.js +31 -19
- 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 +21 -3
- package/dist/rollup.js +4 -2
- package/dist/shared/index.js +24 -14
- package/dist/shared/loadConfigFile.js +10 -11
- package/dist/shared/mergeOptions.js +12 -5
- package/dist/shared/rollup.js +502 -340
- package/dist/shared/watch-cli.js +21 -30
- package/dist/shared/watch.js +8 -18
- package/package.json +18 -20
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.65.0
|
|
4
|
+
Fri, 21 Jan 2022 07:42:35 GMT - commit bebc50ddb613d240a03988d51787fd71b1a3914f
|
|
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.65.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 = [];
|
|
@@ -1645,20 +1647,70 @@ const BLANK = Object.freeze(Object.create(null));
|
|
|
1645
1647
|
const EMPTY_OBJECT = Object.freeze({});
|
|
1646
1648
|
const EMPTY_ARRAY = Object.freeze([]);
|
|
1647
1649
|
|
|
1648
|
-
const
|
|
1649
|
-
|
|
1650
|
-
|
|
1650
|
+
const RESERVED_NAMES = new Set([
|
|
1651
|
+
'await',
|
|
1652
|
+
'break',
|
|
1653
|
+
'case',
|
|
1654
|
+
'catch',
|
|
1655
|
+
'class',
|
|
1656
|
+
'const',
|
|
1657
|
+
'continue',
|
|
1658
|
+
'debugger',
|
|
1659
|
+
'default',
|
|
1660
|
+
'delete',
|
|
1661
|
+
'do',
|
|
1662
|
+
'else',
|
|
1663
|
+
'enum',
|
|
1664
|
+
'eval',
|
|
1665
|
+
'export',
|
|
1666
|
+
'extends',
|
|
1667
|
+
'false',
|
|
1668
|
+
'finally',
|
|
1669
|
+
'for',
|
|
1670
|
+
'function',
|
|
1671
|
+
'if',
|
|
1672
|
+
'implements',
|
|
1673
|
+
'import',
|
|
1674
|
+
'in',
|
|
1675
|
+
'instanceof',
|
|
1676
|
+
'interface',
|
|
1677
|
+
'let',
|
|
1678
|
+
'NaN',
|
|
1679
|
+
'new',
|
|
1680
|
+
'null',
|
|
1681
|
+
'package',
|
|
1682
|
+
'private',
|
|
1683
|
+
'protected',
|
|
1684
|
+
'public',
|
|
1685
|
+
'return',
|
|
1686
|
+
'static',
|
|
1687
|
+
'super',
|
|
1688
|
+
'switch',
|
|
1689
|
+
'this',
|
|
1690
|
+
'throw',
|
|
1691
|
+
'true',
|
|
1692
|
+
'try',
|
|
1693
|
+
'typeof',
|
|
1694
|
+
'undefined',
|
|
1695
|
+
'var',
|
|
1696
|
+
'void',
|
|
1697
|
+
'while',
|
|
1698
|
+
'with',
|
|
1699
|
+
'yield'
|
|
1700
|
+
]);
|
|
1701
|
+
const RESERVED_NAMES$1 = RESERVED_NAMES;
|
|
1702
|
+
|
|
1651
1703
|
const illegalCharacters = /[^$_a-zA-Z0-9]/g;
|
|
1652
1704
|
const startsWithDigit = (str) => /\d/.test(str[0]);
|
|
1653
1705
|
function isLegal(str) {
|
|
1654
|
-
if (startsWithDigit(str) ||
|
|
1706
|
+
if (startsWithDigit(str) || RESERVED_NAMES$1.has(str)) {
|
|
1655
1707
|
return false;
|
|
1656
1708
|
}
|
|
1657
1709
|
return !illegalCharacters.test(str);
|
|
1658
1710
|
}
|
|
1659
1711
|
function makeLegal(str) {
|
|
1660
1712
|
str = str.replace(/-(\w)/g, (_, letter) => letter.toUpperCase()).replace(illegalCharacters, '_');
|
|
1661
|
-
if (startsWithDigit(str) ||
|
|
1713
|
+
if (startsWithDigit(str) || RESERVED_NAMES$1.has(str))
|
|
1662
1714
|
str = `_${str}`;
|
|
1663
1715
|
return str || '_';
|
|
1664
1716
|
}
|
|
@@ -1726,6 +1778,7 @@ class ExternalModule {
|
|
|
1726
1778
|
this.info = {
|
|
1727
1779
|
ast: null,
|
|
1728
1780
|
code: null,
|
|
1781
|
+
dynamicallyImportedIdResolutions: EMPTY_ARRAY,
|
|
1729
1782
|
dynamicallyImportedIds: EMPTY_ARRAY,
|
|
1730
1783
|
get dynamicImporters() {
|
|
1731
1784
|
return dynamicImporters.sort();
|
|
@@ -1734,12 +1787,14 @@ class ExternalModule {
|
|
|
1734
1787
|
id,
|
|
1735
1788
|
implicitlyLoadedAfterOneOf: EMPTY_ARRAY,
|
|
1736
1789
|
implicitlyLoadedBefore: EMPTY_ARRAY,
|
|
1790
|
+
importedIdResolutions: EMPTY_ARRAY,
|
|
1737
1791
|
importedIds: EMPTY_ARRAY,
|
|
1738
1792
|
get importers() {
|
|
1739
1793
|
return importers.sort();
|
|
1740
1794
|
},
|
|
1741
1795
|
isEntry: false,
|
|
1742
1796
|
isExternal: true,
|
|
1797
|
+
isIncluded: null,
|
|
1743
1798
|
meta,
|
|
1744
1799
|
syntheticNamedExports: false
|
|
1745
1800
|
};
|
|
@@ -1798,9 +1853,24 @@ class ExternalModule {
|
|
|
1798
1853
|
}
|
|
1799
1854
|
}
|
|
1800
1855
|
|
|
1856
|
+
function getAugmentedNamespace(n) {
|
|
1857
|
+
if (n.__esModule) return n;
|
|
1858
|
+
var a = Object.defineProperty({}, '__esModule', {value: true});
|
|
1859
|
+
Object.keys(n).forEach(function (k) {
|
|
1860
|
+
var d = Object.getOwnPropertyDescriptor(n, k);
|
|
1861
|
+
Object.defineProperty(a, k, d.get ? d : {
|
|
1862
|
+
enumerable: true,
|
|
1863
|
+
get: function () {
|
|
1864
|
+
return n[k];
|
|
1865
|
+
}
|
|
1866
|
+
});
|
|
1867
|
+
});
|
|
1868
|
+
return a;
|
|
1869
|
+
}
|
|
1870
|
+
|
|
1801
1871
|
var utils$3 = {};
|
|
1802
1872
|
|
|
1803
|
-
const path$1 = require$$
|
|
1873
|
+
const path$1 = require$$0;
|
|
1804
1874
|
const WIN_SLASH = '\\\\/';
|
|
1805
1875
|
const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
1806
1876
|
|
|
@@ -1980,7 +2050,7 @@ var constants$2 = {
|
|
|
1980
2050
|
|
|
1981
2051
|
(function (exports) {
|
|
1982
2052
|
|
|
1983
|
-
const path = require$$
|
|
2053
|
+
const path = require$$0;
|
|
1984
2054
|
const win32 = process.platform === 'win32';
|
|
1985
2055
|
const {
|
|
1986
2056
|
REGEX_BACKSLASH,
|
|
@@ -2677,7 +2747,14 @@ const parse$1 = (input, options) => {
|
|
|
2677
2747
|
}
|
|
2678
2748
|
|
|
2679
2749
|
if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
|
|
2680
|
-
|
|
2750
|
+
// Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis.
|
|
2751
|
+
// In this case, we need to parse the string and use it in the output of the original pattern.
|
|
2752
|
+
// Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`.
|
|
2753
|
+
//
|
|
2754
|
+
// Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`.
|
|
2755
|
+
const expression = parse$1(rest, { ...options, fastpaths: false }).output;
|
|
2756
|
+
|
|
2757
|
+
output = token.close = `)${expression})${extglobStar})`;
|
|
2681
2758
|
}
|
|
2682
2759
|
|
|
2683
2760
|
if (token.prev.type === 'bos') {
|
|
@@ -3510,7 +3587,7 @@ parse$1.fastpaths = (input, options) => {
|
|
|
3510
3587
|
|
|
3511
3588
|
var parse_1 = parse$1;
|
|
3512
3589
|
|
|
3513
|
-
const path = require$$
|
|
3590
|
+
const path = require$$0;
|
|
3514
3591
|
const scan = scan_1;
|
|
3515
3592
|
const parse = parse_1;
|
|
3516
3593
|
const utils = utils$3;
|
|
@@ -5023,8 +5100,6 @@ const knownGlobals = {
|
|
|
5023
5100
|
__proto__: null,
|
|
5024
5101
|
[ValueProperties]: PURE,
|
|
5025
5102
|
create: PF,
|
|
5026
|
-
getNotifier: PF,
|
|
5027
|
-
getOwn: PF,
|
|
5028
5103
|
getOwnPropertyDescriptor: PF,
|
|
5029
5104
|
getOwnPropertyNames: PF,
|
|
5030
5105
|
getOwnPropertySymbols: PF,
|
|
@@ -6066,61 +6141,10 @@ function toBase64(num) {
|
|
|
6066
6141
|
return outStr;
|
|
6067
6142
|
}
|
|
6068
6143
|
|
|
6069
|
-
const RESERVED_NAMES = new Set([
|
|
6070
|
-
'await',
|
|
6071
|
-
'break',
|
|
6072
|
-
'case',
|
|
6073
|
-
'catch',
|
|
6074
|
-
'class',
|
|
6075
|
-
'const',
|
|
6076
|
-
'continue',
|
|
6077
|
-
'debugger',
|
|
6078
|
-
'default',
|
|
6079
|
-
'delete',
|
|
6080
|
-
'do',
|
|
6081
|
-
'else',
|
|
6082
|
-
'enum',
|
|
6083
|
-
'eval',
|
|
6084
|
-
'export',
|
|
6085
|
-
'extends',
|
|
6086
|
-
'false',
|
|
6087
|
-
'finally',
|
|
6088
|
-
'for',
|
|
6089
|
-
'function',
|
|
6090
|
-
'if',
|
|
6091
|
-
'implements',
|
|
6092
|
-
'import',
|
|
6093
|
-
'in',
|
|
6094
|
-
'instanceof',
|
|
6095
|
-
'interface',
|
|
6096
|
-
'let',
|
|
6097
|
-
'new',
|
|
6098
|
-
'null',
|
|
6099
|
-
'package',
|
|
6100
|
-
'private',
|
|
6101
|
-
'protected',
|
|
6102
|
-
'public',
|
|
6103
|
-
'return',
|
|
6104
|
-
'static',
|
|
6105
|
-
'super',
|
|
6106
|
-
'switch',
|
|
6107
|
-
'this',
|
|
6108
|
-
'throw',
|
|
6109
|
-
'true',
|
|
6110
|
-
'try',
|
|
6111
|
-
'typeof',
|
|
6112
|
-
'undefined',
|
|
6113
|
-
'var',
|
|
6114
|
-
'void',
|
|
6115
|
-
'while',
|
|
6116
|
-
'with',
|
|
6117
|
-
'yield'
|
|
6118
|
-
]);
|
|
6119
|
-
|
|
6120
6144
|
function getSafeName(baseName, usedNames) {
|
|
6121
6145
|
let safeName = baseName;
|
|
6122
6146
|
let count = 1;
|
|
6123
|
-
while (usedNames.has(safeName) || RESERVED_NAMES.has(safeName)) {
|
|
6147
|
+
while (usedNames.has(safeName) || RESERVED_NAMES$1.has(safeName)) {
|
|
6124
6148
|
safeName = `${baseName}$${toBase64(count++)}`;
|
|
6125
6149
|
}
|
|
6126
6150
|
usedNames.add(safeName);
|
|
@@ -6231,16 +6255,27 @@ const literalNumberMembers = assembleMemberDescriptions({
|
|
|
6231
6255
|
valueOf: returnsNumber
|
|
6232
6256
|
}, objectMembers);
|
|
6233
6257
|
const literalStringMembers = assembleMemberDescriptions({
|
|
6258
|
+
anchor: returnsString,
|
|
6259
|
+
at: returnsUnknown,
|
|
6260
|
+
big: returnsString,
|
|
6261
|
+
blink: returnsString,
|
|
6262
|
+
bold: returnsString,
|
|
6234
6263
|
charAt: returnsString,
|
|
6235
6264
|
charCodeAt: returnsNumber,
|
|
6236
|
-
codePointAt:
|
|
6265
|
+
codePointAt: returnsUnknown,
|
|
6237
6266
|
concat: returnsString,
|
|
6238
6267
|
endsWith: returnsBoolean,
|
|
6268
|
+
fixed: returnsString,
|
|
6269
|
+
fontcolor: returnsString,
|
|
6270
|
+
fontsize: returnsString,
|
|
6239
6271
|
includes: returnsBoolean,
|
|
6240
6272
|
indexOf: returnsNumber,
|
|
6273
|
+
italics: returnsString,
|
|
6241
6274
|
lastIndexOf: returnsNumber,
|
|
6275
|
+
link: returnsString,
|
|
6242
6276
|
localeCompare: returnsNumber,
|
|
6243
|
-
match:
|
|
6277
|
+
match: returnsUnknown,
|
|
6278
|
+
matchAll: returnsUnknown,
|
|
6244
6279
|
normalize: returnsString,
|
|
6245
6280
|
padEnd: returnsString,
|
|
6246
6281
|
padStart: returnsString,
|
|
@@ -6251,17 +6286,32 @@ const literalStringMembers = assembleMemberDescriptions({
|
|
|
6251
6286
|
returns: UNKNOWN_LITERAL_STRING
|
|
6252
6287
|
}
|
|
6253
6288
|
},
|
|
6289
|
+
replaceAll: {
|
|
6290
|
+
value: {
|
|
6291
|
+
callsArgs: [1],
|
|
6292
|
+
returns: UNKNOWN_LITERAL_STRING
|
|
6293
|
+
}
|
|
6294
|
+
},
|
|
6254
6295
|
search: returnsNumber,
|
|
6255
6296
|
slice: returnsString,
|
|
6297
|
+
small: returnsString,
|
|
6256
6298
|
split: returnsUnknown,
|
|
6257
6299
|
startsWith: returnsBoolean,
|
|
6300
|
+
strike: returnsString,
|
|
6301
|
+
sub: returnsString,
|
|
6258
6302
|
substr: returnsString,
|
|
6259
6303
|
substring: returnsString,
|
|
6304
|
+
sup: returnsString,
|
|
6260
6305
|
toLocaleLowerCase: returnsString,
|
|
6261
6306
|
toLocaleUpperCase: returnsString,
|
|
6262
6307
|
toLowerCase: returnsString,
|
|
6308
|
+
toString: returnsString,
|
|
6263
6309
|
toUpperCase: returnsString,
|
|
6264
6310
|
trim: returnsString,
|
|
6311
|
+
trimEnd: returnsString,
|
|
6312
|
+
trimLeft: returnsString,
|
|
6313
|
+
trimRight: returnsString,
|
|
6314
|
+
trimStart: returnsString,
|
|
6265
6315
|
valueOf: returnsString
|
|
6266
6316
|
}, objectMembers);
|
|
6267
6317
|
function getLiteralMembersForValue(value) {
|
|
@@ -8077,6 +8127,10 @@ const ARRAY_PROTOTYPE = new ObjectEntity({
|
|
|
8077
8127
|
filter: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NEW_ARRAY,
|
|
8078
8128
|
find: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN,
|
|
8079
8129
|
findIndex: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NUMBER,
|
|
8130
|
+
findLast: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN,
|
|
8131
|
+
findLastIndex: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NUMBER,
|
|
8132
|
+
flat: METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY,
|
|
8133
|
+
flatMap: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NEW_ARRAY,
|
|
8080
8134
|
forEach: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN,
|
|
8081
8135
|
includes: METHOD_RETURNS_BOOLEAN,
|
|
8082
8136
|
indexOf: METHOD_RETURNS_NUMBER,
|
|
@@ -8094,6 +8148,8 @@ const ARRAY_PROTOTYPE = new ObjectEntity({
|
|
|
8094
8148
|
some: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_BOOLEAN,
|
|
8095
8149
|
sort: METHOD_CALLS_ARG_MUTATES_SELF_RETURNS_SELF,
|
|
8096
8150
|
splice: METHOD_MUTATES_SELF_RETURNS_NEW_ARRAY,
|
|
8151
|
+
toLocaleString: METHOD_RETURNS_STRING,
|
|
8152
|
+
toString: METHOD_RETURNS_STRING,
|
|
8097
8153
|
unshift: METHOD_MUTATES_SELF_RETURNS_NUMBER,
|
|
8098
8154
|
values: METHOD_DEOPTS_SELF_RETURNS_UNKNOWN
|
|
8099
8155
|
}, OBJECT_PROTOTYPE, true);
|
|
@@ -11926,13 +11982,19 @@ class SyntheticNamedExportVariable extends Variable {
|
|
|
11926
11982
|
}
|
|
11927
11983
|
}
|
|
11928
11984
|
|
|
11985
|
+
var BuildPhase;
|
|
11986
|
+
(function (BuildPhase) {
|
|
11987
|
+
BuildPhase[BuildPhase["LOAD_AND_PARSE"] = 0] = "LOAD_AND_PARSE";
|
|
11988
|
+
BuildPhase[BuildPhase["ANALYSE"] = 1] = "ANALYSE";
|
|
11989
|
+
BuildPhase[BuildPhase["GENERATE"] = 2] = "GENERATE";
|
|
11990
|
+
})(BuildPhase || (BuildPhase = {}));
|
|
11991
|
+
|
|
11929
11992
|
function getId(m) {
|
|
11930
11993
|
return m.id;
|
|
11931
11994
|
}
|
|
11932
11995
|
|
|
11933
11996
|
function getOriginalLocation(sourcemapChain, location) {
|
|
11934
|
-
|
|
11935
|
-
const filteredSourcemapChain = sourcemapChain.filter(sourcemap => sourcemap.mappings);
|
|
11997
|
+
const filteredSourcemapChain = sourcemapChain.filter((sourcemap) => !!sourcemap.mappings);
|
|
11936
11998
|
while (filteredSourcemapChain.length > 0) {
|
|
11937
11999
|
const sourcemap = filteredSourcemapChain.pop();
|
|
11938
12000
|
const line = sourcemap.mappings[location.line - 1];
|
|
@@ -11961,24 +12023,7 @@ function getOriginalLocation(sourcemapChain, location) {
|
|
|
11961
12023
|
}
|
|
11962
12024
|
|
|
11963
12025
|
const NOOP = () => { };
|
|
11964
|
-
let
|
|
11965
|
-
let getElapsedTime = () => 0;
|
|
11966
|
-
let getMemory = () => 0;
|
|
11967
|
-
let timers = {};
|
|
11968
|
-
const normalizeHrTime = (time) => time[0] * 1e3 + time[1] / 1e6;
|
|
11969
|
-
function setTimeHelpers() {
|
|
11970
|
-
if (typeof process !== 'undefined' && typeof process.hrtime === 'function') {
|
|
11971
|
-
getStartTime = process.hrtime.bind(process);
|
|
11972
|
-
getElapsedTime = previous => normalizeHrTime(process.hrtime(previous));
|
|
11973
|
-
}
|
|
11974
|
-
else if (typeof performance !== 'undefined' && typeof performance.now === 'function') {
|
|
11975
|
-
getStartTime = () => [performance.now(), 0];
|
|
11976
|
-
getElapsedTime = previous => performance.now() - previous[0];
|
|
11977
|
-
}
|
|
11978
|
-
if (typeof process !== 'undefined' && typeof process.memoryUsage === 'function') {
|
|
11979
|
-
getMemory = () => process.memoryUsage().heapUsed;
|
|
11980
|
-
}
|
|
11981
|
-
}
|
|
12026
|
+
let timers = new Map();
|
|
11982
12027
|
function getPersistedLabel(label, level) {
|
|
11983
12028
|
switch (level) {
|
|
11984
12029
|
case 1:
|
|
@@ -11993,58 +12038,59 @@ function getPersistedLabel(label, level) {
|
|
|
11993
12038
|
}
|
|
11994
12039
|
function timeStartImpl(label, level = 3) {
|
|
11995
12040
|
label = getPersistedLabel(label, level);
|
|
11996
|
-
|
|
11997
|
-
|
|
12041
|
+
const startMemory = process$1.memoryUsage().heapUsed;
|
|
12042
|
+
const startTime = performance.now();
|
|
12043
|
+
const timer = timers.get(label);
|
|
12044
|
+
if (timer === undefined) {
|
|
12045
|
+
timers.set(label, {
|
|
11998
12046
|
memory: 0,
|
|
11999
|
-
startMemory
|
|
12000
|
-
startTime
|
|
12047
|
+
startMemory,
|
|
12048
|
+
startTime,
|
|
12001
12049
|
time: 0,
|
|
12002
12050
|
totalMemory: 0
|
|
12003
|
-
};
|
|
12051
|
+
});
|
|
12052
|
+
}
|
|
12053
|
+
else {
|
|
12054
|
+
timer.startMemory = startMemory;
|
|
12055
|
+
timer.startTime = startTime;
|
|
12004
12056
|
}
|
|
12005
|
-
const currentMemory = getMemory();
|
|
12006
|
-
timers[label].startTime = getStartTime();
|
|
12007
|
-
timers[label].startMemory = currentMemory;
|
|
12008
12057
|
}
|
|
12009
12058
|
function timeEndImpl(label, level = 3) {
|
|
12010
12059
|
label = getPersistedLabel(label, level);
|
|
12011
|
-
|
|
12012
|
-
|
|
12013
|
-
|
|
12014
|
-
|
|
12015
|
-
|
|
12060
|
+
const timer = timers.get(label);
|
|
12061
|
+
if (timer !== undefined) {
|
|
12062
|
+
const currentMemory = process$1.memoryUsage().heapUsed;
|
|
12063
|
+
timer.memory += currentMemory - timer.startMemory;
|
|
12064
|
+
timer.time += performance.now() - timer.startTime;
|
|
12065
|
+
timer.totalMemory = Math.max(timer.totalMemory, currentMemory);
|
|
12016
12066
|
}
|
|
12017
12067
|
}
|
|
12018
12068
|
function getTimings() {
|
|
12019
12069
|
const newTimings = {};
|
|
12020
|
-
for (const [label, {
|
|
12070
|
+
for (const [label, { memory, time, totalMemory }] of timers) {
|
|
12021
12071
|
newTimings[label] = [time, memory, totalMemory];
|
|
12022
12072
|
}
|
|
12023
12073
|
return newTimings;
|
|
12024
12074
|
}
|
|
12025
|
-
let timeStart = NOOP
|
|
12026
|
-
|
|
12027
|
-
|
|
12028
|
-
resolveDynamicImport: true,
|
|
12029
|
-
resolveId: true,
|
|
12030
|
-
transform: true
|
|
12031
|
-
};
|
|
12075
|
+
let timeStart = NOOP;
|
|
12076
|
+
let timeEnd = NOOP;
|
|
12077
|
+
const TIMED_PLUGIN_HOOKS = ['load', 'resolveDynamicImport', 'resolveId', 'transform'];
|
|
12032
12078
|
function getPluginWithTimers(plugin, index) {
|
|
12033
|
-
const
|
|
12034
|
-
|
|
12035
|
-
if (TIMED_PLUGIN_HOOKS[hook] === true) {
|
|
12079
|
+
for (const hook of TIMED_PLUGIN_HOOKS) {
|
|
12080
|
+
if (hook in plugin) {
|
|
12036
12081
|
let timerLabel = `plugin ${index}`;
|
|
12037
12082
|
if (plugin.name) {
|
|
12038
12083
|
timerLabel += ` (${plugin.name})`;
|
|
12039
12084
|
}
|
|
12040
12085
|
timerLabel += ` - ${hook}`;
|
|
12041
|
-
|
|
12086
|
+
const func = plugin[hook];
|
|
12087
|
+
plugin[hook] = function (...args) {
|
|
12042
12088
|
timeStart(timerLabel, 4);
|
|
12043
|
-
|
|
12089
|
+
const result = func.apply(this, args);
|
|
12044
12090
|
timeEnd(timerLabel, 4);
|
|
12045
12091
|
if (result && typeof result.then === 'function') {
|
|
12046
12092
|
timeStart(`${timerLabel} (async)`, 4);
|
|
12047
|
-
|
|
12093
|
+
return result.then((hookResult) => {
|
|
12048
12094
|
timeEnd(`${timerLabel} (async)`, 4);
|
|
12049
12095
|
return hookResult;
|
|
12050
12096
|
});
|
|
@@ -12052,16 +12098,12 @@ function getPluginWithTimers(plugin, index) {
|
|
|
12052
12098
|
return result;
|
|
12053
12099
|
};
|
|
12054
12100
|
}
|
|
12055
|
-
else {
|
|
12056
|
-
timedPlugin[hook] = plugin[hook];
|
|
12057
|
-
}
|
|
12058
12101
|
}
|
|
12059
|
-
return
|
|
12102
|
+
return plugin;
|
|
12060
12103
|
}
|
|
12061
12104
|
function initialiseTimers(inputOptions) {
|
|
12062
12105
|
if (inputOptions.perf) {
|
|
12063
|
-
timers =
|
|
12064
|
-
setTimeHelpers();
|
|
12106
|
+
timers = new Map();
|
|
12065
12107
|
timeStart = timeStartImpl;
|
|
12066
12108
|
timeEnd = timeEndImpl;
|
|
12067
12109
|
inputOptions.plugins = inputOptions.plugins.map(getPluginWithTimers);
|
|
@@ -12190,6 +12232,11 @@ class Module {
|
|
|
12190
12232
|
this.info = {
|
|
12191
12233
|
ast: null,
|
|
12192
12234
|
code: null,
|
|
12235
|
+
get dynamicallyImportedIdResolutions() {
|
|
12236
|
+
return module.dynamicImports
|
|
12237
|
+
.map(({ argument }) => typeof argument === 'string' && module.resolvedIds[argument])
|
|
12238
|
+
.filter(Boolean);
|
|
12239
|
+
},
|
|
12193
12240
|
get dynamicallyImportedIds() {
|
|
12194
12241
|
const dynamicallyImportedIds = [];
|
|
12195
12242
|
for (const { id } of module.dynamicImports) {
|
|
@@ -12210,6 +12257,9 @@ class Module {
|
|
|
12210
12257
|
get implicitlyLoadedBefore() {
|
|
12211
12258
|
return Array.from(module.implicitlyLoadedBefore, getId).sort();
|
|
12212
12259
|
},
|
|
12260
|
+
get importedIdResolutions() {
|
|
12261
|
+
return Array.from(module.sources, source => module.resolvedIds[source]).filter(Boolean);
|
|
12262
|
+
},
|
|
12213
12263
|
get importedIds() {
|
|
12214
12264
|
return Array.from(module.sources, source => { var _a; return (_a = module.resolvedIds[source]) === null || _a === void 0 ? void 0 : _a.id; }).filter(Boolean);
|
|
12215
12265
|
},
|
|
@@ -12218,7 +12268,13 @@ class Module {
|
|
|
12218
12268
|
},
|
|
12219
12269
|
isEntry,
|
|
12220
12270
|
isExternal: false,
|
|
12221
|
-
|
|
12271
|
+
get isIncluded() {
|
|
12272
|
+
if (module.graph.phase !== BuildPhase.GENERATE) {
|
|
12273
|
+
return null;
|
|
12274
|
+
}
|
|
12275
|
+
return module.isIncluded();
|
|
12276
|
+
},
|
|
12277
|
+
meta: { ...meta },
|
|
12222
12278
|
syntheticNamedExports
|
|
12223
12279
|
};
|
|
12224
12280
|
}
|
|
@@ -12239,7 +12295,7 @@ class Module {
|
|
|
12239
12295
|
return this.allExportNames;
|
|
12240
12296
|
}
|
|
12241
12297
|
const allExportNames = (this.allExportNames = new Set());
|
|
12242
|
-
for (const name of
|
|
12298
|
+
for (const name of this.getExports()) {
|
|
12243
12299
|
allExportNames.add(name);
|
|
12244
12300
|
}
|
|
12245
12301
|
for (const name of Object.keys(this.reexportDescriptions)) {
|
|
@@ -12263,12 +12319,11 @@ class Module {
|
|
|
12263
12319
|
const relevantDependencies = new Set();
|
|
12264
12320
|
const necessaryDependencies = new Set();
|
|
12265
12321
|
const alwaysCheckedDependencies = new Set();
|
|
12266
|
-
|
|
12322
|
+
const dependencyVariables = new Set(this.imports);
|
|
12267
12323
|
if (this.info.isEntry ||
|
|
12268
12324
|
this.includedDynamicImporters.length > 0 ||
|
|
12269
12325
|
this.namespace.included ||
|
|
12270
12326
|
this.implicitlyLoadedAfter.size > 0) {
|
|
12271
|
-
dependencyVariables = new Set(dependencyVariables);
|
|
12272
12327
|
for (const exportName of [...this.getReexports(), ...this.getExports()]) {
|
|
12273
12328
|
const exportedVariable = this.getVariableForExportName(exportName);
|
|
12274
12329
|
if (exportedVariable) {
|
|
@@ -12650,7 +12705,7 @@ class Module {
|
|
|
12650
12705
|
this.info.syntheticNamedExports = syntheticNamedExports;
|
|
12651
12706
|
}
|
|
12652
12707
|
if (meta != null) {
|
|
12653
|
-
|
|
12708
|
+
Object.assign(this.info.meta, meta);
|
|
12654
12709
|
}
|
|
12655
12710
|
}
|
|
12656
12711
|
warn(props, pos) {
|
|
@@ -12741,11 +12796,7 @@ class Module {
|
|
|
12741
12796
|
for (const specifier of node.specifiers) {
|
|
12742
12797
|
const isDefault = specifier.type === ImportDefaultSpecifier$1;
|
|
12743
12798
|
const isNamespace = specifier.type === ImportNamespaceSpecifier$1;
|
|
12744
|
-
const name = isDefault
|
|
12745
|
-
? 'default'
|
|
12746
|
-
: isNamespace
|
|
12747
|
-
? '*'
|
|
12748
|
-
: specifier.imported.name;
|
|
12799
|
+
const name = isDefault ? 'default' : isNamespace ? '*' : specifier.imported.name;
|
|
12749
12800
|
this.importDescriptions[specifier.local.name] = {
|
|
12750
12801
|
module: null,
|
|
12751
12802
|
name,
|
|
@@ -12892,7 +12943,7 @@ class Module {
|
|
|
12892
12943
|
variable.include();
|
|
12893
12944
|
this.graph.needsTreeshakingPass = true;
|
|
12894
12945
|
const variableModule = variable.module;
|
|
12895
|
-
if (variableModule
|
|
12946
|
+
if (variableModule instanceof Module) {
|
|
12896
12947
|
if (!variableModule.isExecuted) {
|
|
12897
12948
|
markModuleAndImpureDependenciesAsExecuted(variableModule);
|
|
12898
12949
|
}
|
|
@@ -14008,7 +14059,7 @@ function escapeId(id) {
|
|
|
14008
14059
|
function assignExportsToMangledNames(exports, exportsByName, exportNamesByVariable) {
|
|
14009
14060
|
let nameIndex = 0;
|
|
14010
14061
|
for (const variable of exports) {
|
|
14011
|
-
let exportName = variable.name
|
|
14062
|
+
let [exportName] = variable.name;
|
|
14012
14063
|
if (exportsByName[exportName]) {
|
|
14013
14064
|
do {
|
|
14014
14065
|
exportName = toBase64(++nameIndex);
|
|
@@ -14017,7 +14068,7 @@ function assignExportsToMangledNames(exports, exportsByName, exportNamesByVariab
|
|
|
14017
14068
|
nameIndex += 9 * 64 ** (exportName.length - 1);
|
|
14018
14069
|
exportName = toBase64(nameIndex);
|
|
14019
14070
|
}
|
|
14020
|
-
} while (RESERVED_NAMES.has(exportName) || exportsByName[exportName]);
|
|
14071
|
+
} while (RESERVED_NAMES$1.has(exportName) || exportsByName[exportName]);
|
|
14021
14072
|
}
|
|
14022
14073
|
exportsByName[exportName] = variable;
|
|
14023
14074
|
exportNamesByVariable.set(variable, [exportName]);
|
|
@@ -14250,6 +14301,7 @@ class Chunk {
|
|
|
14250
14301
|
this.implicitlyLoadedBefore = new Set();
|
|
14251
14302
|
this.imports = new Set();
|
|
14252
14303
|
this.indentString = undefined;
|
|
14304
|
+
// This may only be updated in the constructor
|
|
14253
14305
|
this.isEmpty = true;
|
|
14254
14306
|
this.name = null;
|
|
14255
14307
|
this.renderedDependencies = null;
|
|
@@ -14435,7 +14487,7 @@ class Chunk {
|
|
|
14435
14487
|
}), existingNames);
|
|
14436
14488
|
}
|
|
14437
14489
|
generateIdPreserveModules(preserveModulesRelativeDir, options, existingNames, unsetOptions) {
|
|
14438
|
-
const id = this.orderedModules
|
|
14490
|
+
const [{ id }] = this.orderedModules;
|
|
14439
14491
|
const sanitizedId = this.outputOptions.sanitizeFileName(id);
|
|
14440
14492
|
let path;
|
|
14441
14493
|
const patternOpt = unsetOptions.has('entryFileNames')
|
|
@@ -15235,13 +15287,6 @@ function getChunkNameFromModule(module) {
|
|
|
15235
15287
|
return module.chunkName || getAliasName(module.id);
|
|
15236
15288
|
}
|
|
15237
15289
|
|
|
15238
|
-
var BuildPhase;
|
|
15239
|
-
(function (BuildPhase) {
|
|
15240
|
-
BuildPhase[BuildPhase["LOAD_AND_PARSE"] = 0] = "LOAD_AND_PARSE";
|
|
15241
|
-
BuildPhase[BuildPhase["ANALYSE"] = 1] = "ANALYSE";
|
|
15242
|
-
BuildPhase[BuildPhase["GENERATE"] = 2] = "GENERATE";
|
|
15243
|
-
})(BuildPhase || (BuildPhase = {}));
|
|
15244
|
-
|
|
15245
15290
|
function generateAssetFileName(name, source, outputOptions, bundle) {
|
|
15246
15291
|
const emittedName = outputOptions.sanitizeFileName(name || 'asset');
|
|
15247
15292
|
return makeUnique(renderNamePattern(typeof outputOptions.assetFileNames === 'function'
|
|
@@ -15752,7 +15797,7 @@ function getGenerateCodeSnippets({ compact, generatedCode: { arrowFunctions, con
|
|
|
15752
15797
|
];
|
|
15753
15798
|
const isValidPropName = reservedNamesAsProps
|
|
15754
15799
|
? (name) => validPropName.test(name)
|
|
15755
|
-
: (name) => !RESERVED_NAMES.has(name) && validPropName.test(name);
|
|
15800
|
+
: (name) => !RESERVED_NAMES$1.has(name) && validPropName.test(name);
|
|
15756
15801
|
return {
|
|
15757
15802
|
_,
|
|
15758
15803
|
cnst,
|
|
@@ -15977,7 +16022,7 @@ function validateOptionsForMultiChunkOutput(outputOptions, onWarn) {
|
|
|
15977
16022
|
onWarn(errInvalidOption('output.amd.id', 'outputamd', 'this option is only properly supported for single-file builds. Use "output.amd.autoId" and "output.amd.basePath" instead'));
|
|
15978
16023
|
}
|
|
15979
16024
|
function getIncludedModules(modulesById) {
|
|
15980
|
-
return [...modulesById.values()].filter(module => module instanceof Module &&
|
|
16025
|
+
return [...modulesById.values()].filter((module) => module instanceof Module &&
|
|
15981
16026
|
(module.isIncluded() || module.info.isEntry || module.includedDynamicImporters.length > 0));
|
|
15982
16027
|
}
|
|
15983
16028
|
function addModuleToManualChunk(alias, module, manualChunkAliasByEntry) {
|
|
@@ -16017,8 +16062,8 @@ var keywordRelationalOperator = /^in(stanceof)?$/;
|
|
|
16017
16062
|
// are only applied when a character is found to actually have a
|
|
16018
16063
|
// code point above 128.
|
|
16019
16064
|
// Generated by `bin/generate-identifier-regex.js`.
|
|
16020
|
-
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\
|
|
16021
|
-
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\
|
|
16065
|
+
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";
|
|
16066
|
+
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";
|
|
16022
16067
|
|
|
16023
16068
|
var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
|
|
16024
16069
|
var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
|
|
@@ -16032,10 +16077,10 @@ nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
|
|
|
16032
16077
|
// generated by bin/generate-identifier-regex.js
|
|
16033
16078
|
|
|
16034
16079
|
// eslint-disable-next-line comma-spacing
|
|
16035
|
-
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,
|
|
16080
|
+
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];
|
|
16036
16081
|
|
|
16037
16082
|
// eslint-disable-next-line comma-spacing
|
|
16038
|
-
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,
|
|
16083
|
+
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];
|
|
16039
16084
|
|
|
16040
16085
|
// This has a complexity linear to the value of the code. The
|
|
16041
16086
|
// assumption is that looking up astral identifier characters is
|
|
@@ -16240,6 +16285,17 @@ function isNewLine(code) {
|
|
|
16240
16285
|
return code === 10 || code === 13 || code === 0x2028 || code === 0x2029
|
|
16241
16286
|
}
|
|
16242
16287
|
|
|
16288
|
+
function nextLineBreak(code, from, end) {
|
|
16289
|
+
if ( end === void 0 ) end = code.length;
|
|
16290
|
+
|
|
16291
|
+
for (var i = from; i < end; i++) {
|
|
16292
|
+
var next = code.charCodeAt(i);
|
|
16293
|
+
if (isNewLine(next))
|
|
16294
|
+
{ return i < end - 1 && next === 13 && code.charCodeAt(i + 1) === 10 ? i + 2 : i + 1 }
|
|
16295
|
+
}
|
|
16296
|
+
return -1
|
|
16297
|
+
}
|
|
16298
|
+
|
|
16243
16299
|
var nonASCIIwhitespace = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/;
|
|
16244
16300
|
|
|
16245
16301
|
var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;
|
|
@@ -16248,11 +16304,9 @@ var ref = Object.prototype;
|
|
|
16248
16304
|
var hasOwnProperty = ref.hasOwnProperty;
|
|
16249
16305
|
var toString = ref.toString;
|
|
16250
16306
|
|
|
16251
|
-
|
|
16252
|
-
|
|
16253
|
-
|
|
16254
|
-
return hasOwnProperty.call(obj, propName)
|
|
16255
|
-
}
|
|
16307
|
+
var hasOwn = Object.hasOwn || (function (obj, propName) { return (
|
|
16308
|
+
hasOwnProperty.call(obj, propName)
|
|
16309
|
+
); });
|
|
16256
16310
|
|
|
16257
16311
|
var isArray = Array.isArray || (function (obj) { return (
|
|
16258
16312
|
toString.call(obj) === "[object Array]"
|
|
@@ -16262,6 +16316,8 @@ function wordsRegexp(words) {
|
|
|
16262
16316
|
return new RegExp("^(?:" + words.replace(/ /g, "|") + ")$")
|
|
16263
16317
|
}
|
|
16264
16318
|
|
|
16319
|
+
var loneSurrogate = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/;
|
|
16320
|
+
|
|
16265
16321
|
// These are used when `options.locations` is on, for the
|
|
16266
16322
|
// `startLoc` and `endLoc` properties.
|
|
16267
16323
|
|
|
@@ -16288,14 +16344,10 @@ var SourceLocation = function SourceLocation(p, start, end) {
|
|
|
16288
16344
|
|
|
16289
16345
|
function getLineInfo(input, offset) {
|
|
16290
16346
|
for (var line = 1, cur = 0;;) {
|
|
16291
|
-
|
|
16292
|
-
|
|
16293
|
-
|
|
16294
|
-
|
|
16295
|
-
cur = match.index + match[0].length;
|
|
16296
|
-
} else {
|
|
16297
|
-
return new Position(line, offset - cur)
|
|
16298
|
-
}
|
|
16347
|
+
var nextBreak = nextLineBreak(input, cur, offset);
|
|
16348
|
+
if (nextBreak < 0) { return new Position(line, offset - cur) }
|
|
16349
|
+
++line;
|
|
16350
|
+
cur = nextBreak;
|
|
16299
16351
|
}
|
|
16300
16352
|
}
|
|
16301
16353
|
|
|
@@ -16401,7 +16453,7 @@ function getOptions(opts) {
|
|
|
16401
16453
|
var options = {};
|
|
16402
16454
|
|
|
16403
16455
|
for (var opt in defaultOptions)
|
|
16404
|
-
{ options[opt] = opts &&
|
|
16456
|
+
{ options[opt] = opts && hasOwn(opts, opt) ? opts[opt] : defaultOptions[opt]; }
|
|
16405
16457
|
|
|
16406
16458
|
if (options.ecmaVersion === "latest") {
|
|
16407
16459
|
options.ecmaVersion = 1e8;
|
|
@@ -17567,7 +17619,7 @@ pp$8.exitClassBody = function() {
|
|
|
17567
17619
|
var parent = len === 0 ? null : this.privateNameStack[len - 1];
|
|
17568
17620
|
for (var i = 0; i < used.length; ++i) {
|
|
17569
17621
|
var id = used[i];
|
|
17570
|
-
if (!
|
|
17622
|
+
if (!hasOwn(declared, id.name)) {
|
|
17571
17623
|
if (parent) {
|
|
17572
17624
|
parent.used.push(id);
|
|
17573
17625
|
} else {
|
|
@@ -17620,7 +17672,7 @@ pp$8.parseExport = function(node, exports) {
|
|
|
17620
17672
|
if (this.eat(types$1.star)) {
|
|
17621
17673
|
if (this.options.ecmaVersion >= 11) {
|
|
17622
17674
|
if (this.eatContextual("as")) {
|
|
17623
|
-
node.exported = this.
|
|
17675
|
+
node.exported = this.parseModuleExportName();
|
|
17624
17676
|
this.checkExport(exports, node.exported.name, this.lastTokStart);
|
|
17625
17677
|
} else {
|
|
17626
17678
|
node.exported = null;
|
|
@@ -17672,6 +17724,10 @@ pp$8.parseExport = function(node, exports) {
|
|
|
17672
17724
|
this.checkUnreserved(spec.local);
|
|
17673
17725
|
// check if export is defined
|
|
17674
17726
|
this.checkLocalExport(spec.local);
|
|
17727
|
+
|
|
17728
|
+
if (spec.local.type === "Literal") {
|
|
17729
|
+
this.raise(spec.local.start, "A string literal cannot be used as an exported binding without `from`.");
|
|
17730
|
+
}
|
|
17675
17731
|
}
|
|
17676
17732
|
|
|
17677
17733
|
node.source = null;
|
|
@@ -17683,7 +17739,7 @@ pp$8.parseExport = function(node, exports) {
|
|
|
17683
17739
|
|
|
17684
17740
|
pp$8.checkExport = function(exports, name, pos) {
|
|
17685
17741
|
if (!exports) { return }
|
|
17686
|
-
if (
|
|
17742
|
+
if (hasOwn(exports, name))
|
|
17687
17743
|
{ this.raiseRecoverable(pos, "Duplicate export '" + name + "'"); }
|
|
17688
17744
|
exports[name] = true;
|
|
17689
17745
|
};
|
|
@@ -17747,9 +17803,13 @@ pp$8.parseExportSpecifiers = function(exports) {
|
|
|
17747
17803
|
} else { first = false; }
|
|
17748
17804
|
|
|
17749
17805
|
var node = this.startNode();
|
|
17750
|
-
node.local = this.
|
|
17751
|
-
node.exported = this.eatContextual("as") ? this.
|
|
17752
|
-
this.checkExport(
|
|
17806
|
+
node.local = this.parseModuleExportName();
|
|
17807
|
+
node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local;
|
|
17808
|
+
this.checkExport(
|
|
17809
|
+
exports,
|
|
17810
|
+
node.exported[node.exported.type === "Identifier" ? "name" : "value"],
|
|
17811
|
+
node.exported.start
|
|
17812
|
+
);
|
|
17753
17813
|
nodes.push(this.finishNode(node, "ExportSpecifier"));
|
|
17754
17814
|
}
|
|
17755
17815
|
return nodes
|
|
@@ -17801,7 +17861,7 @@ pp$8.parseImportSpecifiers = function() {
|
|
|
17801
17861
|
} else { first = false; }
|
|
17802
17862
|
|
|
17803
17863
|
var node$2 = this.startNode();
|
|
17804
|
-
node$2.imported = this.
|
|
17864
|
+
node$2.imported = this.parseModuleExportName();
|
|
17805
17865
|
if (this.eatContextual("as")) {
|
|
17806
17866
|
node$2.local = this.parseIdent();
|
|
17807
17867
|
} else {
|
|
@@ -17814,6 +17874,17 @@ pp$8.parseImportSpecifiers = function() {
|
|
|
17814
17874
|
return nodes
|
|
17815
17875
|
};
|
|
17816
17876
|
|
|
17877
|
+
pp$8.parseModuleExportName = function() {
|
|
17878
|
+
if (this.options.ecmaVersion >= 13 && this.type === types$1.string) {
|
|
17879
|
+
var stringLiteral = this.parseLiteral(this.value);
|
|
17880
|
+
if (loneSurrogate.test(stringLiteral.value)) {
|
|
17881
|
+
this.raise(stringLiteral.start, "An export name cannot include a lone surrogate.");
|
|
17882
|
+
}
|
|
17883
|
+
return stringLiteral
|
|
17884
|
+
}
|
|
17885
|
+
return this.parseIdent(true)
|
|
17886
|
+
};
|
|
17887
|
+
|
|
17817
17888
|
// Set `ExpressionStatement#directive` property for directive prologues.
|
|
17818
17889
|
pp$8.adaptDirectivePrologue = function(statements) {
|
|
17819
17890
|
for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) {
|
|
@@ -18087,7 +18158,7 @@ pp$7.checkLValSimple = function(expr, bindingType, checkClashes) {
|
|
|
18087
18158
|
if (bindingType === BIND_LEXICAL && expr.name === "let")
|
|
18088
18159
|
{ this.raiseRecoverable(expr.start, "let is disallowed as a lexically bound name"); }
|
|
18089
18160
|
if (checkClashes) {
|
|
18090
|
-
if (
|
|
18161
|
+
if (hasOwn(checkClashes, expr.name))
|
|
18091
18162
|
{ this.raiseRecoverable(expr.start, "Argument name clash"); }
|
|
18092
18163
|
checkClashes[expr.name] = true;
|
|
18093
18164
|
}
|
|
@@ -19582,26 +19653,30 @@ var ecma9BinaryProperties = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Ass
|
|
|
19582
19653
|
var ecma10BinaryProperties = ecma9BinaryProperties + " Extended_Pictographic";
|
|
19583
19654
|
var ecma11BinaryProperties = ecma10BinaryProperties;
|
|
19584
19655
|
var ecma12BinaryProperties = ecma11BinaryProperties + " EBase EComp EMod EPres ExtPict";
|
|
19656
|
+
var ecma13BinaryProperties = ecma12BinaryProperties;
|
|
19585
19657
|
var unicodeBinaryProperties = {
|
|
19586
19658
|
9: ecma9BinaryProperties,
|
|
19587
19659
|
10: ecma10BinaryProperties,
|
|
19588
19660
|
11: ecma11BinaryProperties,
|
|
19589
|
-
12: ecma12BinaryProperties
|
|
19661
|
+
12: ecma12BinaryProperties,
|
|
19662
|
+
13: ecma13BinaryProperties
|
|
19590
19663
|
};
|
|
19591
19664
|
|
|
19592
19665
|
// #table-unicode-general-category-values
|
|
19593
19666
|
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";
|
|
19594
19667
|
|
|
19595
19668
|
// #table-unicode-script-values
|
|
19596
|
-
var ecma9ScriptValues = "Adlam Adlm Ahom
|
|
19669
|
+
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";
|
|
19597
19670
|
var ecma10ScriptValues = ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd";
|
|
19598
19671
|
var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho";
|
|
19599
19672
|
var ecma12ScriptValues = ecma11ScriptValues + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi";
|
|
19673
|
+
var ecma13ScriptValues = ecma12ScriptValues + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith";
|
|
19600
19674
|
var unicodeScriptValues = {
|
|
19601
19675
|
9: ecma9ScriptValues,
|
|
19602
19676
|
10: ecma10ScriptValues,
|
|
19603
19677
|
11: ecma11ScriptValues,
|
|
19604
|
-
12: ecma12ScriptValues
|
|
19678
|
+
12: ecma12ScriptValues,
|
|
19679
|
+
13: ecma13ScriptValues
|
|
19605
19680
|
};
|
|
19606
19681
|
|
|
19607
19682
|
var data = {};
|
|
@@ -19619,17 +19694,19 @@ function buildUnicodeData(ecmaVersion) {
|
|
|
19619
19694
|
d.nonBinary.sc = d.nonBinary.Script;
|
|
19620
19695
|
d.nonBinary.scx = d.nonBinary.Script_Extensions;
|
|
19621
19696
|
}
|
|
19622
|
-
|
|
19623
|
-
|
|
19624
|
-
|
|
19625
|
-
|
|
19697
|
+
|
|
19698
|
+
for (var i = 0, list = [9, 10, 11, 12, 13]; i < list.length; i += 1) {
|
|
19699
|
+
var ecmaVersion = list[i];
|
|
19700
|
+
|
|
19701
|
+
buildUnicodeData(ecmaVersion);
|
|
19702
|
+
}
|
|
19626
19703
|
|
|
19627
19704
|
var pp$1 = Parser.prototype;
|
|
19628
19705
|
|
|
19629
19706
|
var RegExpValidationState = function RegExpValidationState(parser) {
|
|
19630
19707
|
this.parser = parser;
|
|
19631
19708
|
this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "") + (parser.options.ecmaVersion >= 13 ? "d" : "");
|
|
19632
|
-
this.unicodeProperties = data[parser.options.ecmaVersion >=
|
|
19709
|
+
this.unicodeProperties = data[parser.options.ecmaVersion >= 13 ? 13 : parser.options.ecmaVersion];
|
|
19633
19710
|
this.source = "";
|
|
19634
19711
|
this.flags = "";
|
|
19635
19712
|
this.start = 0;
|
|
@@ -20428,7 +20505,7 @@ pp$1.regexp_eatUnicodePropertyValueExpression = function(state) {
|
|
|
20428
20505
|
return false
|
|
20429
20506
|
};
|
|
20430
20507
|
pp$1.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) {
|
|
20431
|
-
if (!
|
|
20508
|
+
if (!hasOwn(state.unicodeProperties.nonBinary, name))
|
|
20432
20509
|
{ state.raise("Invalid property name"); }
|
|
20433
20510
|
if (!state.unicodeProperties.nonBinary[name].test(value))
|
|
20434
20511
|
{ state.raise("Invalid property value"); }
|
|
@@ -20780,11 +20857,9 @@ pp.skipBlockComment = function() {
|
|
|
20780
20857
|
if (end === -1) { this.raise(this.pos - 2, "Unterminated comment"); }
|
|
20781
20858
|
this.pos = end + 2;
|
|
20782
20859
|
if (this.options.locations) {
|
|
20783
|
-
|
|
20784
|
-
var match;
|
|
20785
|
-
while ((match = lineBreakG.exec(this.input)) && match.index < this.pos) {
|
|
20860
|
+
for (var nextBreak = (void 0), pos = start; (nextBreak = nextLineBreak(this.input, pos, this.pos)) > -1;) {
|
|
20786
20861
|
++this.curLine;
|
|
20787
|
-
this.lineStart =
|
|
20862
|
+
pos = this.lineStart = nextBreak;
|
|
20788
20863
|
}
|
|
20789
20864
|
}
|
|
20790
20865
|
if (this.options.onComment)
|
|
@@ -21495,7 +21570,7 @@ pp.readWord = function() {
|
|
|
21495
21570
|
|
|
21496
21571
|
// Acorn is a tiny, fast JavaScript parser written in JavaScript.
|
|
21497
21572
|
|
|
21498
|
-
var version = "8.
|
|
21573
|
+
var version = "8.7.0";
|
|
21499
21574
|
|
|
21500
21575
|
Parser.acorn = {
|
|
21501
21576
|
Parser: Parser,
|
|
@@ -21539,9 +21614,9 @@ function writeFile(dest, data) {
|
|
|
21539
21614
|
}
|
|
21540
21615
|
|
|
21541
21616
|
class Queue {
|
|
21542
|
-
constructor(maxParallel
|
|
21617
|
+
constructor(maxParallel) {
|
|
21543
21618
|
this.maxParallel = maxParallel;
|
|
21544
|
-
this.queue =
|
|
21619
|
+
this.queue = [];
|
|
21545
21620
|
this.workerCount = 0;
|
|
21546
21621
|
}
|
|
21547
21622
|
run(task) {
|
|
@@ -21751,7 +21826,7 @@ function getCacheForUncacheablePlugin(pluginName) {
|
|
|
21751
21826
|
};
|
|
21752
21827
|
}
|
|
21753
21828
|
|
|
21754
|
-
function transform(source, module, pluginDriver, warn) {
|
|
21829
|
+
async function transform(source, module, pluginDriver, warn) {
|
|
21755
21830
|
const id = module.id;
|
|
21756
21831
|
const sourcemapChain = [];
|
|
21757
21832
|
let originalSourcemap = source.map === null ? null : decodedSourcemap(source.map);
|
|
@@ -21761,7 +21836,7 @@ function transform(source, module, pluginDriver, warn) {
|
|
|
21761
21836
|
const emittedFiles = [];
|
|
21762
21837
|
let customTransformCache = false;
|
|
21763
21838
|
const useCustomTransformCache = () => (customTransformCache = true);
|
|
21764
|
-
let
|
|
21839
|
+
let pluginName = '';
|
|
21765
21840
|
const curSource = source.code;
|
|
21766
21841
|
function transformReducer(previousCode, result, plugin) {
|
|
21767
21842
|
let code;
|
|
@@ -21792,90 +21867,91 @@ function transform(source, module, pluginDriver, warn) {
|
|
|
21792
21867
|
}
|
|
21793
21868
|
return code;
|
|
21794
21869
|
}
|
|
21795
|
-
|
|
21796
|
-
|
|
21797
|
-
|
|
21798
|
-
|
|
21799
|
-
|
|
21800
|
-
|
|
21801
|
-
|
|
21802
|
-
|
|
21803
|
-
|
|
21804
|
-
|
|
21805
|
-
|
|
21806
|
-
|
|
21807
|
-
|
|
21808
|
-
|
|
21809
|
-
|
|
21810
|
-
|
|
21811
|
-
|
|
21812
|
-
|
|
21813
|
-
|
|
21814
|
-
|
|
21815
|
-
|
|
21816
|
-
|
|
21817
|
-
|
|
21818
|
-
|
|
21819
|
-
|
|
21820
|
-
|
|
21821
|
-
|
|
21822
|
-
|
|
21823
|
-
|
|
21824
|
-
|
|
21825
|
-
|
|
21826
|
-
|
|
21827
|
-
|
|
21828
|
-
|
|
21829
|
-
|
|
21830
|
-
|
|
21831
|
-
|
|
21832
|
-
|
|
21833
|
-
|
|
21834
|
-
|
|
21835
|
-
originalSourcemap
|
|
21836
|
-
|
|
21870
|
+
let code;
|
|
21871
|
+
try {
|
|
21872
|
+
code = await pluginDriver.hookReduceArg0('transform', [curSource, id], transformReducer, (pluginContext, plugin) => {
|
|
21873
|
+
pluginName = plugin.name;
|
|
21874
|
+
return {
|
|
21875
|
+
...pluginContext,
|
|
21876
|
+
addWatchFile(id) {
|
|
21877
|
+
transformDependencies.push(id);
|
|
21878
|
+
pluginContext.addWatchFile(id);
|
|
21879
|
+
},
|
|
21880
|
+
cache: customTransformCache
|
|
21881
|
+
? pluginContext.cache
|
|
21882
|
+
: getTrackedPluginCache(pluginContext.cache, useCustomTransformCache),
|
|
21883
|
+
emitAsset(name, source) {
|
|
21884
|
+
emittedFiles.push({ name, source, type: 'asset' });
|
|
21885
|
+
return pluginContext.emitAsset(name, source);
|
|
21886
|
+
},
|
|
21887
|
+
emitChunk(id, options) {
|
|
21888
|
+
emittedFiles.push({ id, name: options && options.name, type: 'chunk' });
|
|
21889
|
+
return pluginContext.emitChunk(id, options);
|
|
21890
|
+
},
|
|
21891
|
+
emitFile(emittedFile) {
|
|
21892
|
+
emittedFiles.push(emittedFile);
|
|
21893
|
+
return pluginDriver.emitFile(emittedFile);
|
|
21894
|
+
},
|
|
21895
|
+
error(err, pos) {
|
|
21896
|
+
if (typeof err === 'string')
|
|
21897
|
+
err = { message: err };
|
|
21898
|
+
if (pos)
|
|
21899
|
+
augmentCodeLocation(err, pos, curSource, id);
|
|
21900
|
+
err.id = id;
|
|
21901
|
+
err.hook = 'transform';
|
|
21902
|
+
return pluginContext.error(err);
|
|
21903
|
+
},
|
|
21904
|
+
getCombinedSourcemap() {
|
|
21905
|
+
const combinedMap = collapseSourcemap(id, originalCode, originalSourcemap, sourcemapChain, warn);
|
|
21906
|
+
if (!combinedMap) {
|
|
21907
|
+
const magicString = new MagicString$1(originalCode);
|
|
21908
|
+
return magicString.generateMap({ hires: true, includeContent: true, source: id });
|
|
21909
|
+
}
|
|
21910
|
+
if (originalSourcemap !== combinedMap) {
|
|
21911
|
+
originalSourcemap = combinedMap;
|
|
21912
|
+
sourcemapChain.length = 0;
|
|
21913
|
+
}
|
|
21914
|
+
return new SourceMap({
|
|
21915
|
+
...combinedMap,
|
|
21916
|
+
file: null,
|
|
21917
|
+
sourcesContent: combinedMap.sourcesContent
|
|
21918
|
+
});
|
|
21919
|
+
},
|
|
21920
|
+
setAssetSource() {
|
|
21921
|
+
return this.error({
|
|
21922
|
+
code: 'INVALID_SETASSETSOURCE',
|
|
21923
|
+
message: `setAssetSource cannot be called in transform for caching reasons. Use emitFile with a source, or call setAssetSource in another hook.`
|
|
21924
|
+
});
|
|
21925
|
+
},
|
|
21926
|
+
warn(warning, pos) {
|
|
21927
|
+
if (typeof warning === 'string')
|
|
21928
|
+
warning = { message: warning };
|
|
21929
|
+
if (pos)
|
|
21930
|
+
augmentCodeLocation(warning, pos, curSource, id);
|
|
21931
|
+
warning.id = id;
|
|
21932
|
+
warning.hook = 'transform';
|
|
21933
|
+
pluginContext.warn(warning);
|
|
21837
21934
|
}
|
|
21838
|
-
|
|
21839
|
-
|
|
21840
|
-
|
|
21841
|
-
|
|
21842
|
-
|
|
21843
|
-
|
|
21844
|
-
|
|
21845
|
-
|
|
21846
|
-
|
|
21847
|
-
|
|
21848
|
-
|
|
21849
|
-
|
|
21850
|
-
|
|
21851
|
-
|
|
21852
|
-
|
|
21853
|
-
|
|
21854
|
-
|
|
21855
|
-
|
|
21856
|
-
|
|
21857
|
-
|
|
21858
|
-
}
|
|
21859
|
-
};
|
|
21860
|
-
})
|
|
21861
|
-
.catch(err => throwPluginError(err, curPlugin.name, { hook: 'transform', id }))
|
|
21862
|
-
.then(code => {
|
|
21863
|
-
if (!customTransformCache) {
|
|
21864
|
-
// files emitted by a transform hook need to be emitted again if the hook is skipped
|
|
21865
|
-
if (emittedFiles.length)
|
|
21866
|
-
module.transformFiles = emittedFiles;
|
|
21867
|
-
}
|
|
21868
|
-
return {
|
|
21869
|
-
ast,
|
|
21870
|
-
code,
|
|
21871
|
-
customTransformCache,
|
|
21872
|
-
meta: module.info.meta,
|
|
21873
|
-
originalCode,
|
|
21874
|
-
originalSourcemap,
|
|
21875
|
-
sourcemapChain,
|
|
21876
|
-
transformDependencies
|
|
21877
|
-
};
|
|
21878
|
-
});
|
|
21935
|
+
};
|
|
21936
|
+
});
|
|
21937
|
+
}
|
|
21938
|
+
catch (err) {
|
|
21939
|
+
throwPluginError(err, pluginName, { hook: 'transform', id });
|
|
21940
|
+
}
|
|
21941
|
+
if (!customTransformCache) {
|
|
21942
|
+
// files emitted by a transform hook need to be emitted again if the hook is skipped
|
|
21943
|
+
if (emittedFiles.length)
|
|
21944
|
+
module.transformFiles = emittedFiles;
|
|
21945
|
+
}
|
|
21946
|
+
return {
|
|
21947
|
+
ast,
|
|
21948
|
+
code,
|
|
21949
|
+
customTransformCache,
|
|
21950
|
+
originalCode,
|
|
21951
|
+
originalSourcemap,
|
|
21952
|
+
sourcemapChain,
|
|
21953
|
+
transformDependencies
|
|
21954
|
+
};
|
|
21879
21955
|
}
|
|
21880
21956
|
|
|
21881
21957
|
class ModuleLoader {
|
|
@@ -21890,7 +21966,6 @@ class ModuleLoader {
|
|
|
21890
21966
|
this.moduleLoadPromises = new Map();
|
|
21891
21967
|
this.modulesWithLoadedDependencies = new Set();
|
|
21892
21968
|
this.nextEntryModuleIndex = 0;
|
|
21893
|
-
this.readQueue = new Queue();
|
|
21894
21969
|
this.resolveId = async (source, importer, customOptions, isEntry, skip = null) => {
|
|
21895
21970
|
return this.addDefaultsToResolvedId(this.getNormalizedResolvedIdWithoutDefaults(this.options.external(source, importer, false)
|
|
21896
21971
|
? false
|
|
@@ -21899,7 +21974,7 @@ class ModuleLoader {
|
|
|
21899
21974
|
this.hasModuleSideEffects = options.treeshake
|
|
21900
21975
|
? options.treeshake.moduleSideEffects
|
|
21901
21976
|
: () => true;
|
|
21902
|
-
this.readQueue
|
|
21977
|
+
this.readQueue = new Queue(options.maxParallelFileReads);
|
|
21903
21978
|
}
|
|
21904
21979
|
async addAdditionalModules(unresolvedModules) {
|
|
21905
21980
|
const result = this.extendLoadModulesPromise(Promise.all(unresolvedModules.map(id => this.loadEntryModule(id, false, undefined, null))));
|
|
@@ -21950,8 +22025,9 @@ class ModuleLoader {
|
|
|
21950
22025
|
}
|
|
21951
22026
|
return module;
|
|
21952
22027
|
}
|
|
21953
|
-
preloadModule(resolvedId) {
|
|
21954
|
-
|
|
22028
|
+
async preloadModule(resolvedId) {
|
|
22029
|
+
const module = await this.fetchModule(this.addDefaultsToResolvedId(resolvedId), undefined, false, true);
|
|
22030
|
+
return module.info;
|
|
21955
22031
|
}
|
|
21956
22032
|
addDefaultsToResolvedId(resolvedId) {
|
|
21957
22033
|
var _a, _b;
|
|
@@ -21962,7 +22038,7 @@ class ModuleLoader {
|
|
|
21962
22038
|
return {
|
|
21963
22039
|
external,
|
|
21964
22040
|
id: resolvedId.id,
|
|
21965
|
-
meta: resolvedId.meta ||
|
|
22041
|
+
meta: resolvedId.meta || {},
|
|
21966
22042
|
moduleSideEffects: (_a = resolvedId.moduleSideEffects) !== null && _a !== void 0 ? _a : this.hasModuleSideEffects(resolvedId.id, !!external),
|
|
21967
22043
|
syntheticNamedExports: (_b = resolvedId.syntheticNamedExports) !== null && _b !== void 0 ? _b : false
|
|
21968
22044
|
};
|
|
@@ -22001,13 +22077,23 @@ class ModuleLoader {
|
|
|
22001
22077
|
timeEnd('load modules', 3);
|
|
22002
22078
|
const sourceDescription = typeof source === 'string'
|
|
22003
22079
|
? { code: source }
|
|
22004
|
-
: typeof source === 'object' && typeof source.code === 'string'
|
|
22080
|
+
: source != null && typeof source === 'object' && typeof source.code === 'string'
|
|
22005
22081
|
? source
|
|
22006
22082
|
: error(errBadLoader(id));
|
|
22007
22083
|
const cachedModule = this.graph.cachedModules.get(id);
|
|
22008
22084
|
if (cachedModule &&
|
|
22009
22085
|
!cachedModule.customTransformCache &&
|
|
22010
|
-
cachedModule.originalCode === sourceDescription.code
|
|
22086
|
+
cachedModule.originalCode === sourceDescription.code &&
|
|
22087
|
+
!(await this.pluginDriver.hookFirst('shouldTransformCachedModule', [
|
|
22088
|
+
{
|
|
22089
|
+
ast: cachedModule.ast,
|
|
22090
|
+
code: cachedModule.code,
|
|
22091
|
+
id: cachedModule.id,
|
|
22092
|
+
meta: cachedModule.meta,
|
|
22093
|
+
moduleSideEffects: cachedModule.moduleSideEffects,
|
|
22094
|
+
syntheticNamedExports: cachedModule.syntheticNamedExports
|
|
22095
|
+
}
|
|
22096
|
+
]))) {
|
|
22011
22097
|
if (cachedModule.transformFiles) {
|
|
22012
22098
|
for (const emittedFile of cachedModule.transformFiles)
|
|
22013
22099
|
this.pluginDriver.emitFile(emittedFile);
|
|
@@ -22204,7 +22290,7 @@ class ModuleLoader {
|
|
|
22204
22290
|
return {
|
|
22205
22291
|
external: true,
|
|
22206
22292
|
id: source,
|
|
22207
|
-
meta:
|
|
22293
|
+
meta: {},
|
|
22208
22294
|
moduleSideEffects: this.hasModuleSideEffects(source, true),
|
|
22209
22295
|
syntheticNamedExports: false
|
|
22210
22296
|
};
|
|
@@ -22399,6 +22485,40 @@ function getPluginContext(plugin, pluginCache, graph, options, fileEmitter, exis
|
|
|
22399
22485
|
return context;
|
|
22400
22486
|
}
|
|
22401
22487
|
|
|
22488
|
+
const unfulfilledActions = new Set();
|
|
22489
|
+
function addUnresolvedAction(actionTuple) {
|
|
22490
|
+
unfulfilledActions.add(actionTuple);
|
|
22491
|
+
}
|
|
22492
|
+
function resolveAction(actionTuple) {
|
|
22493
|
+
unfulfilledActions.delete(actionTuple);
|
|
22494
|
+
}
|
|
22495
|
+
function formatAction([pluginName, hookName, args]) {
|
|
22496
|
+
let action = `(${pluginName}) ${hookName}`;
|
|
22497
|
+
const s = JSON.stringify;
|
|
22498
|
+
switch (hookName) {
|
|
22499
|
+
case 'resolveId':
|
|
22500
|
+
action += ` ${s(args[0])} ${s(args[1])}`;
|
|
22501
|
+
break;
|
|
22502
|
+
case 'load':
|
|
22503
|
+
action += ` ${s(args[0])}`;
|
|
22504
|
+
break;
|
|
22505
|
+
case 'transform':
|
|
22506
|
+
action += ` ${s(args[1])}`;
|
|
22507
|
+
break;
|
|
22508
|
+
}
|
|
22509
|
+
return action;
|
|
22510
|
+
}
|
|
22511
|
+
process.on('exit', () => {
|
|
22512
|
+
if (unfulfilledActions.size) {
|
|
22513
|
+
let err = '[!] Error: unfinished hook action(s) on exit:\n';
|
|
22514
|
+
for (const action of unfulfilledActions) {
|
|
22515
|
+
err += formatAction(action) + '\n';
|
|
22516
|
+
}
|
|
22517
|
+
console.error('%s', err);
|
|
22518
|
+
process.exit(1);
|
|
22519
|
+
}
|
|
22520
|
+
});
|
|
22521
|
+
|
|
22402
22522
|
const inputHookNames = {
|
|
22403
22523
|
buildEnd: 1,
|
|
22404
22524
|
buildStart: 1,
|
|
@@ -22409,6 +22529,7 @@ const inputHookNames = {
|
|
|
22409
22529
|
options: 1,
|
|
22410
22530
|
resolveDynamicImport: 1,
|
|
22411
22531
|
resolveId: 1,
|
|
22532
|
+
shouldTransformCachedModule: 1,
|
|
22412
22533
|
transform: 1,
|
|
22413
22534
|
watchChange: 1
|
|
22414
22535
|
};
|
|
@@ -22550,6 +22671,7 @@ class PluginDriver {
|
|
|
22550
22671
|
if (hookContext) {
|
|
22551
22672
|
context = hookContext(context, plugin);
|
|
22552
22673
|
}
|
|
22674
|
+
let action = null;
|
|
22553
22675
|
return Promise.resolve()
|
|
22554
22676
|
.then(() => {
|
|
22555
22677
|
// permit values allows values to be returned instead of a functional hook
|
|
@@ -22559,9 +22681,35 @@ class PluginDriver {
|
|
|
22559
22681
|
return throwInvalidHookError(hookName, plugin.name);
|
|
22560
22682
|
}
|
|
22561
22683
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
22562
|
-
|
|
22684
|
+
const hookResult = hook.apply(context, args);
|
|
22685
|
+
if (!hookResult || !hookResult.then) {
|
|
22686
|
+
// short circuit for non-thenables and non-Promises
|
|
22687
|
+
return hookResult;
|
|
22688
|
+
}
|
|
22689
|
+
// Track pending hook actions to properly error out when
|
|
22690
|
+
// unfulfilled promises cause rollup to abruptly and confusingly
|
|
22691
|
+
// exit with a successful 0 return code but without producing any
|
|
22692
|
+
// output, errors or warnings.
|
|
22693
|
+
action = [plugin.name, hookName, args];
|
|
22694
|
+
addUnresolvedAction(action);
|
|
22695
|
+
// Although it would be more elegant to just return hookResult here
|
|
22696
|
+
// and put the .then() handler just above the .catch() handler below,
|
|
22697
|
+
// doing so would subtly change the defacto async event dispatch order
|
|
22698
|
+
// which at least one test and some plugins in the wild may depend on.
|
|
22699
|
+
const promise = Promise.resolve(hookResult);
|
|
22700
|
+
return promise.then(() => {
|
|
22701
|
+
// action was fulfilled
|
|
22702
|
+
resolveAction(action);
|
|
22703
|
+
return promise;
|
|
22704
|
+
});
|
|
22563
22705
|
})
|
|
22564
|
-
.catch(err =>
|
|
22706
|
+
.catch(err => {
|
|
22707
|
+
if (action !== null) {
|
|
22708
|
+
// action considered to be fulfilled since error being handled
|
|
22709
|
+
resolveAction(action);
|
|
22710
|
+
}
|
|
22711
|
+
return throwPluginError(err, plugin.name, { hook: hookName });
|
|
22712
|
+
});
|
|
22565
22713
|
}
|
|
22566
22714
|
/**
|
|
22567
22715
|
* Run a sync plugin hook and return the result.
|
|
@@ -22874,6 +23022,7 @@ const generatedCodePresets = {
|
|
|
22874
23022
|
reservedNamesAsProps: true
|
|
22875
23023
|
}
|
|
22876
23024
|
};
|
|
23025
|
+
const objectifyOption = (value) => value && typeof value === 'object' ? value : {};
|
|
22877
23026
|
const objectifyOptionWithPresets = (presets, optionName, additionalValues) => (value) => {
|
|
22878
23027
|
if (typeof value === 'string') {
|
|
22879
23028
|
const preset = presets[value];
|
|
@@ -22882,7 +23031,7 @@ const objectifyOptionWithPresets = (presets, optionName, additionalValues) => (v
|
|
|
22882
23031
|
}
|
|
22883
23032
|
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));
|
|
22884
23033
|
}
|
|
22885
|
-
return value
|
|
23034
|
+
return objectifyOption(value);
|
|
22886
23035
|
};
|
|
22887
23036
|
const getOptionWithPreset = (value, presets, optionName, additionalValues) => {
|
|
22888
23037
|
var _a;
|
|
@@ -23530,16 +23679,26 @@ function defineConfig(options) {
|
|
|
23530
23679
|
|
|
23531
23680
|
let fsEvents;
|
|
23532
23681
|
let fsEventsImportError;
|
|
23533
|
-
function loadFsEvents() {
|
|
23534
|
-
|
|
23535
|
-
|
|
23536
|
-
|
|
23537
|
-
|
|
23538
|
-
})
|
|
23539
|
-
.catch(err => {
|
|
23682
|
+
async function loadFsEvents() {
|
|
23683
|
+
try {
|
|
23684
|
+
({ default: fsEvents } = await import('fsevents'));
|
|
23685
|
+
}
|
|
23686
|
+
catch (err) {
|
|
23540
23687
|
fsEventsImportError = err;
|
|
23541
|
-
}
|
|
23688
|
+
}
|
|
23542
23689
|
}
|
|
23690
|
+
// A call to this function will be injected into the chokidar code
|
|
23691
|
+
function getFsEvents() {
|
|
23692
|
+
if (fsEventsImportError)
|
|
23693
|
+
throw fsEventsImportError;
|
|
23694
|
+
return fsEvents;
|
|
23695
|
+
}
|
|
23696
|
+
|
|
23697
|
+
const fseventsImporter = {
|
|
23698
|
+
__proto__: null,
|
|
23699
|
+
loadFsEvents,
|
|
23700
|
+
getFsEvents
|
|
23701
|
+
};
|
|
23543
23702
|
|
|
23544
23703
|
class WatchEmitter extends EventEmitter {
|
|
23545
23704
|
constructor() {
|
|
@@ -23563,4 +23722,4 @@ function watch(configs) {
|
|
|
23563
23722
|
return emitter;
|
|
23564
23723
|
}
|
|
23565
23724
|
|
|
23566
|
-
export { createFilter, defaultOnWarn, defineConfig, ensureArray, generatedCodePresets, objectifyOptionWithPresets, picomatch, rollup, rollupInternal, treeshakePresets, version$1 as version, warnUnknownOptions, watch };
|
|
23725
|
+
export { createFilter, defaultOnWarn, defineConfig, ensureArray, fseventsImporter, generatedCodePresets, getAugmentedNamespace, objectifyOption, objectifyOptionWithPresets, picomatch, rollup, rollupInternal, treeshakePresets, version$1 as version, warnUnknownOptions, watch };
|