整理桌面

This commit is contained in:
2022-04-10 00:37:53 +08:00
parent 82e3f2623f
commit e25c8bb318
728 changed files with 986384 additions and 16 deletions

8734
node_modules/vite/dist/node/chunks/dep-66b16601.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

29182
node_modules/vite/dist/node/chunks/dep-7113cb3d.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

531
node_modules/vite/dist/node/chunks/dep-ac1b4bf9.js generated vendored Normal file
View File

@@ -0,0 +1,531 @@
'use strict';
var openParentheses = "(".charCodeAt(0);
var closeParentheses = ")".charCodeAt(0);
var singleQuote = "'".charCodeAt(0);
var doubleQuote = '"'.charCodeAt(0);
var backslash = "\\".charCodeAt(0);
var slash = "/".charCodeAt(0);
var comma = ",".charCodeAt(0);
var colon = ":".charCodeAt(0);
var star = "*".charCodeAt(0);
var uLower = "u".charCodeAt(0);
var uUpper = "U".charCodeAt(0);
var plus$1 = "+".charCodeAt(0);
var isUnicodeRange = /^[a-f0-9?-]+$/i;
var parse$1 = function(input) {
var tokens = [];
var value = input;
var next,
quote,
prev,
token,
escape,
escapePos,
whitespacePos,
parenthesesOpenPos;
var pos = 0;
var code = value.charCodeAt(pos);
var max = value.length;
var stack = [{ nodes: tokens }];
var balanced = 0;
var parent;
var name = "";
var before = "";
var after = "";
while (pos < max) {
// Whitespaces
if (code <= 32) {
next = pos;
do {
next += 1;
code = value.charCodeAt(next);
} while (code <= 32);
token = value.slice(pos, next);
prev = tokens[tokens.length - 1];
if (code === closeParentheses && balanced) {
after = token;
} else if (prev && prev.type === "div") {
prev.after = token;
} else if (
code === comma ||
code === colon ||
(code === slash &&
value.charCodeAt(next + 1) !== star &&
(!parent ||
(parent && parent.type === "function" && parent.value !== "calc")))
) {
before = token;
} else {
tokens.push({
type: "space",
sourceIndex: pos,
value: token
});
}
pos = next;
// Quotes
} else if (code === singleQuote || code === doubleQuote) {
next = pos;
quote = code === singleQuote ? "'" : '"';
token = {
type: "string",
sourceIndex: pos,
quote: quote
};
do {
escape = false;
next = value.indexOf(quote, next + 1);
if (~next) {
escapePos = next;
while (value.charCodeAt(escapePos - 1) === backslash) {
escapePos -= 1;
escape = !escape;
}
} else {
value += quote;
next = value.length - 1;
token.unclosed = true;
}
} while (escape);
token.value = value.slice(pos + 1, next);
tokens.push(token);
pos = next + 1;
code = value.charCodeAt(pos);
// Comments
} else if (code === slash && value.charCodeAt(pos + 1) === star) {
token = {
type: "comment",
sourceIndex: pos
};
next = value.indexOf("*/", pos);
if (next === -1) {
token.unclosed = true;
next = value.length;
}
token.value = value.slice(pos + 2, next);
tokens.push(token);
pos = next + 2;
code = value.charCodeAt(pos);
// Operation within calc
} else if (
(code === slash || code === star) &&
parent &&
parent.type === "function" &&
parent.value === "calc"
) {
token = value[pos];
tokens.push({
type: "word",
sourceIndex: pos - before.length,
value: token
});
pos += 1;
code = value.charCodeAt(pos);
// Dividers
} else if (code === slash || code === comma || code === colon) {
token = value[pos];
tokens.push({
type: "div",
sourceIndex: pos - before.length,
value: token,
before: before,
after: ""
});
before = "";
pos += 1;
code = value.charCodeAt(pos);
// Open parentheses
} else if (openParentheses === code) {
// Whitespaces after open parentheses
next = pos;
do {
next += 1;
code = value.charCodeAt(next);
} while (code <= 32);
parenthesesOpenPos = pos;
token = {
type: "function",
sourceIndex: pos - name.length,
value: name,
before: value.slice(parenthesesOpenPos + 1, next)
};
pos = next;
if (name === "url" && code !== singleQuote && code !== doubleQuote) {
next -= 1;
do {
escape = false;
next = value.indexOf(")", next + 1);
if (~next) {
escapePos = next;
while (value.charCodeAt(escapePos - 1) === backslash) {
escapePos -= 1;
escape = !escape;
}
} else {
value += ")";
next = value.length - 1;
token.unclosed = true;
}
} while (escape);
// Whitespaces before closed
whitespacePos = next;
do {
whitespacePos -= 1;
code = value.charCodeAt(whitespacePos);
} while (code <= 32);
if (parenthesesOpenPos < whitespacePos) {
if (pos !== whitespacePos + 1) {
token.nodes = [
{
type: "word",
sourceIndex: pos,
value: value.slice(pos, whitespacePos + 1)
}
];
} else {
token.nodes = [];
}
if (token.unclosed && whitespacePos + 1 !== next) {
token.after = "";
token.nodes.push({
type: "space",
sourceIndex: whitespacePos + 1,
value: value.slice(whitespacePos + 1, next)
});
} else {
token.after = value.slice(whitespacePos + 1, next);
}
} else {
token.after = "";
token.nodes = [];
}
pos = next + 1;
code = value.charCodeAt(pos);
tokens.push(token);
} else {
balanced += 1;
token.after = "";
tokens.push(token);
stack.push(token);
tokens = token.nodes = [];
parent = token;
}
name = "";
// Close parentheses
} else if (closeParentheses === code && balanced) {
pos += 1;
code = value.charCodeAt(pos);
parent.after = after;
after = "";
balanced -= 1;
stack.pop();
parent = stack[balanced];
tokens = parent.nodes;
// Words
} else {
next = pos;
do {
if (code === backslash) {
next += 1;
}
next += 1;
code = value.charCodeAt(next);
} while (
next < max &&
!(
code <= 32 ||
code === singleQuote ||
code === doubleQuote ||
code === comma ||
code === colon ||
code === slash ||
code === openParentheses ||
(code === star &&
parent &&
parent.type === "function" &&
parent.value === "calc") ||
(code === slash &&
parent.type === "function" &&
parent.value === "calc") ||
(code === closeParentheses && balanced)
)
);
token = value.slice(pos, next);
if (openParentheses === code) {
name = token;
} else if (
(uLower === token.charCodeAt(0) || uUpper === token.charCodeAt(0)) &&
plus$1 === token.charCodeAt(1) &&
isUnicodeRange.test(token.slice(2))
) {
tokens.push({
type: "unicode-range",
sourceIndex: pos,
value: token
});
} else {
tokens.push({
type: "word",
sourceIndex: pos,
value: token
});
}
pos = next;
}
}
for (pos = stack.length - 1; pos; pos -= 1) {
stack[pos].unclosed = true;
}
return stack[0].nodes;
};
var walk$1 = function walk(nodes, cb, bubble) {
var i, max, node, result;
for (i = 0, max = nodes.length; i < max; i += 1) {
node = nodes[i];
if (!bubble) {
result = cb(node, i, nodes);
}
if (
result !== false &&
node.type === "function" &&
Array.isArray(node.nodes)
) {
walk(node.nodes, cb, bubble);
}
if (bubble) {
cb(node, i, nodes);
}
}
};
function stringifyNode(node, custom) {
var type = node.type;
var value = node.value;
var buf;
var customResult;
if (custom && (customResult = custom(node)) !== undefined) {
return customResult;
} else if (type === "word" || type === "space") {
return value;
} else if (type === "string") {
buf = node.quote || "";
return buf + value + (node.unclosed ? "" : buf);
} else if (type === "comment") {
return "/*" + value + (node.unclosed ? "" : "*/");
} else if (type === "div") {
return (node.before || "") + value + (node.after || "");
} else if (Array.isArray(node.nodes)) {
buf = stringify$1(node.nodes, custom);
if (type !== "function") {
return buf;
}
return (
value +
"(" +
(node.before || "") +
buf +
(node.after || "") +
(node.unclosed ? "" : ")")
);
}
return value;
}
function stringify$1(nodes, custom) {
var result, i;
if (Array.isArray(nodes)) {
result = "";
for (i = nodes.length - 1; ~i; i -= 1) {
result = stringifyNode(nodes[i], custom) + result;
}
return result;
}
return stringifyNode(nodes, custom);
}
var stringify_1 = stringify$1;
var minus = "-".charCodeAt(0);
var plus = "+".charCodeAt(0);
var dot = ".".charCodeAt(0);
var exp = "e".charCodeAt(0);
var EXP = "E".charCodeAt(0);
// Check if three code points would start a number
// https://www.w3.org/TR/css-syntax-3/#starts-with-a-number
function likeNumber(value) {
var code = value.charCodeAt(0);
var nextCode;
if (code === plus || code === minus) {
nextCode = value.charCodeAt(1);
if (nextCode >= 48 && nextCode <= 57) {
return true;
}
var nextNextCode = value.charCodeAt(2);
if (nextCode === dot && nextNextCode >= 48 && nextNextCode <= 57) {
return true;
}
return false;
}
if (code === dot) {
nextCode = value.charCodeAt(1);
if (nextCode >= 48 && nextCode <= 57) {
return true;
}
return false;
}
if (code >= 48 && code <= 57) {
return true;
}
return false;
}
// Consume a number
// https://www.w3.org/TR/css-syntax-3/#consume-number
var unit = function(value) {
var pos = 0;
var length = value.length;
var code;
var nextCode;
var nextNextCode;
if (length === 0 || !likeNumber(value)) {
return false;
}
code = value.charCodeAt(pos);
if (code === plus || code === minus) {
pos++;
}
while (pos < length) {
code = value.charCodeAt(pos);
if (code < 48 || code > 57) {
break;
}
pos += 1;
}
code = value.charCodeAt(pos);
nextCode = value.charCodeAt(pos + 1);
if (code === dot && nextCode >= 48 && nextCode <= 57) {
pos += 2;
while (pos < length) {
code = value.charCodeAt(pos);
if (code < 48 || code > 57) {
break;
}
pos += 1;
}
}
code = value.charCodeAt(pos);
nextCode = value.charCodeAt(pos + 1);
nextNextCode = value.charCodeAt(pos + 2);
if (
(code === exp || code === EXP) &&
((nextCode >= 48 && nextCode <= 57) ||
((nextCode === plus || nextCode === minus) &&
nextNextCode >= 48 &&
nextNextCode <= 57))
) {
pos += nextCode === plus || nextCode === minus ? 3 : 2;
while (pos < length) {
code = value.charCodeAt(pos);
if (code < 48 || code > 57) {
break;
}
pos += 1;
}
}
return {
number: value.slice(0, pos),
unit: value.slice(pos)
};
};
var parse = parse$1;
var walk = walk$1;
var stringify = stringify_1;
function ValueParser(value) {
if (this instanceof ValueParser) {
this.nodes = parse(value);
return this;
}
return new ValueParser(value);
}
ValueParser.prototype.toString = function() {
return Array.isArray(this.nodes) ? stringify(this.nodes) : "";
};
ValueParser.prototype.walk = function(cb, bubble) {
walk(this.nodes, cb, bubble);
return this;
};
ValueParser.unit = unit;
ValueParser.walk = walk;
ValueParser.stringify = stringify;
var lib = ValueParser;
exports.lib = lib;
//# sourceMappingURL=dep-ac1b4bf9.js.map

