vite 2.9.6 → 2.9.7
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.
Potentially problematic release.
This version of vite might be problematic. Click here for more details.
- package/LICENSE.md +55 -1
- package/dist/node/chunks/{dep-9a1d6029.js → dep-0429b5b4.js} +1 -1
- package/dist/node/chunks/{dep-3397b401.js → dep-88bd5805.js} +452 -311
- package/dist/node/chunks/{dep-bcc0af00.js → dep-a9015192.js} +0 -0
- package/dist/node/chunks/{dep-a6041359.js → dep-c7a54f50.js} +1 -1
- package/dist/node/chunks/{dep-60989a1a.js → dep-fb8c3a62.js} +1 -1
- package/dist/node/cli.js +5 -5
- package/dist/node/index.d.ts +3 -0
- package/dist/node/index.js +1 -1
- package/dist/node/terser.js +7932 -6619
- package/package.json +10 -10
|
@@ -84,10 +84,6 @@ function getAugmentedNamespace(n) {
|
|
|
84
84
|
return a;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
function commonjsRequire (path) {
|
|
88
|
-
throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
89
|
-
}
|
|
90
|
-
|
|
91
87
|
var picocolors = {exports: {}};
|
|
92
88
|
|
|
93
89
|
let tty = require$$0__default;
|
|
@@ -1717,10 +1713,6 @@ const LINE_GTR_ZERO = '`line` must be greater than 0 (lines start at line 1)';
|
|
|
1717
1713
|
const COL_GTR_EQ_ZERO = '`column` must be greater than or equal to 0 (columns start at column 0)';
|
|
1718
1714
|
const LEAST_UPPER_BOUND = -1;
|
|
1719
1715
|
const GREATEST_LOWER_BOUND = 1;
|
|
1720
|
-
/**
|
|
1721
|
-
* Returns the encoded (VLQ string) form of the SourceMap's mappings field.
|
|
1722
|
-
*/
|
|
1723
|
-
let encodedMappings;
|
|
1724
1716
|
/**
|
|
1725
1717
|
* Returns the decoded (array of lines of segments) form of the SourceMap's mappings field.
|
|
1726
1718
|
*/
|
|
@@ -1735,12 +1727,7 @@ let traceSegment;
|
|
|
1735
1727
|
* (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in
|
|
1736
1728
|
* `source-map` library.
|
|
1737
1729
|
*/
|
|
1738
|
-
let originalPositionFor;
|
|
1739
|
-
/**
|
|
1740
|
-
* A helper that skips sorting of the input map's mappings array, which can be expensive for larger
|
|
1741
|
-
* maps.
|
|
1742
|
-
*/
|
|
1743
|
-
let presortedDecodedMap;
|
|
1730
|
+
let originalPositionFor$1;
|
|
1744
1731
|
class TraceMap {
|
|
1745
1732
|
constructor(map, mapUrl) {
|
|
1746
1733
|
this._decodedMemo = memoizedState();
|
|
@@ -1776,10 +1763,6 @@ class TraceMap {
|
|
|
1776
1763
|
}
|
|
1777
1764
|
}
|
|
1778
1765
|
(() => {
|
|
1779
|
-
encodedMappings = (map) => {
|
|
1780
|
-
var _a;
|
|
1781
|
-
return ((_a = map._encoded) !== null && _a !== void 0 ? _a : (map._encoded = encode$1(map._decoded)));
|
|
1782
|
-
};
|
|
1783
1766
|
decodedMappings = (map) => {
|
|
1784
1767
|
return (map._decoded || (map._decoded = decode(map._encoded)));
|
|
1785
1768
|
};
|
|
@@ -1791,7 +1774,7 @@ class TraceMap {
|
|
|
1791
1774
|
return null;
|
|
1792
1775
|
return traceSegmentInternal(decoded[line], map._decodedMemo, line, column, GREATEST_LOWER_BOUND);
|
|
1793
1776
|
};
|
|
1794
|
-
originalPositionFor = (map, { line, column, bias }) => {
|
|
1777
|
+
originalPositionFor$1 = (map, { line, column, bias }) => {
|
|
1795
1778
|
line--;
|
|
1796
1779
|
if (line < 0)
|
|
1797
1780
|
throw new Error(LINE_GTR_ZERO);
|
|
@@ -1815,13 +1798,6 @@ class TraceMap {
|
|
|
1815
1798
|
name: segment.length === 5 ? names[segment[NAMES_INDEX]] : null,
|
|
1816
1799
|
};
|
|
1817
1800
|
};
|
|
1818
|
-
presortedDecodedMap = (map, mapUrl) => {
|
|
1819
|
-
const clone = Object.assign({}, map);
|
|
1820
|
-
clone.mappings = [];
|
|
1821
|
-
const tracer = new TraceMap(clone, mapUrl);
|
|
1822
|
-
tracer._decoded = map.mappings;
|
|
1823
|
-
return tracer;
|
|
1824
|
-
};
|
|
1825
1801
|
})();
|
|
1826
1802
|
function traceSegmentInternal(segments, memo, line, column, bias) {
|
|
1827
1803
|
let index = memoizedBinarySearch(segments, column, memo, line);
|
|
@@ -1836,170 +1812,259 @@ function traceSegmentInternal(segments, memo, line, column, bias) {
|
|
|
1836
1812
|
}
|
|
1837
1813
|
|
|
1838
1814
|
/**
|
|
1839
|
-
*
|
|
1840
|
-
* source file. Recursive segment tracing ends at the `OriginalSource`.
|
|
1815
|
+
* Gets the index associated with `key` in the backing array, if it is already present.
|
|
1841
1816
|
*/
|
|
1842
|
-
|
|
1843
|
-
constructor(source, content) {
|
|
1844
|
-
this.source = source;
|
|
1845
|
-
this.content = content;
|
|
1846
|
-
}
|
|
1847
|
-
/**
|
|
1848
|
-
* Tracing a `SourceMapSegment` ends when we get to an `OriginalSource`,
|
|
1849
|
-
* meaning this line/column location originated from this source file.
|
|
1850
|
-
*/
|
|
1851
|
-
originalPositionFor(line, column, name) {
|
|
1852
|
-
return { column, line, name, source: this.source, content: this.content };
|
|
1853
|
-
}
|
|
1854
|
-
}
|
|
1855
|
-
|
|
1817
|
+
let get;
|
|
1856
1818
|
/**
|
|
1857
1819
|
* Puts `key` into the backing array, if it is not already present. Returns
|
|
1858
1820
|
* the index of the `key` in the backing array.
|
|
1859
1821
|
*/
|
|
1860
1822
|
let put;
|
|
1861
1823
|
/**
|
|
1862
|
-
*
|
|
1863
|
-
*
|
|
1824
|
+
* SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the
|
|
1825
|
+
* index of the `key` in the backing array.
|
|
1864
1826
|
*
|
|
1865
|
-
* This is designed to allow synchronizing a second array with the contents of
|
|
1866
|
-
*
|
|
1867
|
-
*
|
|
1827
|
+
* This is designed to allow synchronizing a second array with the contents of the backing array,
|
|
1828
|
+
* like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`,
|
|
1829
|
+
* and there are never duplicates.
|
|
1868
1830
|
*/
|
|
1869
|
-
class
|
|
1831
|
+
class SetArray {
|
|
1870
1832
|
constructor() {
|
|
1871
|
-
this.
|
|
1833
|
+
this._indexes = { __proto__: null };
|
|
1872
1834
|
this.array = [];
|
|
1873
1835
|
}
|
|
1874
1836
|
}
|
|
1875
1837
|
(() => {
|
|
1838
|
+
get = (strarr, key) => strarr._indexes[key];
|
|
1876
1839
|
put = (strarr, key) => {
|
|
1877
|
-
const { array, indexes } = strarr;
|
|
1878
1840
|
// The key may or may not be present. If it is present, it's a number.
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
array.push(key);
|
|
1885
|
-
}
|
|
1886
|
-
return index;
|
|
1841
|
+
const index = get(strarr, key);
|
|
1842
|
+
if (index !== undefined)
|
|
1843
|
+
return index;
|
|
1844
|
+
const { array, _indexes: indexes } = strarr;
|
|
1845
|
+
return (indexes[key] = array.push(key) - 1);
|
|
1887
1846
|
};
|
|
1888
1847
|
})();
|
|
1889
1848
|
|
|
1890
|
-
const INVALID_MAPPING = undefined;
|
|
1891
|
-
const SOURCELESS_MAPPING = null;
|
|
1892
1849
|
/**
|
|
1893
|
-
*
|
|
1894
|
-
*
|
|
1850
|
+
* A low-level API to associate a generated position with an original source position. Line and
|
|
1851
|
+
* column here are 0-based, unlike `addMapping`.
|
|
1895
1852
|
*/
|
|
1896
|
-
let
|
|
1853
|
+
let addSegment;
|
|
1897
1854
|
/**
|
|
1898
|
-
*
|
|
1899
|
-
* mappings into its child nodes (which may themselves be SourceMapTrees).
|
|
1855
|
+
* Adds/removes the content of the source file to the source map.
|
|
1900
1856
|
*/
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1857
|
+
let setSourceContent;
|
|
1858
|
+
/**
|
|
1859
|
+
* Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects
|
|
1860
|
+
* a sourcemap, or to JSON.stringify.
|
|
1861
|
+
*/
|
|
1862
|
+
let decodedMap;
|
|
1863
|
+
/**
|
|
1864
|
+
* Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects
|
|
1865
|
+
* a sourcemap, or to JSON.stringify.
|
|
1866
|
+
*/
|
|
1867
|
+
let encodedMap;
|
|
1868
|
+
/**
|
|
1869
|
+
* Provides the state to generate a sourcemap.
|
|
1870
|
+
*/
|
|
1871
|
+
class GenMapping {
|
|
1872
|
+
constructor({ file, sourceRoot } = {}) {
|
|
1873
|
+
this._names = new SetArray();
|
|
1874
|
+
this._sources = new SetArray();
|
|
1875
|
+
this._sourcesContent = [];
|
|
1876
|
+
this._mappings = [];
|
|
1877
|
+
this.file = file;
|
|
1878
|
+
this.sourceRoot = sourceRoot;
|
|
1921
1879
|
}
|
|
1922
1880
|
}
|
|
1923
1881
|
(() => {
|
|
1924
|
-
|
|
1925
|
-
const mappings =
|
|
1926
|
-
const
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
continue;
|
|
1951
|
-
}
|
|
1952
|
-
const genCol = segment[0];
|
|
1953
|
-
if (traced === SOURCELESS_MAPPING) {
|
|
1954
|
-
if (lastSourcesIndex === -1) {
|
|
1955
|
-
// This is a consecutive source-less segment, which doesn't carry any new information.
|
|
1956
|
-
continue;
|
|
1957
|
-
}
|
|
1958
|
-
lastSourcesIndex = lastSourceLine = lastSourceColumn = -1;
|
|
1959
|
-
tracedSegments.push([genCol]);
|
|
1960
|
-
continue;
|
|
1961
|
-
}
|
|
1962
|
-
// So we traced a segment down into its original source file. Now push a
|
|
1963
|
-
// new segment pointing to this location.
|
|
1964
|
-
const { column, line, name, content, source } = traced;
|
|
1965
|
-
// Store the source location, and ensure we keep sourcesContent up to
|
|
1966
|
-
// date with the sources array.
|
|
1967
|
-
const sourcesIndex = put(sources, source);
|
|
1968
|
-
sourcesContent[sourcesIndex] = content;
|
|
1969
|
-
if (lastSourcesIndex === sourcesIndex &&
|
|
1970
|
-
lastSourceLine === line &&
|
|
1971
|
-
lastSourceColumn === column) {
|
|
1972
|
-
// This is a duplicate mapping pointing at the exact same starting point in the source
|
|
1973
|
-
// file. It doesn't carry any new information, and only bloats the sourcemap.
|
|
1974
|
-
continue;
|
|
1975
|
-
}
|
|
1976
|
-
lastLineWithSegment = i;
|
|
1977
|
-
lastSourcesIndex = sourcesIndex;
|
|
1978
|
-
lastSourceLine = line;
|
|
1979
|
-
lastSourceColumn = column;
|
|
1980
|
-
// This looks like unnecessary duplication, but it noticeably increases performance. If we
|
|
1981
|
-
// were to push the nameIndex onto length-4 array, v8 would internally allocate 22 slots!
|
|
1982
|
-
// That's 68 wasted bytes! Array literals have the same capacity as their length, saving
|
|
1983
|
-
// memory.
|
|
1984
|
-
tracedSegments.push(name
|
|
1985
|
-
? [genCol, sourcesIndex, line, column, put(names, name)]
|
|
1986
|
-
: [genCol, sourcesIndex, line, column]);
|
|
1987
|
-
}
|
|
1988
|
-
mappings.push(tracedSegments);
|
|
1989
|
-
}
|
|
1990
|
-
if (mappings.length > lastLineWithSegment + 1) {
|
|
1991
|
-
mappings.length = lastLineWithSegment + 1;
|
|
1992
|
-
}
|
|
1993
|
-
return presortedDecodedMap(Object.assign({}, tree.map, {
|
|
1994
|
-
mappings,
|
|
1995
|
-
// TODO: Make all sources relative to the sourceRoot.
|
|
1996
|
-
sourceRoot: undefined,
|
|
1882
|
+
addSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name) => {
|
|
1883
|
+
const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = map;
|
|
1884
|
+
const line = getLine$1(mappings, genLine);
|
|
1885
|
+
if (source == null) {
|
|
1886
|
+
const seg = [genColumn];
|
|
1887
|
+
const index = getColumnIndex(line, genColumn, seg);
|
|
1888
|
+
return insert(line, index, seg);
|
|
1889
|
+
}
|
|
1890
|
+
const sourcesIndex = put(sources, source);
|
|
1891
|
+
const seg = name
|
|
1892
|
+
? [genColumn, sourcesIndex, sourceLine, sourceColumn, put(names, name)]
|
|
1893
|
+
: [genColumn, sourcesIndex, sourceLine, sourceColumn];
|
|
1894
|
+
const index = getColumnIndex(line, genColumn, seg);
|
|
1895
|
+
if (sourcesIndex === sourcesContent.length)
|
|
1896
|
+
sourcesContent[sourcesIndex] = null;
|
|
1897
|
+
insert(line, index, seg);
|
|
1898
|
+
};
|
|
1899
|
+
setSourceContent = (map, source, content) => {
|
|
1900
|
+
const { _sources: sources, _sourcesContent: sourcesContent } = map;
|
|
1901
|
+
sourcesContent[put(sources, source)] = content;
|
|
1902
|
+
};
|
|
1903
|
+
decodedMap = (map) => {
|
|
1904
|
+
const { file, sourceRoot, _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = map;
|
|
1905
|
+
return {
|
|
1906
|
+
version: 3,
|
|
1907
|
+
file,
|
|
1997
1908
|
names: names.array,
|
|
1909
|
+
sourceRoot: sourceRoot || undefined,
|
|
1998
1910
|
sources: sources.array,
|
|
1999
1911
|
sourcesContent,
|
|
2000
|
-
|
|
1912
|
+
mappings,
|
|
1913
|
+
};
|
|
1914
|
+
};
|
|
1915
|
+
encodedMap = (map) => {
|
|
1916
|
+
const decoded = decodedMap(map);
|
|
1917
|
+
return Object.assign(Object.assign({}, decoded), { mappings: encode$1(decoded.mappings) });
|
|
2001
1918
|
};
|
|
2002
1919
|
})();
|
|
1920
|
+
function getLine$1(mappings, index) {
|
|
1921
|
+
for (let i = mappings.length; i <= index; i++) {
|
|
1922
|
+
mappings[i] = [];
|
|
1923
|
+
}
|
|
1924
|
+
return mappings[index];
|
|
1925
|
+
}
|
|
1926
|
+
function getColumnIndex(line, column, seg) {
|
|
1927
|
+
let index = line.length;
|
|
1928
|
+
for (let i = index - 1; i >= 0; i--, index--) {
|
|
1929
|
+
const current = line[i];
|
|
1930
|
+
const col = current[0];
|
|
1931
|
+
if (col > column)
|
|
1932
|
+
continue;
|
|
1933
|
+
if (col < column)
|
|
1934
|
+
break;
|
|
1935
|
+
const cmp = compare$1(current, seg);
|
|
1936
|
+
if (cmp === 0)
|
|
1937
|
+
return index;
|
|
1938
|
+
if (cmp < 0)
|
|
1939
|
+
break;
|
|
1940
|
+
}
|
|
1941
|
+
return index;
|
|
1942
|
+
}
|
|
1943
|
+
function compare$1(a, b) {
|
|
1944
|
+
let cmp = compareNum(a.length, b.length);
|
|
1945
|
+
if (cmp !== 0)
|
|
1946
|
+
return cmp;
|
|
1947
|
+
// We've already checked genColumn
|
|
1948
|
+
if (a.length === 1)
|
|
1949
|
+
return 0;
|
|
1950
|
+
cmp = compareNum(a[1], b[1]);
|
|
1951
|
+
if (cmp !== 0)
|
|
1952
|
+
return cmp;
|
|
1953
|
+
cmp = compareNum(a[2], b[2]);
|
|
1954
|
+
if (cmp !== 0)
|
|
1955
|
+
return cmp;
|
|
1956
|
+
cmp = compareNum(a[3], b[3]);
|
|
1957
|
+
if (cmp !== 0)
|
|
1958
|
+
return cmp;
|
|
1959
|
+
if (a.length === 4)
|
|
1960
|
+
return 0;
|
|
1961
|
+
return compareNum(a[4], b[4]);
|
|
1962
|
+
}
|
|
1963
|
+
function compareNum(a, b) {
|
|
1964
|
+
return a - b;
|
|
1965
|
+
}
|
|
1966
|
+
function insert(array, index, value) {
|
|
1967
|
+
if (index === -1)
|
|
1968
|
+
return;
|
|
1969
|
+
for (let i = array.length; i > index; i--) {
|
|
1970
|
+
array[i] = array[i - 1];
|
|
1971
|
+
}
|
|
1972
|
+
array[index] = value;
|
|
1973
|
+
}
|
|
1974
|
+
|
|
1975
|
+
const SOURCELESS_MAPPING = {
|
|
1976
|
+
source: null,
|
|
1977
|
+
column: null,
|
|
1978
|
+
line: null,
|
|
1979
|
+
name: null,
|
|
1980
|
+
content: null,
|
|
1981
|
+
};
|
|
1982
|
+
const EMPTY_SOURCES = [];
|
|
1983
|
+
function Source(map, sources, source, content) {
|
|
1984
|
+
return {
|
|
1985
|
+
map,
|
|
1986
|
+
sources,
|
|
1987
|
+
source,
|
|
1988
|
+
content,
|
|
1989
|
+
};
|
|
1990
|
+
}
|
|
1991
|
+
/**
|
|
1992
|
+
* MapSource represents a single sourcemap, with the ability to trace mappings into its child nodes
|
|
1993
|
+
* (which may themselves be SourceMapTrees).
|
|
1994
|
+
*/
|
|
1995
|
+
function MapSource(map, sources) {
|
|
1996
|
+
return Source(map, sources, '', null);
|
|
1997
|
+
}
|
|
1998
|
+
/**
|
|
1999
|
+
* A "leaf" node in the sourcemap tree, representing an original, unmodified source file. Recursive
|
|
2000
|
+
* segment tracing ends at the `OriginalSource`.
|
|
2001
|
+
*/
|
|
2002
|
+
function OriginalSource(source, content) {
|
|
2003
|
+
return Source(null, EMPTY_SOURCES, source, content);
|
|
2004
|
+
}
|
|
2005
|
+
/**
|
|
2006
|
+
* traceMappings is only called on the root level SourceMapTree, and begins the process of
|
|
2007
|
+
* resolving each mapping in terms of the original source files.
|
|
2008
|
+
*/
|
|
2009
|
+
function traceMappings(tree) {
|
|
2010
|
+
const gen = new GenMapping({ file: tree.map.file });
|
|
2011
|
+
const { sources: rootSources, map } = tree;
|
|
2012
|
+
const rootNames = map.names;
|
|
2013
|
+
const rootMappings = decodedMappings(map);
|
|
2014
|
+
for (let i = 0; i < rootMappings.length; i++) {
|
|
2015
|
+
const segments = rootMappings[i];
|
|
2016
|
+
let lastSource = null;
|
|
2017
|
+
let lastSourceLine = null;
|
|
2018
|
+
let lastSourceColumn = null;
|
|
2019
|
+
for (let j = 0; j < segments.length; j++) {
|
|
2020
|
+
const segment = segments[j];
|
|
2021
|
+
const genCol = segment[0];
|
|
2022
|
+
let traced = SOURCELESS_MAPPING;
|
|
2023
|
+
// 1-length segments only move the current generated column, there's no source information
|
|
2024
|
+
// to gather from it.
|
|
2025
|
+
if (segment.length !== 1) {
|
|
2026
|
+
const source = rootSources[segment[1]];
|
|
2027
|
+
traced = originalPositionFor(source, segment[2], segment[3], segment.length === 5 ? rootNames[segment[4]] : '');
|
|
2028
|
+
// If the trace is invalid, then the trace ran into a sourcemap that doesn't contain a
|
|
2029
|
+
// respective segment into an original source.
|
|
2030
|
+
if (traced == null)
|
|
2031
|
+
continue;
|
|
2032
|
+
}
|
|
2033
|
+
// So we traced a segment down into its original source file. Now push a
|
|
2034
|
+
// new segment pointing to this location.
|
|
2035
|
+
const { column, line, name, content, source } = traced;
|
|
2036
|
+
if (line === lastSourceLine && column === lastSourceColumn && source === lastSource) {
|
|
2037
|
+
continue;
|
|
2038
|
+
}
|
|
2039
|
+
lastSourceLine = line;
|
|
2040
|
+
lastSourceColumn = column;
|
|
2041
|
+
lastSource = source;
|
|
2042
|
+
// Sigh, TypeScript can't figure out source/line/column are either all null, or all non-null...
|
|
2043
|
+
addSegment(gen, i, genCol, source, line, column, name);
|
|
2044
|
+
if (content != null)
|
|
2045
|
+
setSourceContent(gen, source, content);
|
|
2046
|
+
}
|
|
2047
|
+
}
|
|
2048
|
+
return gen;
|
|
2049
|
+
}
|
|
2050
|
+
/**
|
|
2051
|
+
* originalPositionFor is only called on children SourceMapTrees. It recurses down into its own
|
|
2052
|
+
* child SourceMapTrees, until we find the original source map.
|
|
2053
|
+
*/
|
|
2054
|
+
function originalPositionFor(source, line, column, name) {
|
|
2055
|
+
if (!source.map) {
|
|
2056
|
+
return { column, line, name, source: source.source, content: source.content };
|
|
2057
|
+
}
|
|
2058
|
+
const segment = traceSegment(source.map, line, column);
|
|
2059
|
+
// If we couldn't find a segment, then this doesn't exist in the sourcemap.
|
|
2060
|
+
if (segment == null)
|
|
2061
|
+
return null;
|
|
2062
|
+
// 1-length segments only move the current generated column, there's no source information
|
|
2063
|
+
// to gather from it.
|
|
2064
|
+
if (segment.length === 1)
|
|
2065
|
+
return SOURCELESS_MAPPING;
|
|
2066
|
+
return originalPositionFor(source.sources[segment[1]], segment[2], segment[3], segment.length === 5 ? source.map.names[segment[4]] : name);
|
|
2067
|
+
}
|
|
2003
2068
|
|
|
2004
2069
|
function asArray(value) {
|
|
2005
2070
|
if (Array.isArray(value))
|
|
@@ -2028,7 +2093,7 @@ function buildSourceMapTree(input, loader) {
|
|
|
2028
2093
|
}
|
|
2029
2094
|
let tree = build$2(map, loader, '', 0);
|
|
2030
2095
|
for (let i = maps.length - 1; i >= 0; i--) {
|
|
2031
|
-
tree =
|
|
2096
|
+
tree = MapSource(maps[i], [tree]);
|
|
2032
2097
|
}
|
|
2033
2098
|
return tree;
|
|
2034
2099
|
}
|
|
@@ -2050,19 +2115,17 @@ function build$2(map, loader, importer, importerDepth) {
|
|
|
2050
2115
|
// TODO: We should eventually support async loading of sourcemap files.
|
|
2051
2116
|
const sourceMap = loader(ctx.source, ctx);
|
|
2052
2117
|
const { source, content } = ctx;
|
|
2053
|
-
// If there is
|
|
2054
|
-
if (
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
// source files.
|
|
2063
|
-
return build$2(new TraceMap(sourceMap, source), loader, source, depth);
|
|
2118
|
+
// If there is a sourcemap, then we need to recurse into it to load its source files.
|
|
2119
|
+
if (sourceMap)
|
|
2120
|
+
return build$2(new TraceMap(sourceMap, source), loader, source, depth);
|
|
2121
|
+
// Else, it's an an unmodified source file.
|
|
2122
|
+
// The contents of this unmodified source file can be overridden via the loader context,
|
|
2123
|
+
// allowing it to be explicitly null or a string. If it remains undefined, we fall back to
|
|
2124
|
+
// the importing sourcemap's `sourcesContent` field.
|
|
2125
|
+
const sourceContent = content !== undefined ? content : sourcesContent ? sourcesContent[i] : null;
|
|
2126
|
+
return OriginalSource(source, sourceContent);
|
|
2064
2127
|
});
|
|
2065
|
-
return
|
|
2128
|
+
return MapSource(map, children);
|
|
2066
2129
|
}
|
|
2067
2130
|
|
|
2068
2131
|
/**
|
|
@@ -2071,14 +2134,15 @@ function build$2(map, loader, importer, importerDepth) {
|
|
|
2071
2134
|
*/
|
|
2072
2135
|
class SourceMap$2 {
|
|
2073
2136
|
constructor(map, options) {
|
|
2074
|
-
|
|
2075
|
-
this.
|
|
2076
|
-
this.
|
|
2077
|
-
this.
|
|
2078
|
-
this.
|
|
2079
|
-
this.
|
|
2080
|
-
|
|
2081
|
-
|
|
2137
|
+
const out = options.decodedMappings ? decodedMap(map) : encodedMap(map);
|
|
2138
|
+
this.version = out.version; // SourceMap spec says this should be first.
|
|
2139
|
+
this.file = out.file;
|
|
2140
|
+
this.mappings = out.mappings;
|
|
2141
|
+
this.names = out.names;
|
|
2142
|
+
this.sourceRoot = out.sourceRoot;
|
|
2143
|
+
this.sources = out.sources;
|
|
2144
|
+
if (!options.excludeContent) {
|
|
2145
|
+
this.sourcesContent = out.sourcesContent;
|
|
2082
2146
|
}
|
|
2083
2147
|
}
|
|
2084
2148
|
toString() {
|
|
@@ -5702,6 +5766,8 @@ var TSConfckParseError = class extends Error {
|
|
|
5702
5766
|
};
|
|
5703
5767
|
|
|
5704
5768
|
const debug$f = createDebugger('vite:esbuild');
|
|
5769
|
+
const INJECT_HELPERS_IIFE_RE = /(.*)(var [^\s]+=function\(.*\){"use strict";)(.*)/;
|
|
5770
|
+
const INJECT_HELPERS_UMD_RE = /(.*)(\(function\(.*\){.+amd.+function\(.*\){"use strict";)(.*)/;
|
|
5705
5771
|
let server;
|
|
5706
5772
|
async function transformWithEsbuild(code, filename, options, inMap) {
|
|
5707
5773
|
var _a;
|
|
@@ -5880,6 +5946,21 @@ const buildEsbuildPlugin = (config) => {
|
|
|
5880
5946
|
}
|
|
5881
5947
|
: undefined)
|
|
5882
5948
|
});
|
|
5949
|
+
if (config.build.lib) {
|
|
5950
|
+
// #7188, esbuild adds helpers out of the UMD and IIFE wrappers, and the
|
|
5951
|
+
// names are minified potentially causing collision with other globals.
|
|
5952
|
+
// We use a regex to inject the helpers inside the wrappers.
|
|
5953
|
+
// We don't need to create a MagicString here because both the helpers and
|
|
5954
|
+
// the headers don't modify the sourcemap
|
|
5955
|
+
const injectHelpers = opts.format === 'umd'
|
|
5956
|
+
? INJECT_HELPERS_UMD_RE
|
|
5957
|
+
: opts.format === 'iife'
|
|
5958
|
+
? INJECT_HELPERS_IIFE_RE
|
|
5959
|
+
: undefined;
|
|
5960
|
+
if (injectHelpers) {
|
|
5961
|
+
res.code = res.code.replace(injectHelpers, (_, helpers, header, rest) => header + helpers + rest);
|
|
5962
|
+
}
|
|
5963
|
+
}
|
|
5883
5964
|
return res;
|
|
5884
5965
|
}
|
|
5885
5966
|
};
|
|
@@ -27951,7 +28032,7 @@ const withTypeScriptLoader = (rcFunc) => {
|
|
|
27951
28032
|
// Register TypeScript compiler instance
|
|
27952
28033
|
registerer = require('ts-node').register();
|
|
27953
28034
|
|
|
27954
|
-
return
|
|
28035
|
+
return eval('require')(configFile)
|
|
27955
28036
|
} catch (err) {
|
|
27956
28037
|
if (err.code === 'MODULE_NOT_FOUND') {
|
|
27957
28038
|
throw new Error(
|
|
@@ -28797,9 +28878,8 @@ function polyfill() {
|
|
|
28797
28878
|
// bank on the non-overlapping nature of regex matches and combine all filters into one giant regex
|
|
28798
28879
|
// /`([^`\$\{\}]|\$\{(`|\g<1>)*\})*`/g can match nested string template
|
|
28799
28880
|
// but js not support match expression(\g<0>). so clean string template(`...`) in other ways.
|
|
28800
|
-
const stringsRE = /"([^"\r\n]|(?<=\\)")*"|'([^'\r\n]|(?<=\\)')*'
|
|
28801
|
-
const
|
|
28802
|
-
const cleanerRE = new RegExp(`${stringsRE}|${commentsRE}`, 'g');
|
|
28881
|
+
const stringsRE = /"([^"\r\n]|(?<=\\)")*"|'([^'\r\n]|(?<=\\)')*'/g;
|
|
28882
|
+
const cleanerRE = new RegExp(`${stringsRE.source}|${multilineCommentsRE.source}|${singlelineCommentsRE.source}`, 'g');
|
|
28803
28883
|
const blankReplacer = (s) => ' '.repeat(s.length);
|
|
28804
28884
|
const stringBlankReplacer = (s) => `${s[0]}${'\0'.repeat(s.length - 2)}${s[0]}`;
|
|
28805
28885
|
function emptyString(raw) {
|
|
@@ -28813,6 +28893,9 @@ function emptyString(raw) {
|
|
|
28813
28893
|
}
|
|
28814
28894
|
return res;
|
|
28815
28895
|
}
|
|
28896
|
+
function emptyCssComments(raw) {
|
|
28897
|
+
return raw.replace(multilineCommentsRE, blankReplacer);
|
|
28898
|
+
}
|
|
28816
28899
|
function replaceAt(string, start, end, replacement) {
|
|
28817
28900
|
return string.slice(0, start) + replacement + string.slice(end);
|
|
28818
28901
|
}
|
|
@@ -28898,7 +28981,7 @@ function error$3(pos) {
|
|
|
28898
28981
|
}
|
|
28899
28982
|
|
|
28900
28983
|
const htmlProxyRE$1 = /\?html-proxy=?[&inline\-css]*&index=(\d+)\.(js|css)$/;
|
|
28901
|
-
const inlineCSSRE$1 = /__VITE_INLINE_CSS__([
|
|
28984
|
+
const inlineCSSRE$1 = /__VITE_INLINE_CSS__([a-z\d]{8}_\d+)__/g;
|
|
28902
28985
|
// Do not allow preceding '.', but do allow preceding '...' for spread operations
|
|
28903
28986
|
const inlineImportRE = /(?<!(?<!\.\.)\.)\bimport\s*\(("([^"]|(?<=\\)")*"|'([^']|(?<=\\)')*')\)/g;
|
|
28904
28987
|
const htmlLangRE = /\.(html|htm)$/;
|
|
@@ -28907,8 +28990,8 @@ const isHTMLRequest = (request) => htmlLangRE.test(request);
|
|
|
28907
28990
|
// HTML Proxy Caches are stored by config -> filePath -> index
|
|
28908
28991
|
const htmlProxyMap = new WeakMap();
|
|
28909
28992
|
// HTML Proxy Transform result are stored by config
|
|
28910
|
-
// `${importer}_${query.index}` -> transformed css code
|
|
28911
|
-
// PS: key like
|
|
28993
|
+
// `${hash(importer)}_${query.index}` -> transformed css code
|
|
28994
|
+
// PS: key like `hash(/vite/packages/playground/assets/index.html)_1`)
|
|
28912
28995
|
const htmlProxyResult = new Map();
|
|
28913
28996
|
function htmlInlineProxyPlugin(config) {
|
|
28914
28997
|
// Should do this when `constructor` rather than when `buildStart`,
|
|
@@ -28963,7 +29046,7 @@ const assetAttrsConfig = {
|
|
|
28963
29046
|
const isAsyncScriptMap = new WeakMap();
|
|
28964
29047
|
async function traverseHtml(html, filePath, visitor) {
|
|
28965
29048
|
// lazy load compiler
|
|
28966
|
-
const { parse, transform } = await Promise.resolve().then(function () { return require('./dep-
|
|
29049
|
+
const { parse, transform } = await Promise.resolve().then(function () { return require('./dep-c7a54f50.js'); }).then(function (n) { return n.compilerDom_cjs; });
|
|
28967
29050
|
// @vue/compiler-core doesn't like lowercase doctypes
|
|
28968
29051
|
html = html.replace(/<!doctype\s/i, '<!DOCTYPE ');
|
|
28969
29052
|
try {
|
|
@@ -29153,8 +29236,9 @@ function buildHtmlPlugin(config) {
|
|
|
29153
29236
|
addToHTMLProxyCache(config, filePath, inlineModuleIndex, { code });
|
|
29154
29237
|
// will transform with css plugin and cache result with css-post plugin
|
|
29155
29238
|
js += `\nimport "${id}?html-proxy&inline-css&index=${inlineModuleIndex}.css"`;
|
|
29239
|
+
const hash = getAssetHash(cleanUrl(id));
|
|
29156
29240
|
// will transform in `applyHtmlTransforms`
|
|
29157
|
-
s.overwrite(styleNode.loc.start.offset, styleNode.loc.end.offset, `"__VITE_INLINE_CSS__${
|
|
29241
|
+
s.overwrite(styleNode.loc.start.offset, styleNode.loc.end.offset, `"__VITE_INLINE_CSS__${hash}_${inlineModuleIndex}__"`, { contentOnly: true });
|
|
29158
29242
|
}
|
|
29159
29243
|
// <style>...</style>
|
|
29160
29244
|
if (node.tag === 'style' && node.children.length) {
|
|
@@ -29165,8 +29249,9 @@ function buildHtmlPlugin(config) {
|
|
|
29165
29249
|
code: styleNode.content
|
|
29166
29250
|
});
|
|
29167
29251
|
js += `\nimport "${id}?html-proxy&inline-css&index=${inlineModuleIndex}.css"`;
|
|
29252
|
+
const hash = getAssetHash(cleanUrl(id));
|
|
29168
29253
|
// will transform in `applyHtmlTransforms`
|
|
29169
|
-
s.overwrite(styleNode.loc.start.offset, styleNode.loc.end.offset, `__VITE_INLINE_CSS__${
|
|
29254
|
+
s.overwrite(styleNode.loc.start.offset, styleNode.loc.end.offset, `__VITE_INLINE_CSS__${hash}_${inlineModuleIndex}__`, { contentOnly: true });
|
|
29170
29255
|
}
|
|
29171
29256
|
if (shouldRemove) {
|
|
29172
29257
|
// remove the script tag from the html. we are going to inject new
|
|
@@ -29723,9 +29808,15 @@ function cssPostPlugin(config) {
|
|
|
29723
29808
|
SPECIAL_QUERY_RE.test(id)) {
|
|
29724
29809
|
return;
|
|
29725
29810
|
}
|
|
29811
|
+
const isHTMLProxy = htmlProxyRE.test(id);
|
|
29726
29812
|
const inlined = inlineRE.test(id);
|
|
29727
29813
|
const modules = cssModulesCache.get(config).get(id);
|
|
29728
|
-
|
|
29814
|
+
// #6984, #7552
|
|
29815
|
+
// `foo.module.css` => modulesCode
|
|
29816
|
+
// `foo.module.css?inline` => cssContent
|
|
29817
|
+
const modulesCode = modules &&
|
|
29818
|
+
!inlined &&
|
|
29819
|
+
dataToEsm(modules, { namedExports: true, preferConst: true });
|
|
29729
29820
|
if (config.command === 'serve') {
|
|
29730
29821
|
if (isDirectCSSRequest(id)) {
|
|
29731
29822
|
return css;
|
|
@@ -29744,6 +29835,9 @@ function cssPostPlugin(config) {
|
|
|
29744
29835
|
await injectSourcesContent(sourcemap, cleanUrl(id), config.logger);
|
|
29745
29836
|
cssContent = getCodeWithSourcemap('css', css, sourcemap);
|
|
29746
29837
|
}
|
|
29838
|
+
if (isHTMLProxy) {
|
|
29839
|
+
return cssContent;
|
|
29840
|
+
}
|
|
29747
29841
|
return [
|
|
29748
29842
|
`import { updateStyle as __vite__updateStyle, removeStyle as __vite__removeStyle } from ${JSON.stringify(path__default.posix.join(config.base, CLIENT_PUBLIC_PATH))}`,
|
|
29749
29843
|
`const __vite__id = ${JSON.stringify(id)}`,
|
|
@@ -29762,9 +29856,8 @@ function cssPostPlugin(config) {
|
|
|
29762
29856
|
// and then use the cache replace inline-style-flag when `generateBundle` in vite:build-html plugin
|
|
29763
29857
|
const inlineCSS = inlineCSSRE.test(id);
|
|
29764
29858
|
const query = parseRequest(id);
|
|
29765
|
-
const isHTMLProxy = htmlProxyRE.test(id);
|
|
29766
29859
|
if (inlineCSS && isHTMLProxy) {
|
|
29767
|
-
addToHTMLProxyTransformResult(`${cleanUrl(id)}_${Number.parseInt(query.index)}`, css);
|
|
29860
|
+
addToHTMLProxyTransformResult(`${getAssetHash(cleanUrl(id))}_${Number.parseInt(query.index)}`, css);
|
|
29768
29861
|
return `export default ''`;
|
|
29769
29862
|
}
|
|
29770
29863
|
if (!inlined) {
|
|
@@ -29772,11 +29865,15 @@ function cssPostPlugin(config) {
|
|
|
29772
29865
|
}
|
|
29773
29866
|
let code;
|
|
29774
29867
|
if (usedRE.test(id)) {
|
|
29775
|
-
if (
|
|
29776
|
-
code =
|
|
29868
|
+
if (modulesCode) {
|
|
29869
|
+
code = modulesCode;
|
|
29777
29870
|
}
|
|
29778
29871
|
else {
|
|
29779
|
-
|
|
29872
|
+
let content = css;
|
|
29873
|
+
if (config.build.minify) {
|
|
29874
|
+
content = await minifyCSS(content, config);
|
|
29875
|
+
}
|
|
29876
|
+
code = `export default ${JSON.stringify(content)}`;
|
|
29780
29877
|
}
|
|
29781
29878
|
}
|
|
29782
29879
|
else {
|
|
@@ -30045,11 +30142,10 @@ async function compileCSS(id, code, config, urlReplacer, atImportResolvers, serv
|
|
|
30045
30142
|
const postcssOptions = (postcssConfig && postcssConfig.options) || {};
|
|
30046
30143
|
const postcssPlugins = postcssConfig && postcssConfig.plugins ? postcssConfig.plugins.slice() : [];
|
|
30047
30144
|
if (needInlineImport) {
|
|
30048
|
-
|
|
30049
|
-
postcssPlugins.unshift((await Promise.resolve().then(function () { return require('./dep-bcc0af00.js'); }).then(function (n) { return n.index; })).default({
|
|
30145
|
+
postcssPlugins.unshift((await Promise.resolve().then(function () { return require('./dep-a9015192.js'); }).then(function (n) { return n.index; })).default({
|
|
30050
30146
|
async resolve(id, basedir) {
|
|
30051
30147
|
const publicFile = checkPublicFile(id, config);
|
|
30052
|
-
if (
|
|
30148
|
+
if (publicFile) {
|
|
30053
30149
|
return publicFile;
|
|
30054
30150
|
}
|
|
30055
30151
|
const resolved = await atImportResolvers.css(id, path__default.join(basedir, '*'));
|
|
@@ -30064,7 +30160,7 @@ async function compileCSS(id, code, config, urlReplacer, atImportResolvers, serv
|
|
|
30064
30160
|
replacer: urlReplacer
|
|
30065
30161
|
}));
|
|
30066
30162
|
if (isModule) {
|
|
30067
|
-
postcssPlugins.unshift((await Promise.resolve().then(function () { return require('./dep-
|
|
30163
|
+
postcssPlugins.unshift((await Promise.resolve().then(function () { return require('./dep-0429b5b4.js'); }).then(function (n) { return n.index; })).default({
|
|
30068
30164
|
...modulesOptions,
|
|
30069
30165
|
getJSON(cssFileName, _modules, outputFileName) {
|
|
30070
30166
|
modules = _modules;
|
|
@@ -30170,30 +30266,20 @@ async function compileCSS(id, code, config, urlReplacer, atImportResolvers, serv
|
|
|
30170
30266
|
}
|
|
30171
30267
|
function formatPostcssSourceMap(rawMap, file) {
|
|
30172
30268
|
const inputFileDir = path__default.dirname(file);
|
|
30173
|
-
const sources =
|
|
30174
|
-
const sourcesContent = [];
|
|
30175
|
-
for (const [i, source] of rawMap.sources.entries()) {
|
|
30176
|
-
// remove <no source> from sources, to prevent source map to be combined incorrectly
|
|
30177
|
-
if (source === '<no source>')
|
|
30178
|
-
continue;
|
|
30269
|
+
const sources = rawMap.sources.map((source) => {
|
|
30179
30270
|
const cleanSource = cleanUrl(decodeURIComponent(source));
|
|
30180
30271
|
// postcss returns virtual files
|
|
30181
30272
|
if (/^<.+>$/.test(cleanSource)) {
|
|
30182
|
-
|
|
30273
|
+
return `\0${cleanSource}`;
|
|
30183
30274
|
}
|
|
30184
|
-
|
|
30185
|
-
|
|
30186
|
-
}
|
|
30187
|
-
if (rawMap.sourcesContent) {
|
|
30188
|
-
sourcesContent.push(rawMap.sourcesContent[i]);
|
|
30189
|
-
}
|
|
30190
|
-
}
|
|
30275
|
+
return normalizePath$4(path__default.resolve(inputFileDir, cleanSource));
|
|
30276
|
+
});
|
|
30191
30277
|
return {
|
|
30192
30278
|
file,
|
|
30193
30279
|
mappings: rawMap.mappings,
|
|
30194
30280
|
names: rawMap.names,
|
|
30195
30281
|
sources,
|
|
30196
|
-
sourcesContent,
|
|
30282
|
+
sourcesContent: rawMap.sourcesContent,
|
|
30197
30283
|
version: rawMap.version
|
|
30198
30284
|
};
|
|
30199
30285
|
}
|
|
@@ -30224,14 +30310,23 @@ async function resolvePostcssConfig(config) {
|
|
|
30224
30310
|
};
|
|
30225
30311
|
}
|
|
30226
30312
|
else {
|
|
30313
|
+
const searchPath = typeof inlineOptions === 'string' ? inlineOptions : config.root;
|
|
30227
30314
|
try {
|
|
30228
|
-
const searchPath = typeof inlineOptions === 'string' ? inlineOptions : config.root;
|
|
30229
30315
|
// @ts-ignore
|
|
30230
30316
|
result = await src$1({}, searchPath);
|
|
30231
30317
|
}
|
|
30232
30318
|
catch (e) {
|
|
30233
30319
|
if (!/No PostCSS Config found/.test(e.message)) {
|
|
30234
|
-
|
|
30320
|
+
if (e instanceof Error) {
|
|
30321
|
+
const { name, message, stack } = e;
|
|
30322
|
+
e.name = 'Failed to load PostCSS config';
|
|
30323
|
+
e.message = `Failed to load PostCSS config (searchPath: ${searchPath}): [${name}] ${message}\n${stack}`;
|
|
30324
|
+
e.stack = ''; // add stack to message to retain stack
|
|
30325
|
+
throw e;
|
|
30326
|
+
}
|
|
30327
|
+
else {
|
|
30328
|
+
throw new Error(`Failed to load PostCSS config: ${e}`);
|
|
30329
|
+
}
|
|
30235
30330
|
}
|
|
30236
30331
|
result = null;
|
|
30237
30332
|
}
|
|
@@ -30352,24 +30447,29 @@ async function minifyCSS(css, config) {
|
|
|
30352
30447
|
}
|
|
30353
30448
|
async function hoistAtRules(css) {
|
|
30354
30449
|
const s = new MagicString(css);
|
|
30450
|
+
const cleanCss = emptyCssComments(css);
|
|
30451
|
+
let match;
|
|
30355
30452
|
// #1845
|
|
30356
30453
|
// CSS @import can only appear at top of the file. We need to hoist all @import
|
|
30357
30454
|
// to top when multiple files are concatenated.
|
|
30358
30455
|
// match until semicolon that's not in quotes
|
|
30359
|
-
|
|
30360
|
-
|
|
30361
|
-
|
|
30362
|
-
|
|
30456
|
+
const atImportRE = /@import\s*(?:url\([^\)]*\)|"([^"]|(?<=\\)")*"|'([^']|(?<=\\)')*'|[^;]*).*?;/gm;
|
|
30457
|
+
while ((match = atImportRE.exec(cleanCss))) {
|
|
30458
|
+
s.remove(match.index, match.index + match[0].length);
|
|
30459
|
+
// Use `appendLeft` instead of `prepend` to preserve original @import order
|
|
30460
|
+
s.appendLeft(0, match[0]);
|
|
30461
|
+
}
|
|
30363
30462
|
// #6333
|
|
30364
30463
|
// CSS @charset must be the top-first in the file, hoist the first to top
|
|
30464
|
+
const atCharsetRE = /@charset\s*(?:"([^"]|(?<=\\)")*"|'([^']|(?<=\\)')*'|[^;]*).*?;/gm;
|
|
30365
30465
|
let foundCharset = false;
|
|
30366
|
-
|
|
30466
|
+
while ((match = atCharsetRE.exec(cleanCss))) {
|
|
30467
|
+
s.remove(match.index, match.index + match[0].length);
|
|
30367
30468
|
if (!foundCharset) {
|
|
30368
|
-
s.prepend(match);
|
|
30469
|
+
s.prepend(match[0]);
|
|
30369
30470
|
foundCharset = true;
|
|
30370
30471
|
}
|
|
30371
|
-
|
|
30372
|
-
});
|
|
30472
|
+
}
|
|
30373
30473
|
return s.toString();
|
|
30374
30474
|
}
|
|
30375
30475
|
const loadedPreprocessors = {};
|
|
@@ -32279,6 +32379,7 @@ const preloadMarker = `__VITE_PRELOAD__`;
|
|
|
32279
32379
|
const preloadBaseMarker = `__VITE_PRELOAD_BASE__`;
|
|
32280
32380
|
const preloadHelperId = 'vite/preload-helper';
|
|
32281
32381
|
const preloadMarkerWithQuote = `"${preloadMarker}"`;
|
|
32382
|
+
const dynamicImportPrefixRE = /import\s*\(/;
|
|
32282
32383
|
/**
|
|
32283
32384
|
* Helper for preloading CSS and direct imports of async chunks in parallel to
|
|
32284
32385
|
* the async chunk itself.
|
|
@@ -32334,8 +32435,8 @@ function preload(baseModule, deps) {
|
|
|
32334
32435
|
*/
|
|
32335
32436
|
function buildImportAnalysisPlugin(config) {
|
|
32336
32437
|
const ssr = !!config.build.ssr;
|
|
32337
|
-
const insertPreload = !(ssr || !!config.build.lib);
|
|
32338
32438
|
const isWorker = config.isWorker;
|
|
32439
|
+
const insertPreload = !(ssr || !!config.build.lib || isWorker);
|
|
32339
32440
|
const scriptRel = config.build.polyfillModulePreload
|
|
32340
32441
|
? `'modulepreload'`
|
|
32341
32442
|
: `(${detectScriptRel.toString()})()`;
|
|
@@ -32359,11 +32460,8 @@ function buildImportAnalysisPlugin(config) {
|
|
|
32359
32460
|
},
|
|
32360
32461
|
async transform(source, importer) {
|
|
32361
32462
|
if (importer.includes('node_modules') &&
|
|
32362
|
-
!source.includes('import.meta.glob')
|
|
32363
|
-
|
|
32364
|
-
}
|
|
32365
|
-
if (isWorker) {
|
|
32366
|
-
// preload method use `document` and can't run in the worker
|
|
32463
|
+
!source.includes('import.meta.glob') &&
|
|
32464
|
+
!dynamicImportPrefixRE.test(source)) {
|
|
32367
32465
|
return;
|
|
32368
32466
|
}
|
|
32369
32467
|
await init;
|
|
@@ -32385,6 +32483,13 @@ function buildImportAnalysisPlugin(config) {
|
|
|
32385
32483
|
// import.meta.glob
|
|
32386
32484
|
if (source.slice(start, end) === 'import.meta' &&
|
|
32387
32485
|
source.slice(end, end + 5) === '.glob') {
|
|
32486
|
+
// es worker allow globEager / glob
|
|
32487
|
+
// iife worker just allow globEager
|
|
32488
|
+
if (isWorker &&
|
|
32489
|
+
config.worker.format === 'iife' &&
|
|
32490
|
+
source.slice(end, end + 10) !== '.globEager') {
|
|
32491
|
+
this.error('`import.meta.glob` is not supported in workers with `iife` format, use `import.meta.globEager` instead.', end);
|
|
32492
|
+
}
|
|
32388
32493
|
const { importsString, exp, endIndex, isEager } = await transformImportGlob(source, start, importer, index, config.root, config.logger, undefined, resolve, insertPreload);
|
|
32389
32494
|
str().prepend(importsString);
|
|
32390
32495
|
str().overwrite(expStart, endIndex, exp, { contentOnly: true });
|
|
@@ -32739,6 +32844,20 @@ function esbuildDepPlugin(qualified, exportsData, config) {
|
|
|
32739
32844
|
};
|
|
32740
32845
|
}
|
|
32741
32846
|
|
|
32847
|
+
// This file was generated. Do not modify manually!
|
|
32848
|
+
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];
|
|
32849
|
+
|
|
32850
|
+
// This file was generated. Do not modify manually!
|
|
32851
|
+
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];
|
|
32852
|
+
|
|
32853
|
+
// This file was generated. Do not modify manually!
|
|
32854
|
+
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";
|
|
32855
|
+
|
|
32856
|
+
// This file was generated. Do not modify manually!
|
|
32857
|
+
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";
|
|
32858
|
+
|
|
32859
|
+
// These are a run-length and offset encoded representation of the
|
|
32860
|
+
|
|
32742
32861
|
// Reserved word lists for various dialects of the language
|
|
32743
32862
|
|
|
32744
32863
|
var reservedWords = {
|
|
@@ -32763,31 +32882,9 @@ var keywordRelationalOperator = /^in(stanceof)?$/;
|
|
|
32763
32882
|
|
|
32764
32883
|
// ## Character categories
|
|
32765
32884
|
|
|
32766
|
-
// Big ugly regular expressions that match characters in the
|
|
32767
|
-
// whitespace, identifier, and identifier-start categories. These
|
|
32768
|
-
// are only applied when a character is found to actually have a
|
|
32769
|
-
// code point above 128.
|
|
32770
|
-
// Generated by `bin/generate-identifier-regex.js`.
|
|
32771
|
-
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";
|
|
32772
|
-
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";
|
|
32773
|
-
|
|
32774
32885
|
var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
|
|
32775
32886
|
var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
|
|
32776
32887
|
|
|
32777
|
-
nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
|
|
32778
|
-
|
|
32779
|
-
// These are a run-length and offset encoded representation of the
|
|
32780
|
-
// >0xffff code points that are a valid part of identifiers. The
|
|
32781
|
-
// offset starts at 0x10000, and each pair of numbers represents an
|
|
32782
|
-
// offset to the next range, and then a size of the range. They were
|
|
32783
|
-
// generated by bin/generate-identifier-regex.js
|
|
32784
|
-
|
|
32785
|
-
// eslint-disable-next-line comma-spacing
|
|
32786
|
-
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];
|
|
32787
|
-
|
|
32788
|
-
// eslint-disable-next-line comma-spacing
|
|
32789
|
-
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];
|
|
32790
|
-
|
|
32791
32888
|
// This has a complexity linear to the value of the code. The
|
|
32792
32889
|
// assumption is that looking up astral identifier characters is
|
|
32793
32890
|
// rare.
|
|
@@ -33022,6 +33119,13 @@ function wordsRegexp(words) {
|
|
|
33022
33119
|
return new RegExp("^(?:" + words.replace(/ /g, "|") + ")$")
|
|
33023
33120
|
}
|
|
33024
33121
|
|
|
33122
|
+
function codePointToString(code) {
|
|
33123
|
+
// UTF-16 Decoding
|
|
33124
|
+
if (code <= 0xFFFF) { return String.fromCharCode(code) }
|
|
33125
|
+
code -= 0x10000;
|
|
33126
|
+
return String.fromCharCode((code >> 10) + 0xD800, (code & 1023) + 0xDC00)
|
|
33127
|
+
}
|
|
33128
|
+
|
|
33025
33129
|
var loneSurrogate = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/;
|
|
33026
33130
|
|
|
33027
33131
|
// These are used when `options.locations` is on, for the
|
|
@@ -33389,6 +33493,7 @@ var pp$9 = Parser.prototype;
|
|
|
33389
33493
|
|
|
33390
33494
|
var literal = /^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/;
|
|
33391
33495
|
pp$9.strictDirective = function(start) {
|
|
33496
|
+
if (this.options.ecmaVersion < 5) { return false }
|
|
33392
33497
|
for (;;) {
|
|
33393
33498
|
// Try to find string literal.
|
|
33394
33499
|
skipWhiteSpace.lastIndex = start;
|
|
@@ -33491,14 +33596,14 @@ pp$9.unexpected = function(pos) {
|
|
|
33491
33596
|
this.raise(pos != null ? pos : this.start, "Unexpected token");
|
|
33492
33597
|
};
|
|
33493
33598
|
|
|
33494
|
-
function DestructuringErrors() {
|
|
33599
|
+
var DestructuringErrors = function DestructuringErrors() {
|
|
33495
33600
|
this.shorthandAssign =
|
|
33496
33601
|
this.trailingComma =
|
|
33497
33602
|
this.parenthesizedAssign =
|
|
33498
33603
|
this.parenthesizedBind =
|
|
33499
33604
|
this.doubleProto =
|
|
33500
33605
|
-1;
|
|
33501
|
-
}
|
|
33606
|
+
};
|
|
33502
33607
|
|
|
33503
33608
|
pp$9.checkPatternErrors = function(refDestructuringErrors, isAssign) {
|
|
33504
33609
|
if (!refDestructuringErrors) { return }
|
|
@@ -34379,7 +34484,7 @@ pp$8.parseExport = function(node, exports) {
|
|
|
34379
34484
|
if (this.options.ecmaVersion >= 11) {
|
|
34380
34485
|
if (this.eatContextual("as")) {
|
|
34381
34486
|
node.exported = this.parseModuleExportName();
|
|
34382
|
-
this.checkExport(exports, node.exported
|
|
34487
|
+
this.checkExport(exports, node.exported, this.lastTokStart);
|
|
34383
34488
|
} else {
|
|
34384
34489
|
node.exported = null;
|
|
34385
34490
|
}
|
|
@@ -34413,7 +34518,7 @@ pp$8.parseExport = function(node, exports) {
|
|
|
34413
34518
|
if (node.declaration.type === "VariableDeclaration")
|
|
34414
34519
|
{ this.checkVariableExport(exports, node.declaration.declarations); }
|
|
34415
34520
|
else
|
|
34416
|
-
{ this.checkExport(exports, node.declaration.id
|
|
34521
|
+
{ this.checkExport(exports, node.declaration.id, node.declaration.id.start); }
|
|
34417
34522
|
node.specifiers = [];
|
|
34418
34523
|
node.source = null;
|
|
34419
34524
|
} else { // export { x, y as z } [from '...']
|
|
@@ -34445,6 +34550,8 @@ pp$8.parseExport = function(node, exports) {
|
|
|
34445
34550
|
|
|
34446
34551
|
pp$8.checkExport = function(exports, name, pos) {
|
|
34447
34552
|
if (!exports) { return }
|
|
34553
|
+
if (typeof name !== "string")
|
|
34554
|
+
{ name = name.type === "Identifier" ? name.name : name.value; }
|
|
34448
34555
|
if (hasOwn(exports, name))
|
|
34449
34556
|
{ this.raiseRecoverable(pos, "Duplicate export '" + name + "'"); }
|
|
34450
34557
|
exports[name] = true;
|
|
@@ -34453,7 +34560,7 @@ pp$8.checkExport = function(exports, name, pos) {
|
|
|
34453
34560
|
pp$8.checkPatternExport = function(exports, pat) {
|
|
34454
34561
|
var type = pat.type;
|
|
34455
34562
|
if (type === "Identifier")
|
|
34456
|
-
{ this.checkExport(exports, pat
|
|
34563
|
+
{ this.checkExport(exports, pat, pat.start); }
|
|
34457
34564
|
else if (type === "ObjectPattern")
|
|
34458
34565
|
{ for (var i = 0, list = pat.properties; i < list.length; i += 1)
|
|
34459
34566
|
{
|
|
@@ -34513,7 +34620,7 @@ pp$8.parseExportSpecifiers = function(exports) {
|
|
|
34513
34620
|
node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local;
|
|
34514
34621
|
this.checkExport(
|
|
34515
34622
|
exports,
|
|
34516
|
-
node.exported
|
|
34623
|
+
node.exported,
|
|
34517
34624
|
node.exported.start
|
|
34518
34625
|
);
|
|
34519
34626
|
nodes.push(this.finishNode(node, "ExportSpecifier"));
|
|
@@ -36503,12 +36610,6 @@ RegExpValidationState.prototype.eat = function eat (ch, forceU) {
|
|
|
36503
36610
|
return false
|
|
36504
36611
|
};
|
|
36505
36612
|
|
|
36506
|
-
function codePointToString$1(ch) {
|
|
36507
|
-
if (ch <= 0xFFFF) { return String.fromCharCode(ch) }
|
|
36508
|
-
ch -= 0x10000;
|
|
36509
|
-
return String.fromCharCode((ch >> 10) + 0xD800, (ch & 0x03FF) + 0xDC00)
|
|
36510
|
-
}
|
|
36511
|
-
|
|
36512
36613
|
/**
|
|
36513
36614
|
* Validate the flags part of a given RegExpLiteral.
|
|
36514
36615
|
*
|
|
@@ -36873,9 +36974,9 @@ pp$1.regexp_eatGroupName = function(state) {
|
|
|
36873
36974
|
pp$1.regexp_eatRegExpIdentifierName = function(state) {
|
|
36874
36975
|
state.lastStringValue = "";
|
|
36875
36976
|
if (this.regexp_eatRegExpIdentifierStart(state)) {
|
|
36876
|
-
state.lastStringValue += codePointToString
|
|
36977
|
+
state.lastStringValue += codePointToString(state.lastIntValue);
|
|
36877
36978
|
while (this.regexp_eatRegExpIdentifierPart(state)) {
|
|
36878
|
-
state.lastStringValue += codePointToString
|
|
36979
|
+
state.lastStringValue += codePointToString(state.lastIntValue);
|
|
36879
36980
|
}
|
|
36880
36981
|
return true
|
|
36881
36982
|
}
|
|
@@ -37227,7 +37328,7 @@ pp$1.regexp_eatUnicodePropertyName = function(state) {
|
|
|
37227
37328
|
var ch = 0;
|
|
37228
37329
|
state.lastStringValue = "";
|
|
37229
37330
|
while (isUnicodePropertyNameCharacter(ch = state.current())) {
|
|
37230
|
-
state.lastStringValue += codePointToString
|
|
37331
|
+
state.lastStringValue += codePointToString(ch);
|
|
37231
37332
|
state.advance();
|
|
37232
37333
|
}
|
|
37233
37334
|
return state.lastStringValue !== ""
|
|
@@ -37242,7 +37343,7 @@ pp$1.regexp_eatUnicodePropertyValue = function(state) {
|
|
|
37242
37343
|
var ch = 0;
|
|
37243
37344
|
state.lastStringValue = "";
|
|
37244
37345
|
while (isUnicodePropertyValueCharacter(ch = state.current())) {
|
|
37245
|
-
state.lastStringValue += codePointToString
|
|
37346
|
+
state.lastStringValue += codePointToString(ch);
|
|
37246
37347
|
state.advance();
|
|
37247
37348
|
}
|
|
37248
37349
|
return state.lastStringValue !== ""
|
|
@@ -38025,13 +38126,6 @@ pp.readCodePoint = function() {
|
|
|
38025
38126
|
return code
|
|
38026
38127
|
};
|
|
38027
38128
|
|
|
38028
|
-
function codePointToString(code) {
|
|
38029
|
-
// UTF-16 Decoding
|
|
38030
|
-
if (code <= 0xFFFF) { return String.fromCharCode(code) }
|
|
38031
|
-
code -= 0x10000;
|
|
38032
|
-
return String.fromCharCode((code >> 10) + 0xD800, (code & 1023) + 0xDC00)
|
|
38033
|
-
}
|
|
38034
|
-
|
|
38035
38129
|
pp.readString = function(quote) {
|
|
38036
38130
|
var out = "", chunkStart = ++this.pos;
|
|
38037
38131
|
for (;;) {
|
|
@@ -38276,7 +38370,7 @@ pp.readWord = function() {
|
|
|
38276
38370
|
|
|
38277
38371
|
// Acorn is a tiny, fast JavaScript parser written in JavaScript.
|
|
38278
38372
|
|
|
38279
|
-
var version = "8.7.
|
|
38373
|
+
var version = "8.7.1";
|
|
38280
38374
|
|
|
38281
38375
|
Parser.acorn = {
|
|
38282
38376
|
Parser: Parser,
|
|
@@ -38639,7 +38733,7 @@ async function createPluginContainer({ plugins, logger, root, build: { rollupOpt
|
|
|
38639
38733
|
const rawSourceMap = ctx._getCombinedSourcemap();
|
|
38640
38734
|
if (rawSourceMap) {
|
|
38641
38735
|
const traced = new TraceMap(rawSourceMap);
|
|
38642
|
-
const { source, line, column } = originalPositionFor(traced, {
|
|
38736
|
+
const { source, line, column } = originalPositionFor$1(traced, {
|
|
38643
38737
|
line: Number(err.loc.line),
|
|
38644
38738
|
column: Number(err.loc.column)
|
|
38645
38739
|
});
|
|
@@ -39481,7 +39575,7 @@ async function runOptimizeDeps(config, depsInfo) {
|
|
|
39481
39575
|
flatIdToExports[flatId] = exportsData;
|
|
39482
39576
|
}
|
|
39483
39577
|
const define = {
|
|
39484
|
-
'process.env.NODE_ENV': JSON.stringify(config.mode)
|
|
39578
|
+
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || config.mode)
|
|
39485
39579
|
};
|
|
39486
39580
|
for (const key in config.define) {
|
|
39487
39581
|
const value = config.define[key];
|
|
@@ -39737,7 +39831,7 @@ function getDepHash(config) {
|
|
|
39737
39831
|
// also take config into account
|
|
39738
39832
|
// only a subset of config options that can affect dep optimization
|
|
39739
39833
|
content += JSON.stringify({
|
|
39740
|
-
mode: config.mode,
|
|
39834
|
+
mode: process.env.NODE_ENV || config.mode,
|
|
39741
39835
|
root: config.root,
|
|
39742
39836
|
define: config.define,
|
|
39743
39837
|
resolve: config.resolve,
|
|
@@ -47221,7 +47315,7 @@ async function getCertificate(cacheDir) {
|
|
|
47221
47315
|
return content;
|
|
47222
47316
|
}
|
|
47223
47317
|
catch {
|
|
47224
|
-
const content = (await Promise.resolve().then(function () { return require('./dep-
|
|
47318
|
+
const content = (await Promise.resolve().then(function () { return require('./dep-fb8c3a62.js'); })).createCertificate();
|
|
47225
47319
|
fs$n.promises
|
|
47226
47320
|
.mkdir(cacheDir, { recursive: true })
|
|
47227
47321
|
.then(() => fs$n.promises.writeFile(cachePath, content))
|
|
@@ -49670,10 +49764,11 @@ const {
|
|
|
49670
49764
|
const { format, parse: parse$6 } = extension$1;
|
|
49671
49765
|
const { toBuffer } = bufferUtil$1.exports;
|
|
49672
49766
|
|
|
49767
|
+
const closeTimeout = 30 * 1000;
|
|
49768
|
+
const kAborted = Symbol('kAborted');
|
|
49769
|
+
const protocolVersions = [8, 13];
|
|
49673
49770
|
const readyStates = ['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED'];
|
|
49674
49771
|
const subprotocolRegex = /^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;
|
|
49675
|
-
const protocolVersions = [8, 13];
|
|
49676
|
-
const closeTimeout = 30 * 1000;
|
|
49677
49772
|
|
|
49678
49773
|
/**
|
|
49679
49774
|
* Class representing a WebSocket.
|
|
@@ -50287,7 +50382,7 @@ function initAsClient(websocket, address, protocols, options) {
|
|
|
50287
50382
|
hostname: undefined,
|
|
50288
50383
|
protocol: undefined,
|
|
50289
50384
|
timeout: undefined,
|
|
50290
|
-
method:
|
|
50385
|
+
method: 'GET',
|
|
50291
50386
|
host: undefined,
|
|
50292
50387
|
path: undefined,
|
|
50293
50388
|
port: undefined
|
|
@@ -50341,7 +50436,7 @@ function initAsClient(websocket, address, protocols, options) {
|
|
|
50341
50436
|
|
|
50342
50437
|
const defaultPort = isSecure ? 443 : 80;
|
|
50343
50438
|
const key = randomBytes(16).toString('base64');
|
|
50344
|
-
const
|
|
50439
|
+
const request = isSecure ? https$2.request : http$3.request;
|
|
50345
50440
|
const protocolSet = new Set();
|
|
50346
50441
|
let perMessageDeflate;
|
|
50347
50442
|
|
|
@@ -50406,6 +50501,8 @@ function initAsClient(websocket, address, protocols, options) {
|
|
|
50406
50501
|
opts.path = parts[1];
|
|
50407
50502
|
}
|
|
50408
50503
|
|
|
50504
|
+
let req;
|
|
50505
|
+
|
|
50409
50506
|
if (opts.followRedirects) {
|
|
50410
50507
|
if (websocket._redirects === 0) {
|
|
50411
50508
|
websocket._originalHost = parsedUrl.host;
|
|
@@ -50423,7 +50520,10 @@ function initAsClient(websocket, address, protocols, options) {
|
|
|
50423
50520
|
options.headers[key.toLowerCase()] = value;
|
|
50424
50521
|
}
|
|
50425
50522
|
}
|
|
50426
|
-
} else if (
|
|
50523
|
+
} else if (
|
|
50524
|
+
websocket.listenerCount('redirect') === 0 &&
|
|
50525
|
+
parsedUrl.host !== websocket._originalHost
|
|
50526
|
+
) {
|
|
50427
50527
|
//
|
|
50428
50528
|
// Match curl 7.77.0 behavior and drop the following headers. These
|
|
50429
50529
|
// headers are also dropped when following a redirect to a subdomain.
|
|
@@ -50443,9 +50543,24 @@ function initAsClient(websocket, address, protocols, options) {
|
|
|
50443
50543
|
options.headers.authorization =
|
|
50444
50544
|
'Basic ' + Buffer.from(opts.auth).toString('base64');
|
|
50445
50545
|
}
|
|
50446
|
-
}
|
|
50447
50546
|
|
|
50448
|
-
|
|
50547
|
+
req = websocket._req = request(opts);
|
|
50548
|
+
|
|
50549
|
+
if (websocket._redirects) {
|
|
50550
|
+
//
|
|
50551
|
+
// Unlike what is done for the `'upgrade'` event, no early exit is
|
|
50552
|
+
// triggered here if the user calls `websocket.close()` or
|
|
50553
|
+
// `websocket.terminate()` from a listener of the `'redirect'` event. This
|
|
50554
|
+
// is because the user can also call `request.destroy()` with an error
|
|
50555
|
+
// before calling `websocket.close()` or `websocket.terminate()` and this
|
|
50556
|
+
// would result in an error being emitted on the `request` object with no
|
|
50557
|
+
// `'error'` event listeners attached.
|
|
50558
|
+
//
|
|
50559
|
+
websocket.emit('redirect', websocket.url, req);
|
|
50560
|
+
}
|
|
50561
|
+
} else {
|
|
50562
|
+
req = websocket._req = request(opts);
|
|
50563
|
+
}
|
|
50449
50564
|
|
|
50450
50565
|
if (opts.timeout) {
|
|
50451
50566
|
req.on('timeout', () => {
|
|
@@ -50454,7 +50569,7 @@ function initAsClient(websocket, address, protocols, options) {
|
|
|
50454
50569
|
}
|
|
50455
50570
|
|
|
50456
50571
|
req.on('error', (err) => {
|
|
50457
|
-
if (req === null || req
|
|
50572
|
+
if (req === null || req[kAborted]) return;
|
|
50458
50573
|
|
|
50459
50574
|
req = websocket._req = null;
|
|
50460
50575
|
emitErrorAndClose(websocket, err);
|
|
@@ -50501,8 +50616,8 @@ function initAsClient(websocket, address, protocols, options) {
|
|
|
50501
50616
|
websocket.emit('upgrade', res);
|
|
50502
50617
|
|
|
50503
50618
|
//
|
|
50504
|
-
// The user may have closed the connection from a listener of the
|
|
50505
|
-
// event.
|
|
50619
|
+
// The user may have closed the connection from a listener of the
|
|
50620
|
+
// `'upgrade'` event.
|
|
50506
50621
|
//
|
|
50507
50622
|
if (websocket.readyState !== WebSocket$1.CONNECTING) return;
|
|
50508
50623
|
|
|
@@ -50587,10 +50702,12 @@ function initAsClient(websocket, address, protocols, options) {
|
|
|
50587
50702
|
skipUTF8Validation: opts.skipUTF8Validation
|
|
50588
50703
|
});
|
|
50589
50704
|
});
|
|
50705
|
+
|
|
50706
|
+
req.end();
|
|
50590
50707
|
}
|
|
50591
50708
|
|
|
50592
50709
|
/**
|
|
50593
|
-
* Emit the `'error'` and `'close'`
|
|
50710
|
+
* Emit the `'error'` and `'close'` events.
|
|
50594
50711
|
*
|
|
50595
50712
|
* @param {WebSocket} websocket The WebSocket instance
|
|
50596
50713
|
* @param {Error} The error to emit
|
|
@@ -50647,6 +50764,7 @@ function abortHandshake$1(websocket, stream, message) {
|
|
|
50647
50764
|
Error.captureStackTrace(err, abortHandshake$1);
|
|
50648
50765
|
|
|
50649
50766
|
if (stream.setHeader) {
|
|
50767
|
+
stream[kAborted] = true;
|
|
50650
50768
|
stream.abort();
|
|
50651
50769
|
|
|
50652
50770
|
if (stream.socket && !stream.socket.destroyed) {
|
|
@@ -50658,8 +50776,7 @@ function abortHandshake$1(websocket, stream, message) {
|
|
|
50658
50776
|
stream.socket.destroy();
|
|
50659
50777
|
}
|
|
50660
50778
|
|
|
50661
|
-
|
|
50662
|
-
websocket.emit('error', err);
|
|
50779
|
+
process.nextTick(emitErrorAndClose, websocket, err);
|
|
50663
50780
|
} else {
|
|
50664
50781
|
stream.destroy(err);
|
|
50665
50782
|
stream.once('error', websocket.emit.bind(websocket, 'error'));
|
|
@@ -56059,11 +56176,12 @@ const processNodeUrl = (node, s, config, htmlPath, originalUrl, moduleGraph) =>
|
|
|
56059
56176
|
}
|
|
56060
56177
|
};
|
|
56061
56178
|
const devHtmlHook = async (html, { path: htmlPath, filename, server, originalUrl }) => {
|
|
56062
|
-
const { config, moduleGraph } = server;
|
|
56179
|
+
const { config, moduleGraph, watcher } = server;
|
|
56063
56180
|
const base = config.base || '/';
|
|
56064
56181
|
const s = new MagicString(html);
|
|
56065
56182
|
let inlineModuleIndex = -1;
|
|
56066
56183
|
const filePath = cleanUrl(htmlPath);
|
|
56184
|
+
const styleUrl = [];
|
|
56067
56185
|
const addInlineModule = (node, ext) => {
|
|
56068
56186
|
inlineModuleIndex++;
|
|
56069
56187
|
const url = filePath.replace(normalizePath$4(config.root), '');
|
|
@@ -56100,7 +56218,12 @@ const devHtmlHook = async (html, { path: htmlPath, filename, server, originalUrl
|
|
|
56100
56218
|
}
|
|
56101
56219
|
}
|
|
56102
56220
|
if (node.tag === 'style' && node.children.length) {
|
|
56103
|
-
|
|
56221
|
+
const children = node.children[0];
|
|
56222
|
+
styleUrl.push({
|
|
56223
|
+
start: children.loc.start.offset,
|
|
56224
|
+
end: children.loc.end.offset,
|
|
56225
|
+
code: children.content
|
|
56226
|
+
});
|
|
56104
56227
|
}
|
|
56105
56228
|
// elements with [href/src] attrs
|
|
56106
56229
|
const assetAttrs = assetAttrsConfig[node.tag];
|
|
@@ -56114,6 +56237,14 @@ const devHtmlHook = async (html, { path: htmlPath, filename, server, originalUrl
|
|
|
56114
56237
|
}
|
|
56115
56238
|
}
|
|
56116
56239
|
});
|
|
56240
|
+
await Promise.all(styleUrl.map(async ({ start, end, code }, index) => {
|
|
56241
|
+
const url = filename + `?html-proxy&${index}.css`;
|
|
56242
|
+
// ensure module in graph after successful load
|
|
56243
|
+
const mod = await moduleGraph.ensureEntryFromUrl(url, false);
|
|
56244
|
+
ensureWatchedFile(watcher, mod.file, config.root);
|
|
56245
|
+
const result = await server.pluginContainer.transform(code, url);
|
|
56246
|
+
s.overwrite(start, end, (result === null || result === void 0 ? void 0 : result.code) || '');
|
|
56247
|
+
}));
|
|
56117
56248
|
html = s.toString();
|
|
56118
56249
|
return {
|
|
56119
56250
|
html,
|
|
@@ -57125,6 +57256,7 @@ class ModuleNode {
|
|
|
57125
57256
|
this.transformResult = null;
|
|
57126
57257
|
this.ssrTransformResult = null;
|
|
57127
57258
|
this.ssrModule = null;
|
|
57259
|
+
this.ssrError = null;
|
|
57128
57260
|
this.lastHMRTimestamp = 0;
|
|
57129
57261
|
this.lastInvalidationTimestamp = 0;
|
|
57130
57262
|
this.url = url;
|
|
@@ -58977,7 +59109,7 @@ function ssrRewriteStacktrace(stack, moduleGraph) {
|
|
|
58977
59109
|
return input;
|
|
58978
59110
|
}
|
|
58979
59111
|
const traced = new TraceMap(rawSourceMap);
|
|
58980
|
-
const pos = originalPositionFor(traced, {
|
|
59112
|
+
const pos = originalPositionFor$1(traced, {
|
|
58981
59113
|
line: Number(line) - offset,
|
|
58982
59114
|
column: Number(column)
|
|
58983
59115
|
});
|
|
@@ -59097,6 +59229,9 @@ async function ssrLoadModule(url, server, context = { global }, urlStack = [], f
|
|
|
59097
59229
|
async function instantiateModule(url, server, context = { global }, urlStack = [], fixStacktrace) {
|
|
59098
59230
|
const { moduleGraph } = server;
|
|
59099
59231
|
const mod = await moduleGraph.ensureEntryFromUrl(url, true);
|
|
59232
|
+
if (mod.ssrError) {
|
|
59233
|
+
throw mod.ssrError;
|
|
59234
|
+
}
|
|
59100
59235
|
if (mod.ssrModule) {
|
|
59101
59236
|
return mod.ssrModule;
|
|
59102
59237
|
}
|
|
@@ -59187,6 +59322,7 @@ async function instantiateModule(url, server, context = { global }, urlStack = [
|
|
|
59187
59322
|
await initModule(context.global, ssrModule, ssrImportMeta, ssrImport, ssrDynamicImport, ssrExportAll);
|
|
59188
59323
|
}
|
|
59189
59324
|
catch (e) {
|
|
59325
|
+
mod.ssrError = e;
|
|
59190
59326
|
if (e.stack && fixStacktrace !== false) {
|
|
59191
59327
|
const stacktrace = ssrRewriteStacktrace(e.stack, moduleGraph);
|
|
59192
59328
|
rebindErrorStacktrace(e, stacktrace);
|
|
@@ -59966,8 +60102,8 @@ function createServerCloseFn(server) {
|
|
|
59966
60102
|
function resolvedAllowDir(root, dir) {
|
|
59967
60103
|
return normalizePath$4(path__default.resolve(root, dir));
|
|
59968
60104
|
}
|
|
59969
|
-
function resolveServerOptions(root, raw) {
|
|
59970
|
-
var _a, _b, _c, _d;
|
|
60105
|
+
function resolveServerOptions(root, raw, logger) {
|
|
60106
|
+
var _a, _b, _c, _d, _e;
|
|
59971
60107
|
const server = {
|
|
59972
60108
|
preTransformRequests: true,
|
|
59973
60109
|
...raw
|
|
@@ -59988,6 +60124,10 @@ function resolveServerOptions(root, raw) {
|
|
|
59988
60124
|
allow: allowDirs,
|
|
59989
60125
|
deny
|
|
59990
60126
|
};
|
|
60127
|
+
if ((_e = server.origin) === null || _e === void 0 ? void 0 : _e.endsWith('/')) {
|
|
60128
|
+
server.origin = server.origin.slice(0, -1);
|
|
60129
|
+
logger.warn(colors$1.yellow(`${colors$1.bold('(!)')} server.origin should not end with "/". Using "${server.origin}" instead.`));
|
|
60130
|
+
}
|
|
59991
60131
|
return server;
|
|
59992
60132
|
}
|
|
59993
60133
|
async function restartServer(server) {
|
|
@@ -60496,6 +60636,9 @@ function emitWorkerAssets(ctx, config, asset) {
|
|
|
60496
60636
|
const { format } = config.worker;
|
|
60497
60637
|
return emitWorkerFile(ctx, config, asset, format === 'es' ? 'chunks' : 'assets');
|
|
60498
60638
|
}
|
|
60639
|
+
function emitWorkerSourcemap(ctx, config, asset) {
|
|
60640
|
+
return emitWorkerFile(ctx, config, asset, 'assets');
|
|
60641
|
+
}
|
|
60499
60642
|
function emitWorkerChunks(ctx, config, asset) {
|
|
60500
60643
|
return emitWorkerFile(ctx, config, asset, 'chunks');
|
|
60501
60644
|
}
|
|
@@ -60555,14 +60698,11 @@ function emitSourcemapForWorkerEntry(context, config, id, query, chunk) {
|
|
|
60555
60698
|
const contentHash = getAssetHash(content);
|
|
60556
60699
|
const fileName = `${basename}.${contentHash}.js.map`;
|
|
60557
60700
|
const filePath = path__default.posix.join(config.build.assetsDir, fileName);
|
|
60558
|
-
|
|
60559
|
-
|
|
60560
|
-
|
|
60561
|
-
|
|
60562
|
-
|
|
60563
|
-
source: data
|
|
60564
|
-
});
|
|
60565
|
-
}
|
|
60701
|
+
emitWorkerSourcemap(context, config, {
|
|
60702
|
+
fileName: filePath,
|
|
60703
|
+
type: 'asset',
|
|
60704
|
+
source: data
|
|
60705
|
+
});
|
|
60566
60706
|
// Emit the comment that tells the JS debugger where it can find the
|
|
60567
60707
|
// sourcemap file.
|
|
60568
60708
|
// 'hidden' causes the sourcemap file to be created but
|
|
@@ -60570,7 +60710,9 @@ function emitSourcemapForWorkerEntry(context, config, id, query, chunk) {
|
|
|
60570
60710
|
if (config.build.sourcemap === true) {
|
|
60571
60711
|
// inline web workers need to use the full sourcemap path
|
|
60572
60712
|
// non-inline web workers can use a relative path
|
|
60573
|
-
const sourceMapUrl = (query === null || query === void 0 ? void 0 : query.inline) != null
|
|
60713
|
+
const sourceMapUrl = (query === null || query === void 0 ? void 0 : query.inline) != null
|
|
60714
|
+
? path__default.posix.join(config.base, filePath)
|
|
60715
|
+
: fileName;
|
|
60574
60716
|
code += `//# sourceMappingURL=${sourceMapUrl}`;
|
|
60575
60717
|
}
|
|
60576
60718
|
}
|
|
@@ -60598,7 +60740,6 @@ async function workerFileToUrl(ctx, config, id, query) {
|
|
|
60598
60740
|
}
|
|
60599
60741
|
function webWorkerPlugin(config) {
|
|
60600
60742
|
const isBuild = config.command === 'build';
|
|
60601
|
-
const isWorker = config.isWorker;
|
|
60602
60743
|
return {
|
|
60603
60744
|
name: 'vite:worker',
|
|
60604
60745
|
buildStart() {
|
|
@@ -60671,7 +60812,7 @@ function webWorkerPlugin(config) {
|
|
|
60671
60812
|
};
|
|
60672
60813
|
},
|
|
60673
60814
|
renderChunk(code) {
|
|
60674
|
-
if (isWorker && code.includes('import.meta.url')) {
|
|
60815
|
+
if (config.isWorker && code.includes('import.meta.url')) {
|
|
60675
60816
|
return code.replace('import.meta.url', 'self.location.href');
|
|
60676
60817
|
}
|
|
60677
60818
|
}
|
|
@@ -61355,7 +61496,7 @@ async function resolveConfig(inlineConfig, command, defaultMode = 'development')
|
|
|
61355
61496
|
const resolvedPublicDir = publicDir !== false && publicDir !== ''
|
|
61356
61497
|
? path__default.resolve(resolvedRoot, typeof publicDir === 'string' ? publicDir : 'public')
|
|
61357
61498
|
: '';
|
|
61358
|
-
const server = resolveServerOptions(resolvedRoot, config.server);
|
|
61499
|
+
const server = resolveServerOptions(resolvedRoot, config.server, logger);
|
|
61359
61500
|
const optimizeDeps = config.optimizeDeps || {};
|
|
61360
61501
|
const resolved = {
|
|
61361
61502
|
...config,
|