vite 6.3.5 → 7.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +29 -0
- package/bin/vite.js +4 -4
- package/dist/client/client.mjs +793 -921
- package/dist/client/env.mjs +14 -19
- package/dist/node/chunks/dep-3PhSlasG.js +5 -0
- package/dist/node/chunks/dep-B4i1tHPo.js +30 -0
- package/dist/node/chunks/dep-BO5GbxpL.js +7345 -0
- package/dist/node/chunks/dep-BaSfMtGz.js +5 -0
- package/dist/node/chunks/dep-Bb92EWrU.js +5 -0
- package/dist/node/chunks/dep-C9KS6hrN.js +5 -0
- package/dist/node/chunks/dep-Ctugieod.js +150 -0
- package/dist/node/chunks/dep-D5HXLrlI.js +378 -0
- package/dist/node/chunks/dep-Da5Rc_CS.js +36548 -0
- package/dist/node/chunks/dep-Dg4W3IAQ.js +5597 -0
- package/dist/node/chunks/dep-uSUFJk9A.js +446 -0
- package/dist/node/cli.js +617 -865
- package/dist/node/constants.js +3 -148
- package/dist/node/index.d.ts +2724 -3124
- package/dist/node/index.js +25 -188
- package/dist/node/module-runner.d.ts +243 -234
- package/dist/node/module-runner.js +1043 -1172
- package/dist/node/moduleRunnerTransport-BWUZBVLX.d.ts +88 -0
- package/package.json +38 -41
- package/types/importGlob.d.ts +4 -0
- package/types/internal/cssPreprocessorOptions.d.ts +3 -22
- package/dist/node/chunks/dep-3RmXg9uo.js +0 -553
- package/dist/node/chunks/dep-AiMcmC_f.js +0 -822
- package/dist/node/chunks/dep-CvfTChi5.js +0 -8218
- package/dist/node/chunks/dep-DBxKXgDP.js +0 -49496
- package/dist/node/chunks/dep-SgSik2vo.js +0 -7113
- package/dist/node/moduleRunnerTransport.d-DJ_mE5sf.d.ts +0 -87
- package/dist/node-cjs/publicUtils.cjs +0 -3986
- package/index.cjs +0 -96
- package/index.d.cts +0 -6
@@ -0,0 +1,5 @@
|
|
1
|
+
import { createRequire as ___createRequire } from 'module'; const require = ___createRequire(import.meta.url);
|
2
|
+
import { _createServer, createServer, createServerCloseFn, resolveServerOptions, restartServerWithUrls, serverConfigDefaults } from "./dep-Da5Rc_CS.js";
|
3
|
+
import "./dep-Ctugieod.js";
|
4
|
+
|
5
|
+
export { createServer };
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import { createRequire as ___createRequire } from 'module'; const require = ___createRequire(import.meta.url);
|
2
|
+
import { addManuallyIncludedOptimizeDeps, addOptimizedDepInfo, cleanupDepsCacheStaleDirs, createIsOptimizedDepFile, createIsOptimizedDepUrl, depsFromOptimizedDepInfo, depsLogString, discoverProjectDependencies, extractExportsData, getDepsCacheDir, getOptimizedDepPath, initDepsOptimizerMetadata, isDepOptimizationDisabled, loadCachedDepOptimizationMetadata, optimizeDeps, optimizeExplicitEnvironmentDeps, optimizedDepInfoFromFile, optimizedDepInfoFromId, optimizedDepNeedsInterop, runOptimizeDeps, toDiscoveredDependencies } from "./dep-Da5Rc_CS.js";
|
3
|
+
import "./dep-Ctugieod.js";
|
4
|
+
|
5
|
+
export { optimizeDeps };
|
@@ -0,0 +1,150 @@
|
|
1
|
+
import { createRequire as ___createRequire } from 'module'; const require = ___createRequire(import.meta.url);
|
2
|
+
import { readFileSync } from "node:fs";
|
3
|
+
import path, { resolve } from "node:path";
|
4
|
+
import { fileURLToPath } from "node:url";
|
5
|
+
|
6
|
+
//#region src/node/constants.ts
|
7
|
+
const { version } = JSON.parse(readFileSync(new URL("../../package.json", new URL("../../../src/node/constants.ts", import.meta.url))).toString());
|
8
|
+
const ROLLUP_HOOKS = [
|
9
|
+
"options",
|
10
|
+
"buildStart",
|
11
|
+
"buildEnd",
|
12
|
+
"renderStart",
|
13
|
+
"renderError",
|
14
|
+
"renderChunk",
|
15
|
+
"writeBundle",
|
16
|
+
"generateBundle",
|
17
|
+
"banner",
|
18
|
+
"footer",
|
19
|
+
"augmentChunkHash",
|
20
|
+
"outputOptions",
|
21
|
+
"renderDynamicImport",
|
22
|
+
"resolveFileUrl",
|
23
|
+
"resolveImportMeta",
|
24
|
+
"intro",
|
25
|
+
"outro",
|
26
|
+
"closeBundle",
|
27
|
+
"closeWatcher",
|
28
|
+
"load",
|
29
|
+
"moduleParsed",
|
30
|
+
"watchChange",
|
31
|
+
"resolveDynamicImport",
|
32
|
+
"resolveId",
|
33
|
+
"shouldTransformCachedModule",
|
34
|
+
"transform",
|
35
|
+
"onLog"
|
36
|
+
];
|
37
|
+
const VERSION = version;
|
38
|
+
const DEFAULT_MAIN_FIELDS = [
|
39
|
+
"browser",
|
40
|
+
"module",
|
41
|
+
"jsnext:main",
|
42
|
+
"jsnext"
|
43
|
+
];
|
44
|
+
const DEFAULT_CLIENT_MAIN_FIELDS = Object.freeze(DEFAULT_MAIN_FIELDS);
|
45
|
+
const DEFAULT_SERVER_MAIN_FIELDS = Object.freeze(DEFAULT_MAIN_FIELDS.filter((f) => f !== "browser"));
|
46
|
+
/**
|
47
|
+
* A special condition that would be replaced with production or development
|
48
|
+
* depending on NODE_ENV env variable
|
49
|
+
*/
|
50
|
+
const DEV_PROD_CONDITION = `development|production`;
|
51
|
+
const DEFAULT_CONDITIONS = [
|
52
|
+
"module",
|
53
|
+
"browser",
|
54
|
+
"node",
|
55
|
+
DEV_PROD_CONDITION
|
56
|
+
];
|
57
|
+
const DEFAULT_CLIENT_CONDITIONS = Object.freeze(DEFAULT_CONDITIONS.filter((c) => c !== "node"));
|
58
|
+
const DEFAULT_SERVER_CONDITIONS = Object.freeze(DEFAULT_CONDITIONS.filter((c) => c !== "browser"));
|
59
|
+
/**
|
60
|
+
* The browser versions that are included in the Baseline Widely Available on 2025-05-01.
|
61
|
+
*
|
62
|
+
* This value would be bumped on each major release of Vite.
|
63
|
+
*
|
64
|
+
* The value is generated by `pnpm generate-target` script.
|
65
|
+
*/
|
66
|
+
const ESBUILD_BASELINE_WIDELY_AVAILABLE_TARGET = [
|
67
|
+
"chrome107",
|
68
|
+
"edge107",
|
69
|
+
"firefox104",
|
70
|
+
"safari16"
|
71
|
+
];
|
72
|
+
const DEFAULT_CONFIG_FILES = [
|
73
|
+
"vite.config.js",
|
74
|
+
"vite.config.mjs",
|
75
|
+
"vite.config.ts",
|
76
|
+
"vite.config.cjs",
|
77
|
+
"vite.config.mts",
|
78
|
+
"vite.config.cts"
|
79
|
+
];
|
80
|
+
const JS_TYPES_RE = /\.(?:j|t)sx?$|\.mjs$/;
|
81
|
+
const CSS_LANGS_RE = /\.(css|less|sass|scss|styl|stylus|pcss|postcss|sss)(?:$|\?)/;
|
82
|
+
const OPTIMIZABLE_ENTRY_RE = /\.[cm]?[jt]s$/;
|
83
|
+
const SPECIAL_QUERY_RE = /[?&](?:worker|sharedworker|raw|url)\b/;
|
84
|
+
/**
|
85
|
+
* Prefix for resolved fs paths, since windows paths may not be valid as URLs.
|
86
|
+
*/
|
87
|
+
const FS_PREFIX = `/@fs/`;
|
88
|
+
const CLIENT_PUBLIC_PATH = `/@vite/client`;
|
89
|
+
const ENV_PUBLIC_PATH = `/@vite/env`;
|
90
|
+
const VITE_PACKAGE_DIR = resolve(fileURLToPath(new URL("../../../src/node/constants.ts", import.meta.url)), "../../..");
|
91
|
+
const CLIENT_ENTRY = resolve(VITE_PACKAGE_DIR, "dist/client/client.mjs");
|
92
|
+
const ENV_ENTRY = resolve(VITE_PACKAGE_DIR, "dist/client/env.mjs");
|
93
|
+
const CLIENT_DIR = path.dirname(CLIENT_ENTRY);
|
94
|
+
const KNOWN_ASSET_TYPES = [
|
95
|
+
"apng",
|
96
|
+
"bmp",
|
97
|
+
"png",
|
98
|
+
"jpe?g",
|
99
|
+
"jfif",
|
100
|
+
"pjpeg",
|
101
|
+
"pjp",
|
102
|
+
"gif",
|
103
|
+
"svg",
|
104
|
+
"ico",
|
105
|
+
"webp",
|
106
|
+
"avif",
|
107
|
+
"cur",
|
108
|
+
"jxl",
|
109
|
+
"mp4",
|
110
|
+
"webm",
|
111
|
+
"ogg",
|
112
|
+
"mp3",
|
113
|
+
"wav",
|
114
|
+
"flac",
|
115
|
+
"aac",
|
116
|
+
"opus",
|
117
|
+
"mov",
|
118
|
+
"m4a",
|
119
|
+
"vtt",
|
120
|
+
"woff2?",
|
121
|
+
"eot",
|
122
|
+
"ttf",
|
123
|
+
"otf",
|
124
|
+
"webmanifest",
|
125
|
+
"pdf",
|
126
|
+
"txt"
|
127
|
+
];
|
128
|
+
const DEFAULT_ASSETS_RE = new RegExp(`\\.(` + KNOWN_ASSET_TYPES.join("|") + `)(\\?.*)?$`, "i");
|
129
|
+
const DEP_VERSION_RE = /[?&](v=[\w.-]+)\b/;
|
130
|
+
const loopbackHosts = new Set([
|
131
|
+
"localhost",
|
132
|
+
"127.0.0.1",
|
133
|
+
"::1",
|
134
|
+
"0000:0000:0000:0000:0000:0000:0000:0001"
|
135
|
+
]);
|
136
|
+
const wildcardHosts = new Set([
|
137
|
+
"0.0.0.0",
|
138
|
+
"::",
|
139
|
+
"0000:0000:0000:0000:0000:0000:0000:0000"
|
140
|
+
]);
|
141
|
+
const DEFAULT_DEV_PORT = 5173;
|
142
|
+
const DEFAULT_PREVIEW_PORT = 4173;
|
143
|
+
const DEFAULT_ASSETS_INLINE_LIMIT = 4096;
|
144
|
+
const defaultAllowedOrigins = /^https?:\/\/(?:(?:[^:]+\.)?localhost|127\.0\.0\.1|\[::1\])(?::\d+)?$/;
|
145
|
+
const METADATA_FILENAME = "_metadata.json";
|
146
|
+
const ERR_OPTIMIZE_DEPS_PROCESSING_ERROR = "ERR_OPTIMIZE_DEPS_PROCESSING_ERROR";
|
147
|
+
const ERR_FILE_NOT_FOUND_IN_OPTIMIZED_DEP_DIR = "ERR_FILE_NOT_FOUND_IN_OPTIMIZED_DEP_DIR";
|
148
|
+
|
149
|
+
//#endregion
|
150
|
+
export { CLIENT_DIR, CLIENT_ENTRY, CLIENT_PUBLIC_PATH, CSS_LANGS_RE, DEFAULT_ASSETS_INLINE_LIMIT, DEFAULT_ASSETS_RE, DEFAULT_CLIENT_CONDITIONS, DEFAULT_CLIENT_MAIN_FIELDS, DEFAULT_CONFIG_FILES, DEFAULT_DEV_PORT, DEFAULT_PREVIEW_PORT, DEFAULT_SERVER_CONDITIONS, DEFAULT_SERVER_MAIN_FIELDS, DEP_VERSION_RE, DEV_PROD_CONDITION, ENV_ENTRY, ENV_PUBLIC_PATH, ERR_FILE_NOT_FOUND_IN_OPTIMIZED_DEP_DIR, ERR_OPTIMIZE_DEPS_PROCESSING_ERROR, ESBUILD_BASELINE_WIDELY_AVAILABLE_TARGET, FS_PREFIX, JS_TYPES_RE, KNOWN_ASSET_TYPES, METADATA_FILENAME, OPTIMIZABLE_ENTRY_RE, ROLLUP_HOOKS, SPECIAL_QUERY_RE, VERSION, VITE_PACKAGE_DIR, defaultAllowedOrigins, loopbackHosts, wildcardHosts };
|
@@ -0,0 +1,378 @@
|
|
1
|
+
import { createRequire as ___createRequire } from 'module'; const require = ___createRequire(import.meta.url);
|
2
|
+
import { __commonJS } from "./dep-B4i1tHPo.js";
|
3
|
+
|
4
|
+
//#region ../../node_modules/.pnpm/postcss-value-parser@4.2.0/node_modules/postcss-value-parser/lib/parse.js
|
5
|
+
var require_parse = __commonJS({ "../../node_modules/.pnpm/postcss-value-parser@4.2.0/node_modules/postcss-value-parser/lib/parse.js"(exports, module) {
|
6
|
+
var openParentheses = "(".charCodeAt(0);
|
7
|
+
var closeParentheses = ")".charCodeAt(0);
|
8
|
+
var singleQuote = "'".charCodeAt(0);
|
9
|
+
var doubleQuote = "\"".charCodeAt(0);
|
10
|
+
var backslash = "\\".charCodeAt(0);
|
11
|
+
var slash = "/".charCodeAt(0);
|
12
|
+
var comma = ",".charCodeAt(0);
|
13
|
+
var colon = ":".charCodeAt(0);
|
14
|
+
var star = "*".charCodeAt(0);
|
15
|
+
var uLower = "u".charCodeAt(0);
|
16
|
+
var uUpper = "U".charCodeAt(0);
|
17
|
+
var plus$1 = "+".charCodeAt(0);
|
18
|
+
var isUnicodeRange = /^[a-f0-9?-]+$/i;
|
19
|
+
module.exports = function(input) {
|
20
|
+
var tokens = [];
|
21
|
+
var value = input;
|
22
|
+
var next, quote, prev, token, escape, escapePos, whitespacePos, parenthesesOpenPos;
|
23
|
+
var pos = 0;
|
24
|
+
var code = value.charCodeAt(pos);
|
25
|
+
var max = value.length;
|
26
|
+
var stack = [{ nodes: tokens }];
|
27
|
+
var balanced = 0;
|
28
|
+
var parent;
|
29
|
+
var name = "";
|
30
|
+
var before = "";
|
31
|
+
var after = "";
|
32
|
+
while (pos < max) if (code <= 32) {
|
33
|
+
next = pos;
|
34
|
+
do {
|
35
|
+
next += 1;
|
36
|
+
code = value.charCodeAt(next);
|
37
|
+
} while (code <= 32);
|
38
|
+
token = value.slice(pos, next);
|
39
|
+
prev = tokens[tokens.length - 1];
|
40
|
+
if (code === closeParentheses && balanced) after = token;
|
41
|
+
else if (prev && prev.type === "div") {
|
42
|
+
prev.after = token;
|
43
|
+
prev.sourceEndIndex += token.length;
|
44
|
+
} else if (code === comma || code === colon || code === slash && value.charCodeAt(next + 1) !== star && (!parent || parent && parent.type === "function" && parent.value !== "calc")) before = token;
|
45
|
+
else tokens.push({
|
46
|
+
type: "space",
|
47
|
+
sourceIndex: pos,
|
48
|
+
sourceEndIndex: next,
|
49
|
+
value: token
|
50
|
+
});
|
51
|
+
pos = next;
|
52
|
+
} else if (code === singleQuote || code === doubleQuote) {
|
53
|
+
next = pos;
|
54
|
+
quote = code === singleQuote ? "'" : "\"";
|
55
|
+
token = {
|
56
|
+
type: "string",
|
57
|
+
sourceIndex: pos,
|
58
|
+
quote
|
59
|
+
};
|
60
|
+
do {
|
61
|
+
escape = false;
|
62
|
+
next = value.indexOf(quote, next + 1);
|
63
|
+
if (~next) {
|
64
|
+
escapePos = next;
|
65
|
+
while (value.charCodeAt(escapePos - 1) === backslash) {
|
66
|
+
escapePos -= 1;
|
67
|
+
escape = !escape;
|
68
|
+
}
|
69
|
+
} else {
|
70
|
+
value += quote;
|
71
|
+
next = value.length - 1;
|
72
|
+
token.unclosed = true;
|
73
|
+
}
|
74
|
+
} while (escape);
|
75
|
+
token.value = value.slice(pos + 1, next);
|
76
|
+
token.sourceEndIndex = token.unclosed ? next : next + 1;
|
77
|
+
tokens.push(token);
|
78
|
+
pos = next + 1;
|
79
|
+
code = value.charCodeAt(pos);
|
80
|
+
} else if (code === slash && value.charCodeAt(pos + 1) === star) {
|
81
|
+
next = value.indexOf("*/", pos);
|
82
|
+
token = {
|
83
|
+
type: "comment",
|
84
|
+
sourceIndex: pos,
|
85
|
+
sourceEndIndex: next + 2
|
86
|
+
};
|
87
|
+
if (next === -1) {
|
88
|
+
token.unclosed = true;
|
89
|
+
next = value.length;
|
90
|
+
token.sourceEndIndex = next;
|
91
|
+
}
|
92
|
+
token.value = value.slice(pos + 2, next);
|
93
|
+
tokens.push(token);
|
94
|
+
pos = next + 2;
|
95
|
+
code = value.charCodeAt(pos);
|
96
|
+
} else if ((code === slash || code === star) && parent && parent.type === "function" && parent.value === "calc") {
|
97
|
+
token = value[pos];
|
98
|
+
tokens.push({
|
99
|
+
type: "word",
|
100
|
+
sourceIndex: pos - before.length,
|
101
|
+
sourceEndIndex: pos + token.length,
|
102
|
+
value: token
|
103
|
+
});
|
104
|
+
pos += 1;
|
105
|
+
code = value.charCodeAt(pos);
|
106
|
+
} else if (code === slash || code === comma || code === colon) {
|
107
|
+
token = value[pos];
|
108
|
+
tokens.push({
|
109
|
+
type: "div",
|
110
|
+
sourceIndex: pos - before.length,
|
111
|
+
sourceEndIndex: pos + token.length,
|
112
|
+
value: token,
|
113
|
+
before,
|
114
|
+
after: ""
|
115
|
+
});
|
116
|
+
before = "";
|
117
|
+
pos += 1;
|
118
|
+
code = value.charCodeAt(pos);
|
119
|
+
} else if (openParentheses === code) {
|
120
|
+
next = pos;
|
121
|
+
do {
|
122
|
+
next += 1;
|
123
|
+
code = value.charCodeAt(next);
|
124
|
+
} while (code <= 32);
|
125
|
+
parenthesesOpenPos = pos;
|
126
|
+
token = {
|
127
|
+
type: "function",
|
128
|
+
sourceIndex: pos - name.length,
|
129
|
+
value: name,
|
130
|
+
before: value.slice(parenthesesOpenPos + 1, next)
|
131
|
+
};
|
132
|
+
pos = next;
|
133
|
+
if (name === "url" && code !== singleQuote && code !== doubleQuote) {
|
134
|
+
next -= 1;
|
135
|
+
do {
|
136
|
+
escape = false;
|
137
|
+
next = value.indexOf(")", next + 1);
|
138
|
+
if (~next) {
|
139
|
+
escapePos = next;
|
140
|
+
while (value.charCodeAt(escapePos - 1) === backslash) {
|
141
|
+
escapePos -= 1;
|
142
|
+
escape = !escape;
|
143
|
+
}
|
144
|
+
} else {
|
145
|
+
value += ")";
|
146
|
+
next = value.length - 1;
|
147
|
+
token.unclosed = true;
|
148
|
+
}
|
149
|
+
} while (escape);
|
150
|
+
whitespacePos = next;
|
151
|
+
do {
|
152
|
+
whitespacePos -= 1;
|
153
|
+
code = value.charCodeAt(whitespacePos);
|
154
|
+
} while (code <= 32);
|
155
|
+
if (parenthesesOpenPos < whitespacePos) {
|
156
|
+
if (pos !== whitespacePos + 1) token.nodes = [{
|
157
|
+
type: "word",
|
158
|
+
sourceIndex: pos,
|
159
|
+
sourceEndIndex: whitespacePos + 1,
|
160
|
+
value: value.slice(pos, whitespacePos + 1)
|
161
|
+
}];
|
162
|
+
else token.nodes = [];
|
163
|
+
if (token.unclosed && whitespacePos + 1 !== next) {
|
164
|
+
token.after = "";
|
165
|
+
token.nodes.push({
|
166
|
+
type: "space",
|
167
|
+
sourceIndex: whitespacePos + 1,
|
168
|
+
sourceEndIndex: next,
|
169
|
+
value: value.slice(whitespacePos + 1, next)
|
170
|
+
});
|
171
|
+
} else {
|
172
|
+
token.after = value.slice(whitespacePos + 1, next);
|
173
|
+
token.sourceEndIndex = next;
|
174
|
+
}
|
175
|
+
} else {
|
176
|
+
token.after = "";
|
177
|
+
token.nodes = [];
|
178
|
+
}
|
179
|
+
pos = next + 1;
|
180
|
+
token.sourceEndIndex = token.unclosed ? next : pos;
|
181
|
+
code = value.charCodeAt(pos);
|
182
|
+
tokens.push(token);
|
183
|
+
} else {
|
184
|
+
balanced += 1;
|
185
|
+
token.after = "";
|
186
|
+
token.sourceEndIndex = pos + 1;
|
187
|
+
tokens.push(token);
|
188
|
+
stack.push(token);
|
189
|
+
tokens = token.nodes = [];
|
190
|
+
parent = token;
|
191
|
+
}
|
192
|
+
name = "";
|
193
|
+
} else if (closeParentheses === code && balanced) {
|
194
|
+
pos += 1;
|
195
|
+
code = value.charCodeAt(pos);
|
196
|
+
parent.after = after;
|
197
|
+
parent.sourceEndIndex += after.length;
|
198
|
+
after = "";
|
199
|
+
balanced -= 1;
|
200
|
+
stack[stack.length - 1].sourceEndIndex = pos;
|
201
|
+
stack.pop();
|
202
|
+
parent = stack[balanced];
|
203
|
+
tokens = parent.nodes;
|
204
|
+
} else {
|
205
|
+
next = pos;
|
206
|
+
do {
|
207
|
+
if (code === backslash) next += 1;
|
208
|
+
next += 1;
|
209
|
+
code = value.charCodeAt(next);
|
210
|
+
} 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));
|
211
|
+
token = value.slice(pos, next);
|
212
|
+
if (openParentheses === code) name = token;
|
213
|
+
else if ((uLower === token.charCodeAt(0) || uUpper === token.charCodeAt(0)) && plus$1 === token.charCodeAt(1) && isUnicodeRange.test(token.slice(2))) tokens.push({
|
214
|
+
type: "unicode-range",
|
215
|
+
sourceIndex: pos,
|
216
|
+
sourceEndIndex: next,
|
217
|
+
value: token
|
218
|
+
});
|
219
|
+
else tokens.push({
|
220
|
+
type: "word",
|
221
|
+
sourceIndex: pos,
|
222
|
+
sourceEndIndex: next,
|
223
|
+
value: token
|
224
|
+
});
|
225
|
+
pos = next;
|
226
|
+
}
|
227
|
+
for (pos = stack.length - 1; pos; pos -= 1) {
|
228
|
+
stack[pos].unclosed = true;
|
229
|
+
stack[pos].sourceEndIndex = value.length;
|
230
|
+
}
|
231
|
+
return stack[0].nodes;
|
232
|
+
};
|
233
|
+
} });
|
234
|
+
|
235
|
+
//#endregion
|
236
|
+
//#region ../../node_modules/.pnpm/postcss-value-parser@4.2.0/node_modules/postcss-value-parser/lib/walk.js
|
237
|
+
var require_walk = __commonJS({ "../../node_modules/.pnpm/postcss-value-parser@4.2.0/node_modules/postcss-value-parser/lib/walk.js"(exports, module) {
|
238
|
+
module.exports = function walk$1(nodes, cb, bubble) {
|
239
|
+
var i, max, node, result;
|
240
|
+
for (i = 0, max = nodes.length; i < max; i += 1) {
|
241
|
+
node = nodes[i];
|
242
|
+
if (!bubble) result = cb(node, i, nodes);
|
243
|
+
if (result !== false && node.type === "function" && Array.isArray(node.nodes)) walk$1(node.nodes, cb, bubble);
|
244
|
+
if (bubble) cb(node, i, nodes);
|
245
|
+
}
|
246
|
+
};
|
247
|
+
} });
|
248
|
+
|
249
|
+
//#endregion
|
250
|
+
//#region ../../node_modules/.pnpm/postcss-value-parser@4.2.0/node_modules/postcss-value-parser/lib/stringify.js
|
251
|
+
var require_stringify = __commonJS({ "../../node_modules/.pnpm/postcss-value-parser@4.2.0/node_modules/postcss-value-parser/lib/stringify.js"(exports, module) {
|
252
|
+
function stringifyNode(node, custom) {
|
253
|
+
var type = node.type;
|
254
|
+
var value = node.value;
|
255
|
+
var buf;
|
256
|
+
var customResult;
|
257
|
+
if (custom && (customResult = custom(node)) !== void 0) return customResult;
|
258
|
+
else if (type === "word" || type === "space") return value;
|
259
|
+
else if (type === "string") {
|
260
|
+
buf = node.quote || "";
|
261
|
+
return buf + value + (node.unclosed ? "" : buf);
|
262
|
+
} else if (type === "comment") return "/*" + value + (node.unclosed ? "" : "*/");
|
263
|
+
else if (type === "div") return (node.before || "") + value + (node.after || "");
|
264
|
+
else if (Array.isArray(node.nodes)) {
|
265
|
+
buf = stringify$1(node.nodes, custom);
|
266
|
+
if (type !== "function") return buf;
|
267
|
+
return value + "(" + (node.before || "") + buf + (node.after || "") + (node.unclosed ? "" : ")");
|
268
|
+
}
|
269
|
+
return value;
|
270
|
+
}
|
271
|
+
function stringify$1(nodes, custom) {
|
272
|
+
var result, i;
|
273
|
+
if (Array.isArray(nodes)) {
|
274
|
+
result = "";
|
275
|
+
for (i = nodes.length - 1; ~i; i -= 1) result = stringifyNode(nodes[i], custom) + result;
|
276
|
+
return result;
|
277
|
+
}
|
278
|
+
return stringifyNode(nodes, custom);
|
279
|
+
}
|
280
|
+
module.exports = stringify$1;
|
281
|
+
} });
|
282
|
+
|
283
|
+
//#endregion
|
284
|
+
//#region ../../node_modules/.pnpm/postcss-value-parser@4.2.0/node_modules/postcss-value-parser/lib/unit.js
|
285
|
+
var require_unit = __commonJS({ "../../node_modules/.pnpm/postcss-value-parser@4.2.0/node_modules/postcss-value-parser/lib/unit.js"(exports, module) {
|
286
|
+
var minus = "-".charCodeAt(0);
|
287
|
+
var plus = "+".charCodeAt(0);
|
288
|
+
var dot = ".".charCodeAt(0);
|
289
|
+
var exp = "e".charCodeAt(0);
|
290
|
+
var EXP = "E".charCodeAt(0);
|
291
|
+
function likeNumber(value) {
|
292
|
+
var code = value.charCodeAt(0);
|
293
|
+
var nextCode;
|
294
|
+
if (code === plus || code === minus) {
|
295
|
+
nextCode = value.charCodeAt(1);
|
296
|
+
if (nextCode >= 48 && nextCode <= 57) return true;
|
297
|
+
var nextNextCode = value.charCodeAt(2);
|
298
|
+
if (nextCode === dot && nextNextCode >= 48 && nextNextCode <= 57) return true;
|
299
|
+
return false;
|
300
|
+
}
|
301
|
+
if (code === dot) {
|
302
|
+
nextCode = value.charCodeAt(1);
|
303
|
+
if (nextCode >= 48 && nextCode <= 57) return true;
|
304
|
+
return false;
|
305
|
+
}
|
306
|
+
if (code >= 48 && code <= 57) return true;
|
307
|
+
return false;
|
308
|
+
}
|
309
|
+
module.exports = function(value) {
|
310
|
+
var pos = 0;
|
311
|
+
var length = value.length;
|
312
|
+
var code;
|
313
|
+
var nextCode;
|
314
|
+
var nextNextCode;
|
315
|
+
if (length === 0 || !likeNumber(value)) return false;
|
316
|
+
code = value.charCodeAt(pos);
|
317
|
+
if (code === plus || code === minus) pos++;
|
318
|
+
while (pos < length) {
|
319
|
+
code = value.charCodeAt(pos);
|
320
|
+
if (code < 48 || code > 57) break;
|
321
|
+
pos += 1;
|
322
|
+
}
|
323
|
+
code = value.charCodeAt(pos);
|
324
|
+
nextCode = value.charCodeAt(pos + 1);
|
325
|
+
if (code === dot && nextCode >= 48 && nextCode <= 57) {
|
326
|
+
pos += 2;
|
327
|
+
while (pos < length) {
|
328
|
+
code = value.charCodeAt(pos);
|
329
|
+
if (code < 48 || code > 57) break;
|
330
|
+
pos += 1;
|
331
|
+
}
|
332
|
+
}
|
333
|
+
code = value.charCodeAt(pos);
|
334
|
+
nextCode = value.charCodeAt(pos + 1);
|
335
|
+
nextNextCode = value.charCodeAt(pos + 2);
|
336
|
+
if ((code === exp || code === EXP) && (nextCode >= 48 && nextCode <= 57 || (nextCode === plus || nextCode === minus) && nextNextCode >= 48 && nextNextCode <= 57)) {
|
337
|
+
pos += nextCode === plus || nextCode === minus ? 3 : 2;
|
338
|
+
while (pos < length) {
|
339
|
+
code = value.charCodeAt(pos);
|
340
|
+
if (code < 48 || code > 57) break;
|
341
|
+
pos += 1;
|
342
|
+
}
|
343
|
+
}
|
344
|
+
return {
|
345
|
+
number: value.slice(0, pos),
|
346
|
+
unit: value.slice(pos)
|
347
|
+
};
|
348
|
+
};
|
349
|
+
} });
|
350
|
+
|
351
|
+
//#endregion
|
352
|
+
//#region ../../node_modules/.pnpm/postcss-value-parser@4.2.0/node_modules/postcss-value-parser/lib/index.js
|
353
|
+
var require_lib = __commonJS({ "../../node_modules/.pnpm/postcss-value-parser@4.2.0/node_modules/postcss-value-parser/lib/index.js"(exports, module) {
|
354
|
+
var parse = require_parse();
|
355
|
+
var walk = require_walk();
|
356
|
+
var stringify = require_stringify();
|
357
|
+
function ValueParser(value) {
|
358
|
+
if (this instanceof ValueParser) {
|
359
|
+
this.nodes = parse(value);
|
360
|
+
return this;
|
361
|
+
}
|
362
|
+
return new ValueParser(value);
|
363
|
+
}
|
364
|
+
ValueParser.prototype.toString = function() {
|
365
|
+
return Array.isArray(this.nodes) ? stringify(this.nodes) : "";
|
366
|
+
};
|
367
|
+
ValueParser.prototype.walk = function(cb, bubble) {
|
368
|
+
walk(this.nodes, cb, bubble);
|
369
|
+
return this;
|
370
|
+
};
|
371
|
+
ValueParser.unit = require_unit();
|
372
|
+
ValueParser.walk = walk;
|
373
|
+
ValueParser.stringify = stringify;
|
374
|
+
module.exports = ValueParser;
|
375
|
+
} });
|
376
|
+
|
377
|
+
//#endregion
|
378
|
+
export { require_lib };
|