🔧
This commit is contained in:
29
node_modules/vite/LICENSE.md
generated
vendored
29
node_modules/vite/LICENSE.md
generated
vendored
@@ -2186,6 +2186,35 @@ Repository: git+https://github.com/isaacs/isexe.git
|
||||
|
||||
---------------------------------------
|
||||
|
||||
## js-tokens
|
||||
License: MIT
|
||||
By: Simon Lydell
|
||||
Repository: lydell/js-tokens
|
||||
|
||||
> The MIT License (MIT)
|
||||
>
|
||||
> Copyright (c) 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Simon Lydell
|
||||
>
|
||||
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
> of this software and associated documentation files (the "Software"), to deal
|
||||
> in the Software without restriction, including without limitation the rights
|
||||
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
> copies of the Software, and to permit persons to whom the Software is
|
||||
> furnished to do so, subject to the following conditions:
|
||||
>
|
||||
> The above copyright notice and this permission notice shall be included in
|
||||
> all copies or substantial portions of the Software.
|
||||
>
|
||||
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
> THE SOFTWARE.
|
||||
|
||||
---------------------------------------
|
||||
|
||||
## json-stable-stringify
|
||||
License: MIT
|
||||
By: James Halliday
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { z as commonjsGlobal, y as getDefaultExportFromCjs } from './dep-R0I0XnyH.js';
|
||||
import { z as commonjsGlobal, y as getDefaultExportFromCjs } from './dep-9A4-l-43.js';
|
||||
import require$$0__default from 'fs';
|
||||
import require$$0 from 'postcss';
|
||||
import require$$0$1 from 'path';
|
||||
@@ -12552,10 +12552,10 @@ function processSrcSetSync(srcs, replacer) {
|
||||
descriptor,
|
||||
})));
|
||||
}
|
||||
const cleanSrcSetRE = /(?:url|image|gradient|cross-fade)\([^)]*\)|"([^"]|(?<=\\)")*"|'([^']|(?<=\\)')*'/g;
|
||||
const cleanSrcSetRE = /(?:url|image|gradient|cross-fade)\([^)]*\)|"([^"]|(?<=\\)")*"|'([^']|(?<=\\)')*'|data:\w+\/[\w.+\-]+;base64,[\w+/=]+/g;
|
||||
function splitSrcSet(srcs) {
|
||||
const parts = [];
|
||||
// There could be a ',' inside of url(data:...), linear-gradient(...) or "data:..."
|
||||
// There could be a ',' inside of url(data:...), linear-gradient(...), "data:..." or data:...
|
||||
const cleanedSrcs = srcs.replace(cleanSrcSetRE, blankReplacer);
|
||||
let startIndex = 0;
|
||||
let splitIndex;
|
||||
@@ -12742,8 +12742,8 @@ function arraify(target) {
|
||||
return Array.isArray(target) ? target : [target];
|
||||
}
|
||||
// Taken from https://stackoverflow.com/a/36328890
|
||||
const multilineCommentsRE$1 = /\/\*[^*]*\*+(?:[^/*][^*]*\*+)*\//g;
|
||||
const singlelineCommentsRE$1 = /\/\/.*/g;
|
||||
const multilineCommentsRE = /\/\*[^*]*\*+(?:[^/*][^*]*\*+)*\//g;
|
||||
const singlelineCommentsRE = /\/\/.*/g;
|
||||
const requestQuerySplitRE = /\?(?!.*[/|}])/;
|
||||
const requestQueryMaybeEscapedSplitRE = /\\?\?(?!.*[/|}])/;
|
||||
function parseRequest(id) {
|
||||
@@ -12776,7 +12776,7 @@ const requireResolveFromRootWithFallback = (root, id) => {
|
||||
return _require$2.resolve(id, { paths: [root, _dirname] });
|
||||
};
|
||||
function emptyCssComments(raw) {
|
||||
return raw.replace(multilineCommentsRE$1, (s) => ' '.repeat(s.length));
|
||||
return raw.replace(multilineCommentsRE, (s) => ' '.repeat(s.length));
|
||||
}
|
||||
function backwardCompatibleWorkerPlugins(plugins) {
|
||||
if (Array.isArray(plugins)) {
|
||||
@@ -27877,13 +27877,6 @@ function parseExpressionAt(input, pos, options) {
|
||||
return Parser$1.parseExpressionAt(input, pos, options)
|
||||
}
|
||||
|
||||
// Acorn is organized as a tokenizer and a recursive-descent parser.
|
||||
// The `tokenizer` export provides an interface to the tokenizer.
|
||||
|
||||
function tokenizer(input, options) {
|
||||
return Parser$1.tokenizer(input, options)
|
||||
}
|
||||
|
||||
const HASH_RE = /#/g;
|
||||
const AMPERSAND_RE = /&/g;
|
||||
const EQUAL_RE = /=/g;
|
||||
@@ -37617,112 +37610,468 @@ var src$1 = rc;
|
||||
|
||||
var postcssrc = /*@__PURE__*/getDefaultExportFromCjs(src$1);
|
||||
|
||||
function _stripLiteralAcorn(code, options) {
|
||||
// Copyright 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Simon Lydell
|
||||
// License: MIT.
|
||||
var Identifier, JSXIdentifier, JSXPunctuator, JSXString, JSXText, KeywordsWithExpressionAfter, KeywordsWithNoLineTerminatorAfter, LineTerminatorSequence, MultiLineComment, Newline, NumericLiteral, Punctuator, RegularExpressionLiteral, SingleLineComment, StringLiteral, Template, TokensNotPrecedingObjectLiteral, TokensPrecedingExpression, WhiteSpace;
|
||||
RegularExpressionLiteral = /\/(?![*\/])(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\\]).|\\.)*(\/[$_\u200C\u200D\p{ID_Continue}]*|\\)?/yu;
|
||||
Punctuator = /--|\+\+|=>|\.{3}|\??\.(?!\d)|(?:&&|\|\||\?\?|[+\-%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2}|\/(?![\/*]))=?|[?~,:;[\](){}]/y;
|
||||
Identifier = /(\x23?)(?=[$_\p{ID_Start}\\])(?:[$_\u200C\u200D\p{ID_Continue}]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+/yu;
|
||||
StringLiteral = /(['"])(?:(?!\1)[^\\\n\r]|\\(?:\r\n|[^]))*(\1)?/y;
|
||||
NumericLiteral = /(?:0[xX][\da-fA-F](?:_?[\da-fA-F])*|0[oO][0-7](?:_?[0-7])*|0[bB][01](?:_?[01])*)n?|0n|[1-9](?:_?\d)*n|(?:(?:0(?!\d)|0\d*[89]\d*|[1-9](?:_?\d)*)(?:\.(?:\d(?:_?\d)*)?)?|\.\d(?:_?\d)*)(?:[eE][+-]?\d(?:_?\d)*)?|0[0-7]+/y;
|
||||
Template = /[`}](?:[^`\\$]|\\[^]|\$(?!\{))*(`|\$\{)?/y;
|
||||
WhiteSpace = /[\t\v\f\ufeff\p{Zs}]+/yu;
|
||||
LineTerminatorSequence = /\r?\n|[\r\u2028\u2029]/y;
|
||||
MultiLineComment = /\/\*(?:[^*]|\*(?!\/))*(\*\/)?/y;
|
||||
SingleLineComment = /\/\/.*/y;
|
||||
JSXPunctuator = /[<>.:={}]|\/(?![\/*])/y;
|
||||
JSXIdentifier = /[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}-]*/yu;
|
||||
JSXString = /(['"])(?:(?!\1)[^])*(\1)?/y;
|
||||
JSXText = /[^<>{}]+/y;
|
||||
TokensPrecedingExpression = /^(?:[\/+-]|\.{3}|\?(?:InterpolationIn(?:JSX|Template)|NoLineTerminatorHere|NonExpressionParenEnd|UnaryIncDec))?$|[{}([,;<>=*%&|^!~?:]$/;
|
||||
TokensNotPrecedingObjectLiteral = /^(?:=>|[;\]){}]|else|\?(?:NoLineTerminatorHere|NonExpressionParenEnd))?$/;
|
||||
KeywordsWithExpressionAfter = /^(?:await|case|default|delete|do|else|instanceof|new|return|throw|typeof|void|yield)$/;
|
||||
KeywordsWithNoLineTerminatorAfter = /^(?:return|throw|yield)$/;
|
||||
Newline = RegExp(LineTerminatorSequence.source);
|
||||
var jsTokens_1 = function*(input, {jsx = false} = {}) {
|
||||
var braces, firstCodePoint, isExpression, lastIndex, lastSignificantToken, length, match, mode, nextLastIndex, nextLastSignificantToken, parenNesting, postfixIncDec, punctuator, stack;
|
||||
({length} = input);
|
||||
lastIndex = 0;
|
||||
lastSignificantToken = "";
|
||||
stack = [
|
||||
{tag: "JS"}
|
||||
];
|
||||
braces = [];
|
||||
parenNesting = 0;
|
||||
postfixIncDec = false;
|
||||
while (lastIndex < length) {
|
||||
mode = stack[stack.length - 1];
|
||||
switch (mode.tag) {
|
||||
case "JS":
|
||||
case "JSNonExpressionParen":
|
||||
case "InterpolationInTemplate":
|
||||
case "InterpolationInJSX":
|
||||
if (input[lastIndex] === "/" && (TokensPrecedingExpression.test(lastSignificantToken) || KeywordsWithExpressionAfter.test(lastSignificantToken))) {
|
||||
RegularExpressionLiteral.lastIndex = lastIndex;
|
||||
if (match = RegularExpressionLiteral.exec(input)) {
|
||||
lastIndex = RegularExpressionLiteral.lastIndex;
|
||||
lastSignificantToken = match[0];
|
||||
postfixIncDec = true;
|
||||
yield ({
|
||||
type: "RegularExpressionLiteral",
|
||||
value: match[0],
|
||||
closed: match[1] !== void 0 && match[1] !== "\\"
|
||||
});
|
||||
continue;
|
||||
}
|
||||
}
|
||||
Punctuator.lastIndex = lastIndex;
|
||||
if (match = Punctuator.exec(input)) {
|
||||
punctuator = match[0];
|
||||
nextLastIndex = Punctuator.lastIndex;
|
||||
nextLastSignificantToken = punctuator;
|
||||
switch (punctuator) {
|
||||
case "(":
|
||||
if (lastSignificantToken === "?NonExpressionParenKeyword") {
|
||||
stack.push({
|
||||
tag: "JSNonExpressionParen",
|
||||
nesting: parenNesting
|
||||
});
|
||||
}
|
||||
parenNesting++;
|
||||
postfixIncDec = false;
|
||||
break;
|
||||
case ")":
|
||||
parenNesting--;
|
||||
postfixIncDec = true;
|
||||
if (mode.tag === "JSNonExpressionParen" && parenNesting === mode.nesting) {
|
||||
stack.pop();
|
||||
nextLastSignificantToken = "?NonExpressionParenEnd";
|
||||
postfixIncDec = false;
|
||||
}
|
||||
break;
|
||||
case "{":
|
||||
Punctuator.lastIndex = 0;
|
||||
isExpression = !TokensNotPrecedingObjectLiteral.test(lastSignificantToken) && (TokensPrecedingExpression.test(lastSignificantToken) || KeywordsWithExpressionAfter.test(lastSignificantToken));
|
||||
braces.push(isExpression);
|
||||
postfixIncDec = false;
|
||||
break;
|
||||
case "}":
|
||||
switch (mode.tag) {
|
||||
case "InterpolationInTemplate":
|
||||
if (braces.length === mode.nesting) {
|
||||
Template.lastIndex = lastIndex;
|
||||
match = Template.exec(input);
|
||||
lastIndex = Template.lastIndex;
|
||||
lastSignificantToken = match[0];
|
||||
if (match[1] === "${") {
|
||||
lastSignificantToken = "?InterpolationInTemplate";
|
||||
postfixIncDec = false;
|
||||
yield ({
|
||||
type: "TemplateMiddle",
|
||||
value: match[0]
|
||||
});
|
||||
} else {
|
||||
stack.pop();
|
||||
postfixIncDec = true;
|
||||
yield ({
|
||||
type: "TemplateTail",
|
||||
value: match[0],
|
||||
closed: match[1] === "`"
|
||||
});
|
||||
}
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
case "InterpolationInJSX":
|
||||
if (braces.length === mode.nesting) {
|
||||
stack.pop();
|
||||
lastIndex += 1;
|
||||
lastSignificantToken = "}";
|
||||
yield ({
|
||||
type: "JSXPunctuator",
|
||||
value: "}"
|
||||
});
|
||||
continue;
|
||||
}
|
||||
}
|
||||
postfixIncDec = braces.pop();
|
||||
nextLastSignificantToken = postfixIncDec ? "?ExpressionBraceEnd" : "}";
|
||||
break;
|
||||
case "]":
|
||||
postfixIncDec = true;
|
||||
break;
|
||||
case "++":
|
||||
case "--":
|
||||
nextLastSignificantToken = postfixIncDec ? "?PostfixIncDec" : "?UnaryIncDec";
|
||||
break;
|
||||
case "<":
|
||||
if (jsx && (TokensPrecedingExpression.test(lastSignificantToken) || KeywordsWithExpressionAfter.test(lastSignificantToken))) {
|
||||
stack.push({tag: "JSXTag"});
|
||||
lastIndex += 1;
|
||||
lastSignificantToken = "<";
|
||||
yield ({
|
||||
type: "JSXPunctuator",
|
||||
value: punctuator
|
||||
});
|
||||
continue;
|
||||
}
|
||||
postfixIncDec = false;
|
||||
break;
|
||||
default:
|
||||
postfixIncDec = false;
|
||||
}
|
||||
lastIndex = nextLastIndex;
|
||||
lastSignificantToken = nextLastSignificantToken;
|
||||
yield ({
|
||||
type: "Punctuator",
|
||||
value: punctuator
|
||||
});
|
||||
continue;
|
||||
}
|
||||
Identifier.lastIndex = lastIndex;
|
||||
if (match = Identifier.exec(input)) {
|
||||
lastIndex = Identifier.lastIndex;
|
||||
nextLastSignificantToken = match[0];
|
||||
switch (match[0]) {
|
||||
case "for":
|
||||
case "if":
|
||||
case "while":
|
||||
case "with":
|
||||
if (lastSignificantToken !== "." && lastSignificantToken !== "?.") {
|
||||
nextLastSignificantToken = "?NonExpressionParenKeyword";
|
||||
}
|
||||
}
|
||||
lastSignificantToken = nextLastSignificantToken;
|
||||
postfixIncDec = !KeywordsWithExpressionAfter.test(match[0]);
|
||||
yield ({
|
||||
type: match[1] === "#" ? "PrivateIdentifier" : "IdentifierName",
|
||||
value: match[0]
|
||||
});
|
||||
continue;
|
||||
}
|
||||
StringLiteral.lastIndex = lastIndex;
|
||||
if (match = StringLiteral.exec(input)) {
|
||||
lastIndex = StringLiteral.lastIndex;
|
||||
lastSignificantToken = match[0];
|
||||
postfixIncDec = true;
|
||||
yield ({
|
||||
type: "StringLiteral",
|
||||
value: match[0],
|
||||
closed: match[2] !== void 0
|
||||
});
|
||||
continue;
|
||||
}
|
||||
NumericLiteral.lastIndex = lastIndex;
|
||||
if (match = NumericLiteral.exec(input)) {
|
||||
lastIndex = NumericLiteral.lastIndex;
|
||||
lastSignificantToken = match[0];
|
||||
postfixIncDec = true;
|
||||
yield ({
|
||||
type: "NumericLiteral",
|
||||
value: match[0]
|
||||
});
|
||||
continue;
|
||||
}
|
||||
Template.lastIndex = lastIndex;
|
||||
if (match = Template.exec(input)) {
|
||||
lastIndex = Template.lastIndex;
|
||||
lastSignificantToken = match[0];
|
||||
if (match[1] === "${") {
|
||||
lastSignificantToken = "?InterpolationInTemplate";
|
||||
stack.push({
|
||||
tag: "InterpolationInTemplate",
|
||||
nesting: braces.length
|
||||
});
|
||||
postfixIncDec = false;
|
||||
yield ({
|
||||
type: "TemplateHead",
|
||||
value: match[0]
|
||||
});
|
||||
} else {
|
||||
postfixIncDec = true;
|
||||
yield ({
|
||||
type: "NoSubstitutionTemplate",
|
||||
value: match[0],
|
||||
closed: match[1] === "`"
|
||||
});
|
||||
}
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
case "JSXTag":
|
||||
case "JSXTagEnd":
|
||||
JSXPunctuator.lastIndex = lastIndex;
|
||||
if (match = JSXPunctuator.exec(input)) {
|
||||
lastIndex = JSXPunctuator.lastIndex;
|
||||
nextLastSignificantToken = match[0];
|
||||
switch (match[0]) {
|
||||
case "<":
|
||||
stack.push({tag: "JSXTag"});
|
||||
break;
|
||||
case ">":
|
||||
stack.pop();
|
||||
if (lastSignificantToken === "/" || mode.tag === "JSXTagEnd") {
|
||||
nextLastSignificantToken = "?JSX";
|
||||
postfixIncDec = true;
|
||||
} else {
|
||||
stack.push({tag: "JSXChildren"});
|
||||
}
|
||||
break;
|
||||
case "{":
|
||||
stack.push({
|
||||
tag: "InterpolationInJSX",
|
||||
nesting: braces.length
|
||||
});
|
||||
nextLastSignificantToken = "?InterpolationInJSX";
|
||||
postfixIncDec = false;
|
||||
break;
|
||||
case "/":
|
||||
if (lastSignificantToken === "<") {
|
||||
stack.pop();
|
||||
if (stack[stack.length - 1].tag === "JSXChildren") {
|
||||
stack.pop();
|
||||
}
|
||||
stack.push({tag: "JSXTagEnd"});
|
||||
}
|
||||
}
|
||||
lastSignificantToken = nextLastSignificantToken;
|
||||
yield ({
|
||||
type: "JSXPunctuator",
|
||||
value: match[0]
|
||||
});
|
||||
continue;
|
||||
}
|
||||
JSXIdentifier.lastIndex = lastIndex;
|
||||
if (match = JSXIdentifier.exec(input)) {
|
||||
lastIndex = JSXIdentifier.lastIndex;
|
||||
lastSignificantToken = match[0];
|
||||
yield ({
|
||||
type: "JSXIdentifier",
|
||||
value: match[0]
|
||||
});
|
||||
continue;
|
||||
}
|
||||
JSXString.lastIndex = lastIndex;
|
||||
if (match = JSXString.exec(input)) {
|
||||
lastIndex = JSXString.lastIndex;
|
||||
lastSignificantToken = match[0];
|
||||
yield ({
|
||||
type: "JSXString",
|
||||
value: match[0],
|
||||
closed: match[2] !== void 0
|
||||
});
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
case "JSXChildren":
|
||||
JSXText.lastIndex = lastIndex;
|
||||
if (match = JSXText.exec(input)) {
|
||||
lastIndex = JSXText.lastIndex;
|
||||
lastSignificantToken = match[0];
|
||||
yield ({
|
||||
type: "JSXText",
|
||||
value: match[0]
|
||||
});
|
||||
continue;
|
||||
}
|
||||
switch (input[lastIndex]) {
|
||||
case "<":
|
||||
stack.push({tag: "JSXTag"});
|
||||
lastIndex++;
|
||||
lastSignificantToken = "<";
|
||||
yield ({
|
||||
type: "JSXPunctuator",
|
||||
value: "<"
|
||||
});
|
||||
continue;
|
||||
case "{":
|
||||
stack.push({
|
||||
tag: "InterpolationInJSX",
|
||||
nesting: braces.length
|
||||
});
|
||||
lastIndex++;
|
||||
lastSignificantToken = "?InterpolationInJSX";
|
||||
postfixIncDec = false;
|
||||
yield ({
|
||||
type: "JSXPunctuator",
|
||||
value: "{"
|
||||
});
|
||||
continue;
|
||||
}
|
||||
}
|
||||
WhiteSpace.lastIndex = lastIndex;
|
||||
if (match = WhiteSpace.exec(input)) {
|
||||
lastIndex = WhiteSpace.lastIndex;
|
||||
yield ({
|
||||
type: "WhiteSpace",
|
||||
value: match[0]
|
||||
});
|
||||
continue;
|
||||
}
|
||||
LineTerminatorSequence.lastIndex = lastIndex;
|
||||
if (match = LineTerminatorSequence.exec(input)) {
|
||||
lastIndex = LineTerminatorSequence.lastIndex;
|
||||
postfixIncDec = false;
|
||||
if (KeywordsWithNoLineTerminatorAfter.test(lastSignificantToken)) {
|
||||
lastSignificantToken = "?NoLineTerminatorHere";
|
||||
}
|
||||
yield ({
|
||||
type: "LineTerminatorSequence",
|
||||
value: match[0]
|
||||
});
|
||||
continue;
|
||||
}
|
||||
MultiLineComment.lastIndex = lastIndex;
|
||||
if (match = MultiLineComment.exec(input)) {
|
||||
lastIndex = MultiLineComment.lastIndex;
|
||||
if (Newline.test(match[0])) {
|
||||
postfixIncDec = false;
|
||||
if (KeywordsWithNoLineTerminatorAfter.test(lastSignificantToken)) {
|
||||
lastSignificantToken = "?NoLineTerminatorHere";
|
||||
}
|
||||
}
|
||||
yield ({
|
||||
type: "MultiLineComment",
|
||||
value: match[0],
|
||||
closed: match[1] !== void 0
|
||||
});
|
||||
continue;
|
||||
}
|
||||
SingleLineComment.lastIndex = lastIndex;
|
||||
if (match = SingleLineComment.exec(input)) {
|
||||
lastIndex = SingleLineComment.lastIndex;
|
||||
postfixIncDec = false;
|
||||
yield ({
|
||||
type: "SingleLineComment",
|
||||
value: match[0]
|
||||
});
|
||||
continue;
|
||||
}
|
||||
firstCodePoint = String.fromCodePoint(input.codePointAt(lastIndex));
|
||||
lastIndex += firstCodePoint.length;
|
||||
lastSignificantToken = firstCodePoint;
|
||||
postfixIncDec = false;
|
||||
yield ({
|
||||
type: mode.tag.startsWith("JSX") ? "JSXInvalid" : "Invalid",
|
||||
value: firstCodePoint
|
||||
});
|
||||
}
|
||||
return void 0;
|
||||
};
|
||||
|
||||
var jsTokens = /*@__PURE__*/getDefaultExportFromCjs(jsTokens_1);
|
||||
|
||||
function stripLiteralJsTokens(code, options) {
|
||||
const FILL = options?.fillChar ?? " ";
|
||||
const FILL_COMMENT = " ";
|
||||
let result = "";
|
||||
const filter = options?.filter ?? (() => true);
|
||||
function fillupTo(index) {
|
||||
if (index > result.length)
|
||||
result += code.slice(result.length, index).replace(/[^\n]/g, FILL_COMMENT);
|
||||
}
|
||||
const tokens = [];
|
||||
const pasers = tokenizer(code, {
|
||||
ecmaVersion: "latest",
|
||||
sourceType: "module",
|
||||
allowHashBang: true,
|
||||
allowAwaitOutsideFunction: true,
|
||||
allowImportExportEverywhere: true
|
||||
});
|
||||
const iter = pasers[Symbol.iterator]();
|
||||
let error;
|
||||
try {
|
||||
while (true) {
|
||||
const { done, value: token } = iter.next();
|
||||
if (done)
|
||||
break;
|
||||
tokens.push(token);
|
||||
fillupTo(token.start);
|
||||
if (token.type.label === "string") {
|
||||
const body = code.slice(token.start + 1, token.end - 1);
|
||||
if (filter(body)) {
|
||||
result += code[token.start] + FILL.repeat(token.end - token.start - 2) + code[token.end - 1];
|
||||
continue;
|
||||
}
|
||||
} else if (token.type.label === "template") {
|
||||
const body = code.slice(token.start, token.end);
|
||||
if (filter(body)) {
|
||||
result += FILL.repeat(token.end - token.start);
|
||||
continue;
|
||||
}
|
||||
} else if (token.type.label === "regexp") {
|
||||
const body = code.slice(token.start, token.end);
|
||||
if (filter(body)) {
|
||||
result += body.replace(/\/(.*)\/(\w?)$/g, (_, $1, $2) => `/${FILL.repeat($1.length)}/${$2}`);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
result += code.slice(token.start, token.end);
|
||||
for (const token of jsTokens(code, { jsx: false })) {
|
||||
tokens.push(token);
|
||||
if (token.type === "SingleLineComment") {
|
||||
result += FILL_COMMENT.repeat(token.value.length);
|
||||
continue;
|
||||
}
|
||||
fillupTo(code.length);
|
||||
} catch (e) {
|
||||
error = e;
|
||||
if (token.type === "MultiLineComment") {
|
||||
result += token.value.replace(/[^\n]/g, FILL_COMMENT);
|
||||
continue;
|
||||
}
|
||||
if (token.type === "StringLiteral") {
|
||||
const body = token.value.slice(1, -1);
|
||||
if (filter(body)) {
|
||||
result += token.value[0] + FILL.repeat(body.length) + token.value[token.value.length - 1];
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (token.type === "NoSubstitutionTemplate") {
|
||||
const body = token.value.slice(1, -1);
|
||||
if (filter(body)) {
|
||||
result += `\`${body.replace(/[^\n]/g, FILL)}\``;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (token.type === "RegularExpressionLiteral") {
|
||||
const body = token.value;
|
||||
if (filter(body)) {
|
||||
result += body.replace(/\/(.*)\/(\w?)$/g, (_, $1, $2) => `/${FILL.repeat($1.length)}/${$2}`);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (token.type === "TemplateHead") {
|
||||
const body = token.value.slice(1, -2);
|
||||
if (filter(body)) {
|
||||
result += `\`${body.replace(/[^\n]/g, FILL)}\${`;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (token.type === "TemplateTail") {
|
||||
const body = token.value.slice(0, -2);
|
||||
if (filter(body)) {
|
||||
result += `}${body.replace(/[^\n]/g, FILL)}\``;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (token.type === "TemplateMiddle") {
|
||||
const body = token.value.slice(1, -2);
|
||||
if (filter(body)) {
|
||||
result += `}${body.replace(/[^\n]/g, FILL)}\${`;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
result += token.value;
|
||||
}
|
||||
return {
|
||||
error,
|
||||
result,
|
||||
tokens
|
||||
};
|
||||
}
|
||||
|
||||
const multilineCommentsRE = /\/\*([^*\/])*?\*\//gms;
|
||||
const singlelineCommentsRE = /(?:^|\n|\r)\s*\/\/.*(?:\r|\n|$)/gm;
|
||||
const templateLiteralRE$1 = /\$\{(\s*(?:|{.*}|(?!\$\{).|\n|\r)*?\s*)\}/g;
|
||||
const quotesRE = [
|
||||
/(["'`])((?:\\\1|(?!\1)|.|\r)*?)\1/gm,
|
||||
/([`])((?:\\\1|(?!\1)|.|\n|\r)*?)\1/gm
|
||||
// multi-line strings (i.e. template literals only)
|
||||
];
|
||||
function stripLiteralRegex(code, options) {
|
||||
const FILL_COMMENT = " ";
|
||||
const FILL = options?.fillChar ?? " ";
|
||||
const filter = options?.filter ?? (() => true);
|
||||
code = code.replace(multilineCommentsRE, (s) => filter(s) ? FILL_COMMENT.repeat(s.length) : s).replace(singlelineCommentsRE, (s) => filter(s) ? FILL_COMMENT.repeat(s.length) : s);
|
||||
let expanded = code;
|
||||
for (let i = 0; i < 16; i++) {
|
||||
const before = expanded;
|
||||
expanded = expanded.replace(templateLiteralRE$1, "` $1`");
|
||||
if (expanded === before)
|
||||
break;
|
||||
}
|
||||
quotesRE.forEach((re) => {
|
||||
expanded = expanded.replace(re, (s, quote, body, index) => {
|
||||
if (!filter(s.slice(1, -1)))
|
||||
return s;
|
||||
code = code.slice(0, index + 1) + FILL.repeat(s.length - 2) + code.slice(index + s.length - 1);
|
||||
return quote + FILL.repeat(s.length - 2) + quote;
|
||||
});
|
||||
});
|
||||
return code;
|
||||
}
|
||||
|
||||
function stripLiteral(code, options) {
|
||||
return stripLiteralDetailed(code, options).result;
|
||||
}
|
||||
function stripLiteralDetailed(code, options) {
|
||||
const acorn = _stripLiteralAcorn(code, options);
|
||||
if (!acorn.error) {
|
||||
return {
|
||||
mode: "acorn",
|
||||
result: acorn.result,
|
||||
acorn
|
||||
};
|
||||
}
|
||||
return {
|
||||
mode: "regex",
|
||||
result: stripLiteralRegex(acorn.result + code.slice(acorn.result.length), options),
|
||||
acorn
|
||||
};
|
||||
return stripLiteralJsTokens(code, options);
|
||||
}
|
||||
|
||||
var main$1 = {exports: {}};
|
||||
@@ -38529,13 +38878,12 @@ function buildHtmlPlugin(config) {
|
||||
// Determines true start position for the node, either the < character
|
||||
// position, or the newline at the end of the previous line's node.
|
||||
const nodeStartWithLeadingWhitespace = (node) => {
|
||||
if (node.sourceCodeLocation.startOffset === 0)
|
||||
return node.sourceCodeLocation.startOffset;
|
||||
const startOffset = node.sourceCodeLocation.startOffset;
|
||||
if (startOffset === 0)
|
||||
return 0;
|
||||
// Gets the offset for the start of the line including the
|
||||
// newline trailing the previous node
|
||||
const lineStartOffset = node.sourceCodeLocation.startOffset -
|
||||
node.sourceCodeLocation.startCol;
|
||||
const line = s.slice(Math.max(0, lineStartOffset), node.sourceCodeLocation.startOffset);
|
||||
const lineStartOffset = startOffset - node.sourceCodeLocation.startCol;
|
||||
// <previous-line-node></previous-line-node>
|
||||
// <target-node></target-node>
|
||||
//
|
||||
@@ -38547,9 +38895,16 @@ function buildHtmlPlugin(config) {
|
||||
//
|
||||
// However, if there is content between our target node start and the
|
||||
// previous newline, we cannot strip it out without risking content deletion.
|
||||
return line.trim()
|
||||
? node.sourceCodeLocation.startOffset
|
||||
: lineStartOffset;
|
||||
let isLineEmpty = false;
|
||||
try {
|
||||
const line = s.slice(Math.max(0, lineStartOffset), startOffset);
|
||||
isLineEmpty = !line.trim();
|
||||
}
|
||||
catch {
|
||||
// magic-string may throw if there's some content removed in the sliced string,
|
||||
// which we ignore and assume the line is not empty
|
||||
}
|
||||
return isLineEmpty ? lineStartOffset : startOffset;
|
||||
};
|
||||
// pre-transform
|
||||
html = await applyHtmlTransforms(html, preHooks, {
|
||||
@@ -40078,8 +40433,8 @@ function createCachedImport(imp) {
|
||||
return cached;
|
||||
};
|
||||
}
|
||||
const importPostcssImport = createCachedImport(() => import('./dep-TyoTMUQy.js').then(function (n) { return n.i; }));
|
||||
const importPostcssModules = createCachedImport(() => import('./dep-mc9zj7Ue.js').then(function (n) { return n.i; }));
|
||||
const importPostcssImport = createCachedImport(() => import('./dep-FrUgnvs5.js').then(function (n) { return n.i; }));
|
||||
const importPostcssModules = createCachedImport(() => import('./dep---u6OAyB.js').then(function (n) { return n.i; }));
|
||||
const importPostcss = createCachedImport(() => import('postcss'));
|
||||
/**
|
||||
* @experimental
|
||||
@@ -59111,7 +59466,7 @@ function isBareRelative(url) {
|
||||
return wordCharRE.test(url[0]) && !url.includes(':');
|
||||
}
|
||||
const isSrcSet = (attr) => attr.name === 'srcset' && attr.prefix === undefined;
|
||||
const processNodeUrl = (url, useSrcSetReplacer, config, htmlPath, originalUrl, server) => {
|
||||
const processNodeUrl = (url, useSrcSetReplacer, config, htmlPath, originalUrl, server, isClassicScriptLink) => {
|
||||
// prefix with base (dev only, base is never relative)
|
||||
const replacer = (url) => {
|
||||
if (server?.moduleGraph) {
|
||||
@@ -59135,7 +59490,7 @@ const processNodeUrl = (url, useSrcSetReplacer, config, htmlPath, originalUrl, s
|
||||
htmlPath === '/index.html')) {
|
||||
url = path$o.posix.join(config.base, url);
|
||||
}
|
||||
if (server && shouldPreTransform(url, config)) {
|
||||
if (server && !isClassicScriptLink && shouldPreTransform(url, config)) {
|
||||
let preTransformUrl;
|
||||
if (url[0] === '/' && url[1] !== '/') {
|
||||
preTransformUrl = url;
|
||||
@@ -59213,7 +59568,7 @@ const devHtmlHook = async (html, { path: htmlPath, filename, server, originalUrl
|
||||
if (node.nodeName === 'script') {
|
||||
const { src, sourceCodeLocation, isModule } = getScriptInfo(node);
|
||||
if (src) {
|
||||
const processedUrl = processNodeUrl(src.value, isSrcSet(src), config, htmlPath, originalUrl, server);
|
||||
const processedUrl = processNodeUrl(src.value, isSrcSet(src), config, htmlPath, originalUrl, server, !isModule);
|
||||
if (processedUrl !== src.value) {
|
||||
overwriteAttrValue(s, sourceCodeLocation, processedUrl);
|
||||
}
|
||||
@@ -60152,7 +60507,10 @@ async function _createServer(inlineConfig = {}, options) {
|
||||
_importGlobMap: new Map(),
|
||||
_forceOptimizeOnRestart: false,
|
||||
_pendingRequests: new Map(),
|
||||
_fsDenyGlob: picomatch$4(config.server.fs.deny, { matchBase: true }),
|
||||
_fsDenyGlob: picomatch$4(config.server.fs.deny, {
|
||||
matchBase: true,
|
||||
nocase: true,
|
||||
}),
|
||||
_shortcutsOptions: undefined,
|
||||
};
|
||||
if (!middlewareMode) {
|
||||
@@ -64244,8 +64602,8 @@ function esbuildScanPlugin(config, container, depImports, missing, entries) {
|
||||
function extractImportPaths(code) {
|
||||
// empty singleline & multiline comments to avoid matching comments
|
||||
code = code
|
||||
.replace(multilineCommentsRE$1, '/* */')
|
||||
.replace(singlelineCommentsRE$1, '');
|
||||
.replace(multilineCommentsRE, '/* */')
|
||||
.replace(singlelineCommentsRE, '');
|
||||
let js = '';
|
||||
let m;
|
||||
importsRE.lastIndex = 0;
|
||||
@@ -66337,13 +66695,21 @@ function buildImportAnalysisPlugin(config) {
|
||||
const fileDepsCode = `[${fileDeps
|
||||
.map((fileDep) => fileDep.runtime ? fileDep.url : JSON.stringify(fileDep.url))
|
||||
.join(',')}]`;
|
||||
s.append(`\
|
||||
const mapDepsCode = `\
|
||||
function __vite__mapDeps(indexes) {
|
||||
if (!__vite__mapDeps.viteFileDeps) {
|
||||
__vite__mapDeps.viteFileDeps = ${fileDepsCode}
|
||||
}
|
||||
return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
|
||||
}`);
|
||||
}\n`;
|
||||
// inject extra code before sourcemap comment
|
||||
const mapFileCommentMatch = convertSourceMap.mapFileCommentRegex.exec(code);
|
||||
if (mapFileCommentMatch) {
|
||||
s.appendRight(mapFileCommentMatch.index, mapDepsCode);
|
||||
}
|
||||
else {
|
||||
s.append(mapDepsCode);
|
||||
}
|
||||
// there may still be markers due to inlined dynamic imports, remove
|
||||
// all the markers regardless
|
||||
let markerStartPos = indexOfMatchInSlice(code, preloadMarkerWithQuote);
|
||||
@@ -67679,9 +68045,9 @@ async function resolveConfig(inlineConfig, command, defaultMode = 'development',
|
||||
};
|
||||
const resolvedWorkerPlugins = await resolvePlugins(workerResolved, workerPrePlugins, workerNormalPlugins, workerPostPlugins);
|
||||
// run configResolved hooks
|
||||
createPluginHookUtils(resolvedWorkerPlugins)
|
||||
await Promise.all(createPluginHookUtils(resolvedWorkerPlugins)
|
||||
.getSortedPluginHooks('configResolved')
|
||||
.map((hook) => hook(workerResolved));
|
||||
.map((hook) => hook(workerResolved)));
|
||||
return resolvedWorkerPlugins;
|
||||
};
|
||||
const resolvedWorkerOptions = {
|
||||
@@ -1,4 +1,4 @@
|
||||
import { y as getDefaultExportFromCjs } from './dep-R0I0XnyH.js';
|
||||
import { y as getDefaultExportFromCjs } from './dep-9A4-l-43.js';
|
||||
import require$$0 from 'path';
|
||||
import require$$0__default from 'fs';
|
||||
import { l as lib } from './dep-8a-6Quh6.js';
|
||||
10
node_modules/vite/dist/node/cli.js
generated
vendored
10
node_modules/vite/dist/node/cli.js
generated
vendored
@@ -2,7 +2,7 @@ import path from 'node:path';
|
||||
import fs from 'node:fs';
|
||||
import { performance } from 'node:perf_hooks';
|
||||
import { EventEmitter } from 'events';
|
||||
import { x as colors, k as createLogger, r as resolveConfig } from './chunks/dep-R0I0XnyH.js';
|
||||
import { x as colors, k as createLogger, r as resolveConfig } from './chunks/dep-9A4-l-43.js';
|
||||
import { VERSION } from './constants.js';
|
||||
import 'node:fs/promises';
|
||||
import 'node:url';
|
||||
@@ -759,7 +759,7 @@ cli
|
||||
filterDuplicateOptions(options);
|
||||
// output structure is preserved even after bundling so require()
|
||||
// is ok here
|
||||
const { createServer } = await import('./chunks/dep-R0I0XnyH.js').then(function (n) { return n.A; });
|
||||
const { createServer } = await import('./chunks/dep-9A4-l-43.js').then(function (n) { return n.A; });
|
||||
try {
|
||||
const server = await createServer({
|
||||
root,
|
||||
@@ -839,7 +839,7 @@ cli
|
||||
.option('-w, --watch', `[boolean] rebuilds when modules have changed on disk`)
|
||||
.action(async (root, options) => {
|
||||
filterDuplicateOptions(options);
|
||||
const { build } = await import('./chunks/dep-R0I0XnyH.js').then(function (n) { return n.C; });
|
||||
const { build } = await import('./chunks/dep-9A4-l-43.js').then(function (n) { return n.C; });
|
||||
const buildOptions = cleanOptions(options);
|
||||
try {
|
||||
await build({
|
||||
@@ -867,7 +867,7 @@ cli
|
||||
.option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
|
||||
.action(async (root, options) => {
|
||||
filterDuplicateOptions(options);
|
||||
const { optimizeDeps } = await import('./chunks/dep-R0I0XnyH.js').then(function (n) { return n.B; });
|
||||
const { optimizeDeps } = await import('./chunks/dep-9A4-l-43.js').then(function (n) { return n.B; });
|
||||
try {
|
||||
const config = await resolveConfig({
|
||||
root,
|
||||
@@ -893,7 +893,7 @@ cli
|
||||
.option('--outDir <dir>', `[string] output directory (default: dist)`)
|
||||
.action(async (root, options) => {
|
||||
filterDuplicateOptions(options);
|
||||
const { preview } = await import('./chunks/dep-R0I0XnyH.js').then(function (n) { return n.D; });
|
||||
const { preview } = await import('./chunks/dep-9A4-l-43.js').then(function (n) { return n.D; });
|
||||
try {
|
||||
const server = await preview({
|
||||
root,
|
||||
|
||||
4
node_modules/vite/dist/node/index.js
generated
vendored
4
node_modules/vite/dist/node/index.js
generated
vendored
@@ -1,6 +1,6 @@
|
||||
export { parseAst, parseAstAsync } from 'rollup/parseAst';
|
||||
import { i as isInNodeModules } from './chunks/dep-R0I0XnyH.js';
|
||||
export { b as build, e as buildErrorMessage, h as createFilter, k as createLogger, c as createServer, d as defineConfig, f as formatPostcssSourceMap, u as isFileServingAllowed, l as loadConfigFromFile, v as loadEnv, g as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, a as preprocessCSS, p as preview, r as resolveConfig, w as resolveEnvPrefix, q as searchForWorkspaceRoot, j as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-R0I0XnyH.js';
|
||||
import { i as isInNodeModules } from './chunks/dep-9A4-l-43.js';
|
||||
export { b as build, e as buildErrorMessage, h as createFilter, k as createLogger, c as createServer, d as defineConfig, f as formatPostcssSourceMap, u as isFileServingAllowed, l as loadConfigFromFile, v as loadEnv, g as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, a as preprocessCSS, p as preview, r as resolveConfig, w as resolveEnvPrefix, q as searchForWorkspaceRoot, j as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-9A4-l-43.js';
|
||||
export { VERSION as version } from './constants.js';
|
||||
export { version as esbuildVersion } from 'esbuild';
|
||||
export { VERSION as rollupVersion } from 'rollup';
|
||||
|
||||
4
node_modules/vite/package.json
generated
vendored
4
node_modules/vite/package.json
generated
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "vite",
|
||||
"version": "5.0.10",
|
||||
"version": "5.0.12",
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
"author": "Evan You",
|
||||
@@ -121,7 +121,7 @@
|
||||
"sirv": "^2.0.3",
|
||||
"source-map-support": "^0.5.21",
|
||||
"strip-ansi": "^7.1.0",
|
||||
"strip-literal": "^1.3.0",
|
||||
"strip-literal": "^2.0.0",
|
||||
"tsconfck": "^3.0.0",
|
||||
"tslib": "^2.6.2",
|
||||
"types": "link:./types",
|
||||
|
||||
Reference in New Issue
Block a user