File diff suppressed because one or more lines are too long

11404
node_modules/vite/dist/node/chunks/dep-c98c5b6d.js generated vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

92092
node_modules/vite/dist/node/chunks/dep-e0fe87f8.js generated vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

746
node_modules/vite/dist/node/chunks/dep-e39b05d6.js generated vendored Normal file
View File

@@ -0,0 +1,746 @@
'use strict';
var path$3 = require('path');
var resolve$2 = require('resolve');
var fs$1 = require('fs');
var index$1 = require('./dep-ac1b4bf9.js');
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e["default"] : e; }
function _mergeNamespaces(n, m) {
for (var i = 0; i < m.length; i++) {
var e = m[i];
for (var k in e) {
if (k !== 'default' && !(k in n)) {
n[k] = e[k];
}
}
}
return n;
}
var path__default = /*#__PURE__*/_interopDefaultLegacy(path$3);
var resolve__default = /*#__PURE__*/_interopDefaultLegacy(resolve$2);
var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs$1);
var joinMedia$1 = function (parentMedia, childMedia) {
if (!parentMedia.length && childMedia.length) return childMedia
if (parentMedia.length && !childMedia.length) return parentMedia
if (!parentMedia.length && !childMedia.length) return []
const media = [];
parentMedia.forEach(parentItem => {
childMedia.forEach(childItem => {
if (parentItem !== childItem) media.push(`${parentItem} and ${childItem}`);
});
});
return media
};
// external tooling
const resolve$1 = resolve__default;
const moduleDirectories = ["web_modules", "node_modules"];
function resolveModule(id, opts) {
return new Promise((res, rej) => {
resolve$1(id, opts, (err, path) => (err ? rej(err) : res(path)));
})
}
var resolveId$1 = function (id, base, options) {
const paths = options.path;
const resolveOpts = {
basedir: base,
moduleDirectory: moduleDirectories.concat(options.addModulesDirectories),
paths,
extensions: [".css"],
packageFilter: function processPackage(pkg) {
if (pkg.style) pkg.main = pkg.style;
else if (!pkg.main || !/\.css$/.test(pkg.main)) pkg.main = "index.css";
return pkg
},
preserveSymlinks: false,
};
return resolveModule(`./${id}`, resolveOpts)
.catch(() => resolveModule(id, resolveOpts))
.catch(() => {
if (paths.indexOf(base) === -1) paths.unshift(base);
throw new Error(
`Failed to find '${id}'
in [
${paths.join(",\n ")}
]`
)
})
};
var readCache$1 = {exports: {}};
var pify$2 = {exports: {}};
var processFn = function (fn, P, opts) {
return function () {
var that = this;
var args = new Array(arguments.length);
for (var i = 0; i < arguments.length; i++) {
args[i] = arguments[i];
}
return new P(function (resolve, reject) {
args.push(function (err, result) {
if (err) {
reject(err);
} else if (opts.multiArgs) {
var results = new Array(arguments.length - 1);
for (var i = 1; i < arguments.length; i++) {
results[i - 1] = arguments[i];
}
resolve(results);
} else {
resolve(result);
}
});
fn.apply(that, args);
});
};
};
var pify$1 = pify$2.exports = function (obj, P, opts) {
if (typeof P !== 'function') {
opts = P;
P = Promise;
}
opts = opts || {};
opts.exclude = opts.exclude || [/.+Sync$/];
var filter = function (key) {
var match = function (pattern) {
return typeof pattern === 'string' ? key === pattern : pattern.test(key);
};
return opts.include ? opts.include.some(match) : !opts.exclude.some(match);
};
var ret = typeof obj === 'function' ? function () {
if (opts.excludeMain) {
return obj.apply(this, arguments);
}
return processFn(obj, P, opts).apply(this, arguments);
} : {};
return Object.keys(obj).reduce(function (ret, key) {
var x = obj[key];
ret[key] = typeof x === 'function' && filter(key) ? processFn(x, P, opts) : x;
return ret;
}, ret);
};
pify$1.all = pify$1;
var fs = fs__default;
var path$2 = path__default;
var pify = pify$2.exports;
var stat = pify(fs.stat);
var readFile = pify(fs.readFile);
var resolve = path$2.resolve;
var cache = Object.create(null);
function convert(content, encoding) {
if (Buffer.isEncoding(encoding)) {
return content.toString(encoding);
}
return content;
}
readCache$1.exports = function (path, encoding) {
path = resolve(path);
return stat(path).then(function (stats) {
var item = cache[path];
if (item && item.mtime.getTime() === stats.mtime.getTime()) {
return convert(item.content, encoding);
}
return readFile(path).then(function (data) {
cache[path] = {
mtime: stats.mtime,
content: data
};
return convert(data, encoding);
});
}).catch(function (err) {
cache[path] = null;
return Promise.reject(err);
});
};
readCache$1.exports.sync = function (path, encoding) {
path = resolve(path);
try {
var stats = fs.statSync(path);
var item = cache[path];
if (item && item.mtime.getTime() === stats.mtime.getTime()) {
return convert(item.content, encoding);
}
var data = fs.readFileSync(path);
cache[path] = {
mtime: stats.mtime,
content: data
};
return convert(data, encoding);
} catch (err) {
cache[path] = null;
throw err;
}
};
readCache$1.exports.get = function (path, encoding) {
path = resolve(path);
if (cache[path]) {
return convert(cache[path].content, encoding);
}
return null;
};
readCache$1.exports.clear = function () {
cache = Object.create(null);
};
const readCache = readCache$1.exports;
var loadContent$1 = filename => readCache(filename, "utf-8");
// builtin tooling
const path$1 = path__default;
// placeholder tooling
let sugarss;
var processContent$1 = function processContent(
result,
content,
filename,
options,
postcss
) {
const { plugins } = options;
const ext = path$1.extname(filename);
const parserList = [];
// SugarSS support:
if (ext === ".sss") {
if (!sugarss) {
try {
sugarss = eval('require')('sugarss');
} catch {} // Ignore
}
if (sugarss)
return runPostcss(postcss, content, filename, plugins, [sugarss])
}
// Syntax support:
if (result.opts.syntax && result.opts.syntax.parse) {
parserList.push(result.opts.syntax.parse);
}
// Parser support:
if (result.opts.parser) parserList.push(result.opts.parser);
// Try the default as a last resort:
parserList.push(null);
return runPostcss(postcss, content, filename, plugins, parserList)
};
function runPostcss(postcss, content, filename, plugins, parsers, index) {
if (!index) index = 0;
return postcss(plugins)
.process(content, {
from: filename,
parser: parsers[index],
})
.catch(err => {
// If there's an error, try the next parser
index++;
// If there are no parsers left, throw it
if (index === parsers.length) throw err
return runPostcss(postcss, content, filename, plugins, parsers, index)
})
}
// external tooling
const valueParser = index$1.lib;
// extended tooling
const { stringify } = valueParser;
function split(params, start) {
const list = [];
const last = params.reduce((item, node, index) => {
if (index < start) return ""
if (node.type === "div" && node.value === ",") {
list.push(item);
return ""
}
return item + stringify(node)
}, "");
list.push(last);
return list
}
var parseStatements$1 = function (result, styles) {
const statements = [];
let nodes = [];
styles.each(node => {
let stmt;
if (node.type === "atrule") {
if (node.name === "import") stmt = parseImport(result, node);
else if (node.name === "media") stmt = parseMedia(result, node);
else if (node.name === "charset") stmt = parseCharset(result, node);
}
if (stmt) {
if (nodes.length) {
statements.push({
type: "nodes",
nodes,
media: [],
});
nodes = [];
}
statements.push(stmt);
} else nodes.push(node);
});
if (nodes.length) {
statements.push({
type: "nodes",
nodes,
media: [],
});
}
return statements
};
function parseMedia(result, atRule) {
const params = valueParser(atRule.params).nodes;
return {
type: "media",
node: atRule,
media: split(params, 0),
}
}
function parseCharset(result, atRule) {
if (atRule.prev()) {
return result.warn("@charset must precede all other statements", {
node: atRule,
})
}
return {
type: "charset",
node: atRule,
media: [],
}
}
function parseImport(result, atRule) {
let prev = atRule.prev();
if (prev) {
do {
if (
prev.type !== "comment" &&
(prev.type !== "atrule" ||
(prev.name !== "import" && prev.name !== "charset"))
) {
return result.warn(
"@import must precede all other statements (besides @charset)",
{ node: atRule }
)
}
prev = prev.prev();
} while (prev)
}
if (atRule.nodes) {
return result.warn(
"It looks like you didn't end your @import statement correctly. " +
"Child nodes are attached to it.",
{ node: atRule }
)
}
const params = valueParser(atRule.params).nodes;
const stmt = {
type: "import",
node: atRule,
media: [],
};
// prettier-ignore
if (
!params.length ||
(
params[0].type !== "string" ||
!params[0].value
) &&
(
params[0].type !== "function" ||
params[0].value !== "url" ||
!params[0].nodes.length ||
!params[0].nodes[0].value
)
) {
return result.warn(`Unable to find uri in '${ atRule.toString() }'`, {
node: atRule,
})
}
if (params[0].type === "string") stmt.uri = params[0].value;
else stmt.uri = params[0].nodes[0].value;
stmt.fullUri = stringify(params[0]);
if (params.length > 2) {
if (params[1].type !== "space") {
return result.warn("Invalid import media statement", { node: atRule })
}
stmt.media = split(params, 2);
}
return stmt
}
// builtin tooling
const path = path__default;
// internal tooling
const joinMedia = joinMedia$1;
const resolveId = resolveId$1;
const loadContent = loadContent$1;
const processContent = processContent$1;
const parseStatements = parseStatements$1;
function AtImport(options) {
options = {
root: process.cwd(),
path: [],
skipDuplicates: true,
resolve: resolveId,
load: loadContent,
plugins: [],
addModulesDirectories: [],
...options,
};
options.root = path.resolve(options.root);
// convert string to an array of a single element
if (typeof options.path === "string") options.path = [options.path];
if (!Array.isArray(options.path)) options.path = [];
options.path = options.path.map(p => path.resolve(options.root, p));
return {
postcssPlugin: "postcss-import",
Once(styles, { result, atRule, postcss }) {
const state = {
importedFiles: {},
hashFiles: {},
};
if (styles.source && styles.source.input && styles.source.input.file) {
state.importedFiles[styles.source.input.file] = {};
}
if (options.plugins && !Array.isArray(options.plugins)) {
throw new Error("plugins option must be an array")
}
return parseStyles(result, styles, options, state, []).then(bundle => {
applyRaws(bundle);
applyMedia(bundle);
applyStyles(bundle, styles);
})
function applyRaws(bundle) {
bundle.forEach((stmt, index) => {
if (index === 0) return
if (stmt.parent) {
const { before } = stmt.parent.node.raws;
if (stmt.type === "nodes") stmt.nodes[0].raws.before = before;
else stmt.node.raws.before = before;
} else if (stmt.type === "nodes") {
stmt.nodes[0].raws.before = stmt.nodes[0].raws.before || "\n";
}
});
}
function applyMedia(bundle) {
bundle.forEach(stmt => {
if (!stmt.media.length || stmt.type === "charset") return
if (stmt.type === "import") {
stmt.node.params = `${stmt.fullUri} ${stmt.media.join(", ")}`;
} else if (stmt.type === "media")
stmt.node.params = stmt.media.join(", ");
else {
const { nodes } = stmt;
const { parent } = nodes[0];
const mediaNode = atRule({
name: "media",
params: stmt.media.join(", "),
source: parent.source,
});
parent.insertBefore(nodes[0], mediaNode);
// remove nodes
nodes.forEach(node => {
node.parent = undefined;
});
// better output
nodes[0].raws.before = nodes[0].raws.before || "\n";
// wrap new rules with media query
mediaNode.append(nodes);
stmt.type = "media";
stmt.node = mediaNode;
delete stmt.nodes;
}
});
}
function applyStyles(bundle, styles) {
styles.nodes = [];
// Strip additional statements.
bundle.forEach(stmt => {
if (["charset", "import", "media"].includes(stmt.type)) {
stmt.node.parent = undefined;
styles.append(stmt.node);
} else if (stmt.type === "nodes") {
stmt.nodes.forEach(node => {
node.parent = undefined;
styles.append(node);
});
}
});
}
function parseStyles(result, styles, options, state, media) {
const statements = parseStatements(result, styles);
return Promise.resolve(statements)
.then(stmts => {
// process each statement in series
return stmts.reduce((promise, stmt) => {
return promise.then(() => {
stmt.media = joinMedia(media, stmt.media || []);
// skip protocol base uri (protocol://url) or protocol-relative
if (
stmt.type !== "import" ||
/^(?:[a-z]+:)?\/\//i.test(stmt.uri)
) {
return
}
if (options.filter && !options.filter(stmt.uri)) {
// rejected by filter
return
}
return resolveImportId(result, stmt, options, state)
})
}, Promise.resolve())
})
.then(() => {
let charset;
const imports = [];
const bundle = [];
function handleCharset(stmt) {
if (!charset) charset = stmt;
// charsets aren't case-sensitive, so convert to lower case to compare
else if (
stmt.node.params.toLowerCase() !==
charset.node.params.toLowerCase()
) {
throw new Error(
`Incompatable @charset statements:
${stmt.node.params} specified in ${stmt.node.source.input.file}
${charset.node.params} specified in ${charset.node.source.input.file}`
)
}
}
// squash statements and their children
statements.forEach(stmt => {
if (stmt.type === "charset") handleCharset(stmt);
else if (stmt.type === "import") {
if (stmt.children) {
stmt.children.forEach((child, index) => {
if (child.type === "import") imports.push(child);
else if (child.type === "charset") handleCharset(child);
else bundle.push(child);
// For better output
if (index === 0) child.parent = stmt;
});
} else imports.push(stmt);
} else if (stmt.type === "media" || stmt.type === "nodes") {
bundle.push(stmt);
}
});
return charset
? [charset, ...imports.concat(bundle)]
: imports.concat(bundle)
})
}
function resolveImportId(result, stmt, options, state) {
const atRule = stmt.node;
let sourceFile;
if (atRule.source && atRule.source.input && atRule.source.input.file) {
sourceFile = atRule.source.input.file;
}
const base = sourceFile
? path.dirname(atRule.source.input.file)
: options.root;
return Promise.resolve(options.resolve(stmt.uri, base, options))
.then(paths => {
if (!Array.isArray(paths)) paths = [paths];
// Ensure that each path is absolute:
return Promise.all(
paths.map(file => {
return !path.isAbsolute(file)
? resolveId(file, base, options)
: file
})
)
})
.then(resolved => {
// Add dependency messages:
resolved.forEach(file => {
result.messages.push({
type: "dependency",
plugin: "postcss-import",
file,
parent: sourceFile,
});
});
return Promise.all(
resolved.map(file => {
return loadImportContent(result, stmt, file, options, state)
})
)
})
.then(result => {
// Merge loaded statements
stmt.children = result.reduce((result, statements) => {
return statements ? result.concat(statements) : result
}, []);
})
}
function loadImportContent(result, stmt, filename, options, state) {
const atRule = stmt.node;
const { media } = stmt;
if (options.skipDuplicates) {
// skip files already imported at the same scope
if (
state.importedFiles[filename] &&
state.importedFiles[filename][media]
) {
return
}
// save imported files to skip them next time
if (!state.importedFiles[filename]) state.importedFiles[filename] = {};
state.importedFiles[filename][media] = true;
}
return Promise.resolve(options.load(filename, options)).then(
content => {
if (content.trim() === "") {
result.warn(`${filename} is empty`, { node: atRule });
return
}
// skip previous imported files not containing @import rules
if (state.hashFiles[content] && state.hashFiles[content][media])
return
return processContent(
result,
content,
filename,
options,
postcss
).then(importedResult => {
const styles = importedResult.root;
result.messages = result.messages.concat(importedResult.messages);
if (options.skipDuplicates) {
const hasImport = styles.some(child => {
return child.type === "atrule" && child.name === "import"
});
if (!hasImport) {
// save hash files to skip them next time
if (!state.hashFiles[content]) state.hashFiles[content] = {};
state.hashFiles[content][media] = true;
}
}
// recursion: import @import from imported file
return parseStyles(result, styles, options, state, media)
})
}
)
}
},
}
}
AtImport.postcss = true;
var postcssImport = AtImport;
var index = /*#__PURE__*/_mergeNamespaces({
__proto__: null,
'default': postcssImport
}, [postcssImport]);
exports.index = index;
//# sourceMappingURL=dep-e39b05d6.js.map

File diff suppressed because one or more lines are too long

804
node_modules/vite/dist/node/cli.js generated vendored Normal file
View File

@@ -0,0 +1,804 @@
'use strict';
var require$$0 = require('events');
var build = require('./chunks/dep-e0fe87f8.js');
var perf_hooks = require('perf_hooks');
require('fs');
require('path');
require('util');
require('stream');
require('os');
require('url');
require('crypto');
require('module');
require('esbuild');
require('worker_threads');
require('assert');
require('child_process');
require('readline');
require('zlib');
require('resolve');
require('querystring');
require('tty');
require('net');
require('http');
require('buffer');
require('https');
require('tls');
function toArr(any) {
return any == null ? [] : Array.isArray(any) ? any : [any];
}
function toVal(out, key, val, opts) {
var x, old=out[key], nxt=(
!!~opts.string.indexOf(key) ? (val == null || val === true ? '' : String(val))
: typeof val === 'boolean' ? val
: !!~opts.boolean.indexOf(key) ? (val === 'false' ? false : val === 'true' || (out._.push((x = +val,x * 0 === 0) ? x : val),!!val))
: (x = +val,x * 0 === 0) ? x : val
);
out[key] = old == null ? nxt : (Array.isArray(old) ? old.concat(nxt) : [old, nxt]);
}
function mri2 (args, opts) {
args = args || [];
opts = opts || {};
var k, arr, arg, name, val, out={ _:[] };
var i=0, j=0, idx=0, len=args.length;
const alibi = opts.alias !== void 0;
const strict = opts.unknown !== void 0;
const defaults = opts.default !== void 0;
opts.alias = opts.alias || {};
opts.string = toArr(opts.string);
opts.boolean = toArr(opts.boolean);
if (alibi) {
for (k in opts.alias) {
arr = opts.alias[k] = toArr(opts.alias[k]);
for (i=0; i < arr.length; i++) {
(opts.alias[arr[i]] = arr.concat(k)).splice(i, 1);
}
}
}
for (i=opts.boolean.length; i-- > 0;) {
arr = opts.alias[opts.boolean[i]] || [];
for (j=arr.length; j-- > 0;) opts.boolean.push(arr[j]);
}
for (i=opts.string.length; i-- > 0;) {
arr = opts.alias[opts.string[i]] || [];
for (j=arr.length; j-- > 0;) opts.string.push(arr[j]);
}
if (defaults) {
for (k in opts.default) {
name = typeof opts.default[k];
arr = opts.alias[k] = opts.alias[k] || [];
if (opts[name] !== void 0) {
opts[name].push(k);
for (i=0; i < arr.length; i++) {
opts[name].push(arr[i]);
}
}
}
}
const keys = strict ? Object.keys(opts.alias) : [];
for (i=0; i < len; i++) {
arg = args[i];
if (arg === '--') {
out._ = out._.concat(args.slice(++i));
break;
}
for (j=0; j < arg.length; j++) {
if (arg.charCodeAt(j) !== 45) break; // "-"
}
if (j === 0) {
out._.push(arg);
} else if (arg.substring(j, j + 3) === 'no-') {
name = arg.substring(j + 3);
if (strict && !~keys.indexOf(name)) {
return opts.unknown(arg);
}
out[name] = false;
} else {
for (idx=j+1; idx < arg.length; idx++) {
if (arg.charCodeAt(idx) === 61) break; // "="
}
name = arg.substring(j, idx);
val = arg.substring(++idx) || (i+1 === len || (''+args[i+1]).charCodeAt(0) === 45 || args[++i]);
arr = (j === 2 ? [name] : name);
for (idx=0; idx < arr.length; idx++) {
name = arr[idx];
if (strict && !~keys.indexOf(name)) return opts.unknown('-'.repeat(j) + name);
toVal(out, name, (idx + 1 < arr.length) || val, opts);
}
}
}
if (defaults) {
for (k in opts.default) {
if (out[k] === void 0) {
out[k] = opts.default[k];
}
}
}
if (alibi) {
for (k in out) {
arr = opts.alias[k] || [];
while (arr.length > 0) {
out[arr.shift()] = out[k];
}
}
}
return out;
}
const removeBrackets = (v) => v.replace(/[<[].+/, "").trim();
const findAllBrackets = (v) => {
const ANGLED_BRACKET_RE_GLOBAL = /<([^>]+)>/g;
const SQUARE_BRACKET_RE_GLOBAL = /\[([^\]]+)\]/g;
const res = [];
const parse = (match) => {
let variadic = false;
let value = match[1];
if (value.startsWith("...")) {
value = value.slice(3);
variadic = true;
}
return {
required: match[0].startsWith("<"),
value,
variadic
};
};
let angledMatch;
while (angledMatch = ANGLED_BRACKET_RE_GLOBAL.exec(v)) {
res.push(parse(angledMatch));
}
let squareMatch;
while (squareMatch = SQUARE_BRACKET_RE_GLOBAL.exec(v)) {
res.push(parse(squareMatch));
}
return res;
};
const getMriOptions = (options) => {
const result = {alias: {}, boolean: []};
for (const [index, option] of options.entries()) {
if (option.names.length > 1) {
result.alias[option.names[0]] = option.names.slice(1);
}
if (option.isBoolean) {
if (option.negated) {
const hasStringTypeOption = options.some((o, i) => {
return i !== index && o.names.some((name) => option.names.includes(name)) && typeof o.required === "boolean";
});
if (!hasStringTypeOption) {
result.boolean.push(option.names[0]);
}
} else {
result.boolean.push(option.names[0]);
}
}
}
return result;
};
const findLongest = (arr) => {
return arr.sort((a, b) => {
return a.length > b.length ? -1 : 1;
})[0];
};
const padRight = (str, length) => {
return str.length >= length ? str : `${str}${" ".repeat(length - str.length)}`;
};
const camelcase = (input) => {
return input.replace(/([a-z])-([a-z])/g, (_, p1, p2) => {
return p1 + p2.toUpperCase();
});
};
const setDotProp = (obj, keys, val) => {
let i = 0;
let length = keys.length;
let t = obj;
let x;
for (; i < length; ++i) {
x = t[keys[i]];
t = t[keys[i]] = i === length - 1 ? val : x != null ? x : !!~keys[i + 1].indexOf(".") || !(+keys[i + 1] > -1) ? {} : [];
}
};
const setByType = (obj, transforms) => {
for (const key of Object.keys(transforms)) {
const transform = transforms[key];
if (transform.shouldTransform) {
obj[key] = Array.prototype.concat.call([], obj[key]);
if (typeof transform.transformFunction === "function") {
obj[key] = obj[key].map(transform.transformFunction);
}
}
}
};
const getFileName = (input) => {
const m = /([^\\\/]+)$/.exec(input);
return m ? m[1] : "";
};
const camelcaseOptionName = (name) => {
return name.split(".").map((v, i) => {
return i === 0 ? camelcase(v) : v;
}).join(".");
};
class CACError extends Error {
constructor(message) {
super(message);
this.name = this.constructor.name;
if (typeof Error.captureStackTrace === "function") {
Error.captureStackTrace(this, this.constructor);
} else {
this.stack = new Error(message).stack;
}
}
}
class Option {
constructor(rawName, description, config) {
this.rawName = rawName;
this.description = description;
this.config = Object.assign({}, config);
rawName = rawName.replace(/\.\*/g, "");
this.negated = false;
this.names = removeBrackets(rawName).split(",").map((v) => {
let name = v.trim().replace(/^-{1,2}/, "");
if (name.startsWith("no-")) {
this.negated = true;
name = name.replace(/^no-/, "");
}
return camelcaseOptionName(name);
}).sort((a, b) => a.length > b.length ? 1 : -1);
this.name = this.names[this.names.length - 1];
if (this.negated && this.config.default == null) {
this.config.default = true;
}
if (rawName.includes("<")) {
this.required = true;
} else if (rawName.includes("[")) {
this.required = false;
} else {
this.isBoolean = true;
}
}
}
const processArgs = process.argv;
const platformInfo = `${process.platform}-${process.arch} node-${process.version}`;
class Command {
constructor(rawName, description, config = {}, cli) {
this.rawName = rawName;
this.description = description;
this.config = config;
this.cli = cli;
this.options = [];
this.aliasNames = [];
this.name = removeBrackets(rawName);
this.args = findAllBrackets(rawName);
this.examples = [];
}
usage(text) {
this.usageText = text;
return this;
}
allowUnknownOptions() {
this.config.allowUnknownOptions = true;
return this;
}
ignoreOptionDefaultValue() {
this.config.ignoreOptionDefaultValue = true;
return this;
}
version(version, customFlags = "-v, --version") {
this.versionNumber = version;
this.option(customFlags, "Display version number");
return this;
}
example(example) {
this.examples.push(example);
return this;
}
option(rawName, description, config) {
const option = new Option(rawName, description, config);
this.options.push(option);
return this;
}
alias(name) {
this.aliasNames.push(name);
return this;
}
action(callback) {
this.commandAction = callback;
return this;
}
isMatched(name) {
return this.name === name || this.aliasNames.includes(name);
}
get isDefaultCommand() {
return this.name === "" || this.aliasNames.includes("!");
}
get isGlobalCommand() {
return this instanceof GlobalCommand;
}
hasOption(name) {
name = name.split(".")[0];
return this.options.find((option) => {
return option.names.includes(name);
});
}
outputHelp() {
const {name, commands} = this.cli;
const {
versionNumber,
options: globalOptions,
helpCallback
} = this.cli.globalCommand;
let sections = [
{
body: `${name}${versionNumber ? `/${versionNumber}` : ""}`
}
];
sections.push({
title: "Usage",
body: ` $ ${name} ${this.usageText || this.rawName}`
});
const showCommands = (this.isGlobalCommand || this.isDefaultCommand) && commands.length > 0;
if (showCommands) {
const longestCommandName = findLongest(commands.map((command) => command.rawName));
sections.push({
title: "Commands",
body: commands.map((command) => {
return ` ${padRight(command.rawName, longestCommandName.length)} ${command.description}`;
}).join("\n")
});
sections.push({
title: `For more info, run any command with the \`--help\` flag`,
body: commands.map((command) => ` $ ${name}${command.name === "" ? "" : ` ${command.name}`} --help`).join("\n")
});
}
const options = this.isGlobalCommand ? globalOptions : [...this.options, ...globalOptions || []];
if (options.length > 0) {
const longestOptionName = findLongest(options.map((option) => option.rawName));
sections.push({
title: "Options",
body: options.map((option) => {
return ` ${padRight(option.rawName, longestOptionName.length)} ${option.description} ${option.config.default === void 0 ? "" : `(default: ${option.config.default})`}`;
}).join("\n")
});
}
if (this.examples.length > 0) {
sections.push({
title: "Examples",
body: this.examples.map((example) => {
if (typeof example === "function") {
return example(name);
}
return example;
}).join("\n")
});
}
if (helpCallback) {
sections = helpCallback(sections) || sections;
}
console.log(sections.map((section) => {
return section.title ? `${section.title}:
${section.body}` : section.body;
}).join("\n\n"));
}
outputVersion() {
const {name} = this.cli;
const {versionNumber} = this.cli.globalCommand;
if (versionNumber) {
console.log(`${name}/${versionNumber} ${platformInfo}`);
}
}
checkRequiredArgs() {
const minimalArgsCount = this.args.filter((arg) => arg.required).length;
if (this.cli.args.length < minimalArgsCount) {
throw new CACError(`missing required args for command \`${this.rawName}\``);
}
}
checkUnknownOptions() {
const {options, globalCommand} = this.cli;
if (!this.config.allowUnknownOptions) {
for (const name of Object.keys(options)) {
if (name !== "--" && !this.hasOption(name) && !globalCommand.hasOption(name)) {
throw new CACError(`Unknown option \`${name.length > 1 ? `--${name}` : `-${name}`}\``);
}
}
}
}
checkOptionValue() {
const {options: parsedOptions, globalCommand} = this.cli;
const options = [...globalCommand.options, ...this.options];
for (const option of options) {
const value = parsedOptions[option.name.split(".")[0]];
if (option.required) {
const hasNegated = options.some((o) => o.negated && o.names.includes(option.name));
if (value === true || value === false && !hasNegated) {
throw new CACError(`option \`${option.rawName}\` value is missing`);
}
}
}
}
}
class GlobalCommand extends Command {
constructor(cli) {
super("@@global@@", "", {}, cli);
}
}
var __assign = Object.assign;
class CAC extends require$$0.EventEmitter {
constructor(name = "") {
super();
this.name = name;
this.commands = [];
this.rawArgs = [];
this.args = [];
this.options = {};
this.globalCommand = new GlobalCommand(this);
this.globalCommand.usage("<command> [options]");
}
usage(text) {
this.globalCommand.usage(text);
return this;
}
command(rawName, description, config) {
const command = new Command(rawName, description || "", config, this);
command.globalCommand = this.globalCommand;
this.commands.push(command);
return command;
}
option(rawName, description, config) {
this.globalCommand.option(rawName, description, config);
return this;
}
help(callback) {
this.globalCommand.option("-h, --help", "Display this message");
this.globalCommand.helpCallback = callback;
this.showHelpOnExit = true;
return this;
}
version(version, customFlags = "-v, --version") {
this.globalCommand.version(version, customFlags);
this.showVersionOnExit = true;
return this;
}
example(example) {
this.globalCommand.example(example);
return this;
}
outputHelp() {
if (this.matchedCommand) {
this.matchedCommand.outputHelp();
} else {
this.globalCommand.outputHelp();
}
}
outputVersion() {
this.globalCommand.outputVersion();
}
setParsedInfo({args, options}, matchedCommand, matchedCommandName) {
this.args = args;
this.options = options;
if (matchedCommand) {
this.matchedCommand = matchedCommand;
}
if (matchedCommandName) {
this.matchedCommandName = matchedCommandName;
}
return this;
}
unsetMatchedCommand() {
this.matchedCommand = void 0;
this.matchedCommandName = void 0;
}
parse(argv = processArgs, {
run = true
} = {}) {
this.rawArgs = argv;
if (!this.name) {
this.name = argv[1] ? getFileName(argv[1]) : "cli";
}
let shouldParse = true;
for (const command of this.commands) {
const parsed = this.mri(argv.slice(2), command);
const commandName = parsed.args[0];
if (command.isMatched(commandName)) {
shouldParse = false;
const parsedInfo = __assign(__assign({}, parsed), {
args: parsed.args.slice(1)
});
this.setParsedInfo(parsedInfo, command, commandName);
this.emit(`command:${commandName}`, command);
}
}
if (shouldParse) {
for (const command of this.commands) {
if (command.name === "") {
shouldParse = false;
const parsed = this.mri(argv.slice(2), command);
this.setParsedInfo(parsed, command);
this.emit(`command:!`, command);
}
}
}
if (shouldParse) {
const parsed = this.mri(argv.slice(2));
this.setParsedInfo(parsed);
}
if (this.options.help && this.showHelpOnExit) {
this.outputHelp();
run = false;
this.unsetMatchedCommand();
}
if (this.options.version && this.showVersionOnExit) {
this.outputVersion();
run = false;
this.unsetMatchedCommand();
}
const parsedArgv = {args: this.args, options: this.options};
if (run) {
this.runMatchedCommand();
}
if (!this.matchedCommand && this.args[0]) {
this.emit("command:*");
}
return parsedArgv;
}
mri(argv, command) {
const cliOptions = [
...this.globalCommand.options,
...command ? command.options : []
];
const mriOptions = getMriOptions(cliOptions);
let argsAfterDoubleDashes = [];
const doubleDashesIndex = argv.indexOf("--");
if (doubleDashesIndex > -1) {
argsAfterDoubleDashes = argv.slice(doubleDashesIndex + 1);
argv = argv.slice(0, doubleDashesIndex);
}
let parsed = mri2(argv, mriOptions);
parsed = Object.keys(parsed).reduce((res, name) => {
return __assign(__assign({}, res), {
[camelcaseOptionName(name)]: parsed[name]
});
}, {_: []});
const args = parsed._;
const options = {
"--": argsAfterDoubleDashes
};
const ignoreDefault = command && command.config.ignoreOptionDefaultValue ? command.config.ignoreOptionDefaultValue : this.globalCommand.config.ignoreOptionDefaultValue;
let transforms = Object.create(null);
for (const cliOption of cliOptions) {
if (!ignoreDefault && cliOption.config.default !== void 0) {
for (const name of cliOption.names) {
options[name] = cliOption.config.default;
}
}
if (Array.isArray(cliOption.config.type)) {
if (transforms[cliOption.name] === void 0) {
transforms[cliOption.name] = Object.create(null);
transforms[cliOption.name]["shouldTransform"] = true;
transforms[cliOption.name]["transformFunction"] = cliOption.config.type[0];
}
}
}
for (const key of Object.keys(parsed)) {
if (key !== "_") {
const keys = key.split(".");
setDotProp(options, keys, parsed[key]);
setByType(options, transforms);
}
}
return {
args,
options
};
}
runMatchedCommand() {
const {args, options, matchedCommand: command} = this;
if (!command || !command.commandAction)
return;
command.checkUnknownOptions();
command.checkOptionValue();
command.checkRequiredArgs();
const actionArgs = [];
command.args.forEach((arg, index) => {
if (arg.variadic) {
actionArgs.push(args.slice(index));
} else {
actionArgs.push(args[index]);
}
});
actionArgs.push(options);
return command.commandAction.apply(this, actionArgs);
}
}
const cac = (name = "") => new CAC(name);
const cli = cac('vite');
/**
* removing global flags before passing as command specific sub-configs
*/
function cleanOptions(options) {
const ret = { ...options };
delete ret['--'];
delete ret.c;
delete ret.config;
delete ret.r;
delete ret.root;
delete ret.base;
delete ret.l;
delete ret.logLevel;
delete ret.clearScreen;
delete ret.d;
delete ret.debug;
delete ret.f;
delete ret.filter;
delete ret.m;
delete ret.mode;
return ret;
}
cli
.option('-c, --config <file>', `[string] use specified config file`)
.option('-r, --root <path>', `[string] use specified root directory`)
.option('--base <path>', `[string] public base path (default: /)`)
.option('-l, --logLevel <level>', `[string] info | warn | error | silent`)
.option('--clearScreen', `[boolean] allow/disable clear screen when logging`)
.option('-d, --debug [feat]', `[string | boolean] show debug logs`)
.option('-f, --filter <filter>', `[string] filter debug logs`)
.option('-m, --mode <mode>', `[string] set env mode`);
// dev
cli
.command('[root]') // default command
.alias('serve')
.option('--host [host]', `[string] specify hostname`)
.option('--port <port>', `[number] specify port`)
.option('--https', `[boolean] use TLS + HTTP/2`)
.option('--open [path]', `[boolean | string] open browser on startup`)
.option('--cors', `[boolean] enable CORS`)
.option('--strictPort', `[boolean] exit if specified port is already in use`)
.option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
.action(async (root, options) => {
// output structure is preserved even after bundling so require()
// is ok here
const { createServer } = await Promise.resolve().then(function () { return require('./chunks/dep-e0fe87f8.js'); }).then(function (n) { return n.index$1; });
try {
const server = await createServer({
root,
base: options.base,
mode: options.mode,
configFile: options.config,
logLevel: options.logLevel,
clearScreen: options.clearScreen,
server: cleanOptions(options)
});
if (!server.httpServer) {
throw new Error('HTTP server not available');
}
await server.listen();
const info = server.config.logger.info;
info(build.source.cyan(`\n vite v${require('vite/package.json').version}`) +
build.source.green(` dev server running at:\n`), {
clear: !server.config.logger.hasWarned
});
server.printUrls();
// @ts-ignore
if (global.__vite_start_time) {
// @ts-ignore
const startupDuration = perf_hooks.performance.now() - global.__vite_start_time;
info(`\n ${build.source.cyan(`ready in ${Math.ceil(startupDuration)}ms.`)}\n`);
}
}
catch (e) {
build.createLogger(options.logLevel).error(build.source.red(`error when starting dev server:\n${e.stack}`), { error: e });
process.exit(1);
}
});
// build
cli
.command('build [root]')
.option('--target <target>', `[string] transpile target (default: 'modules')`)
.option('--outDir <dir>', `[string] output directory (default: dist)`)
.option('--assetsDir <dir>', `[string] directory under outDir to place assets in (default: _assets)`)
.option('--assetsInlineLimit <number>', `[number] static asset base64 inline threshold in bytes (default: 4096)`)
.option('--ssr [entry]', `[string] build specified entry for server-side rendering`)
.option('--sourcemap', `[boolean] output source maps for build (default: false)`)
.option('--minify [minifier]', `[boolean | "terser" | "esbuild"] enable/disable minification, ` +
`or specify minifier to use (default: esbuild)`)
.option('--manifest', `[boolean] emit build manifest json`)
.option('--ssrManifest', `[boolean] emit ssr manifest json`)
.option('--emptyOutDir', `[boolean] force empty outDir when it's outside of root`)
.option('-w, --watch', `[boolean] rebuilds when modules have changed on disk`)
.action(async (root, options) => {
const { build: build$1 } = await Promise.resolve().then(function () { return require('./chunks/dep-e0fe87f8.js'); }).then(function (n) { return n.build$1; });
const buildOptions = cleanOptions(options);
try {
await build$1({
root,
base: options.base,
mode: options.mode,
configFile: options.config,
logLevel: options.logLevel,
clearScreen: options.clearScreen,
build: buildOptions
});
}
catch (e) {
build.createLogger(options.logLevel).error(build.source.red(`error during build:\n${e.stack}`), { error: e });
process.exit(1);
}
});
// optimize
cli
.command('optimize [root]')
.option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
.action(async (root, options) => {
const { optimizeDeps } = await Promise.resolve().then(function () { return require('./chunks/dep-e0fe87f8.js'); }).then(function (n) { return n.index; });
try {
const config = await build.resolveConfig({
root,
base: options.base,
configFile: options.config,
logLevel: options.logLevel
}, 'build', 'development');
await optimizeDeps(config, options.force, true);
}
catch (e) {
build.createLogger(options.logLevel).error(build.source.red(`error when optimizing deps:\n${e.stack}`), { error: e });
process.exit(1);
}
});
cli
.command('preview [root]')
.option('--host [host]', `[string] specify hostname`)
.option('--port <port>', `[number] specify port`)
.option('--https', `[boolean] use TLS + HTTP/2`)
.option('--open [path]', `[boolean | string] open browser on startup`)
.option('--strictPort', `[boolean] exit if specified port is already in use`)
.action(async (root, options) => {
try {
const config = await build.resolveConfig({
root,
base: options.base,
configFile: options.config,
logLevel: options.logLevel,
server: {
host: options.host,
open: options.open,
strictPort: options.strictPort,
https: options.https
}
}, 'serve', 'production');
const server = await build.preview(config, cleanOptions(options));
build.printHttpServerUrls(server, config);
}
catch (e) {
build.createLogger(options.logLevel).error(build.source.red(`error when starting preview server:\n${e.stack}`), { error: e });
process.exit(1);
}
});
cli.help();
cli.version(require('../../package.json').version);
cli.parse();
//# sourceMappingURL=cli.js.map

1
node_modules/vite/dist/node/cli.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

2580
node_modules/vite/dist/node/index.d.ts generated vendored Normal file

File diff suppressed because it is too large Load Diff

52
node_modules/vite/dist/node/index.js generated vendored Normal file
View File

@@ -0,0 +1,52 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var build = require('./chunks/dep-e0fe87f8.js');
require('fs');
require('path');
require('events');
require('util');
require('stream');
require('os');
require('perf_hooks');
require('url');
require('crypto');
require('module');
require('esbuild');
require('worker_threads');
require('assert');
require('child_process');
require('readline');
require('zlib');
require('resolve');
require('querystring');
require('tty');
require('net');
require('http');
require('buffer');
require('https');
require('tls');
exports.build = build.build;
exports.createLogger = build.createLogger;
exports.createServer = build.createServer;
exports.defineConfig = build.defineConfig;
exports.loadConfigFromFile = build.loadConfigFromFile;
exports.loadEnv = build.loadEnv;
exports.mergeConfig = build.mergeConfig;
exports.normalizePath = build.normalizePath;
exports.optimizeDeps = build.optimizeDeps;
exports.preview = build.preview;
exports.printHttpServerUrls = build.printHttpServerUrls;
exports.resolveConfig = build.resolveConfig;
exports.resolveEnvPrefix = build.resolveEnvPrefix;
exports.resolvePackageData = build.resolvePackageData;
exports.resolvePackageEntry = build.resolvePackageEntry;
exports.searchForWorkspaceRoot = build.searchForWorkspaceRoot;
exports.send = build.send;
exports.sortUserPlugins = build.sortUserPlugins;
exports.transformWithEsbuild = build.transformWithEsbuild;
//# sourceMappingURL=index.js.map

1
node_modules/vite/dist/node/index.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}

31356
node_modules/vite/dist/node/terser.js generated vendored Normal file

File diff suppressed because one or more lines are too long