@voidzero-dev/vite-plus-core 0.3.0 → 0.3.2

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.
Files changed (69) hide show
  1. package/LICENSE +0 -29
  2. package/dist/rolldown/cli.mjs +6 -6
  3. package/dist/rolldown/config.d.mts +1 -1
  4. package/dist/rolldown/config.mjs +2 -2
  5. package/dist/rolldown/experimental-index.d.mts +38 -4
  6. package/dist/rolldown/experimental-index.mjs +35 -9
  7. package/dist/rolldown/experimental-runtime-types.d.ts +2 -2
  8. package/dist/rolldown/experimental-runtime.d.ts +2 -2
  9. package/dist/rolldown/experimental-runtime.mjs +2 -2
  10. package/dist/rolldown/filter-index.d.mts +1 -1
  11. package/dist/rolldown/filter-index.mjs +1 -3
  12. package/dist/rolldown/index.d.mts +3 -3
  13. package/dist/rolldown/index.mjs +4 -4
  14. package/dist/rolldown/parallel-plugin-worker.mjs +2 -2
  15. package/dist/rolldown/parallel-plugin.d.mts +1 -1
  16. package/dist/rolldown/parse-ast-index.d.mts +1 -1
  17. package/dist/rolldown/parse-ast-index.mjs +1 -1
  18. package/dist/rolldown/plugins-index.d.mts +3 -3
  19. package/dist/rolldown/plugins-index.mjs +2 -2
  20. package/dist/rolldown/shared/{binding-C__LJDBG.mjs → binding-DH95uVkp.mjs} +27 -27
  21. package/dist/rolldown/shared/{binding-Bvw14S3g.d.mts → binding-DZuNHVw4.d.mts} +19 -5
  22. package/dist/rolldown/shared/{bindingify-input-options-V9YvAjrr.mjs → bindingify-input-options-BL4xrXys.mjs} +11 -9
  23. package/dist/rolldown/shared/{constructors-CRumnw21.d.mts → constructors-BnIg8feC.d.mts} +2 -2
  24. package/dist/rolldown/shared/{constructors-DklcHr18.mjs → constructors-CrhQ-yy_.mjs} +1 -1
  25. package/dist/rolldown/shared/{create-bundler-option-DbV2ud0B.mjs → create-bundler-option-Dk9AZBn_.mjs} +72 -6
  26. package/dist/rolldown/shared/{define-config-DwTNhgWB.d.mts → define-config-DjHYbH6S.d.mts} +40 -3
  27. package/dist/rolldown/shared/{error-NcRuXAVN.mjs → error-CRNyaqoL.mjs} +1 -1
  28. package/dist/rolldown/shared/{load-config-Dd7jKGUy.mjs → load-config-CKqTUKwB.mjs} +1 -1
  29. package/dist/rolldown/shared/{normalize-string-or-regex-CFtim40S.mjs → normalize-string-or-regex-BgP6W4eD.mjs} +1 -1
  30. package/dist/rolldown/shared/{parse-rvxTD36n.mjs → parse-DYyNe0IU.mjs} +2 -2
  31. package/dist/rolldown/shared/{resolve-tsconfig-D2vSIIkR.mjs → resolve-tsconfig-jh43hFM_.mjs} +10 -6
  32. package/dist/rolldown/shared/{rolldown-Bblizyw1.mjs → rolldown-BpXK1q5_.mjs} +5 -4
  33. package/dist/rolldown/shared/{transform--WSMLt1x.d.mts → transform-CVse9_mH.d.mts} +8 -4
  34. package/dist/rolldown/shared/{watch-DPvOlccK.mjs → watch-Due6uYkS.mjs} +4 -4
  35. package/dist/rolldown/utils-index.d.mts +3 -3
  36. package/dist/rolldown/utils-index.mjs +5 -5
  37. package/dist/tsdown/{build-D_enfyvD-tOzhITac.js → build-JVmLFaZt-BN9yuB6k.js} +683 -682
  38. package/dist/tsdown/{debug-CKcBYQLP-By_AQqN8.js → debug-CpC4hV25-BeCITV83.js} +18 -14
  39. package/dist/tsdown/{detect-DGhJGEqb-LL52mV6u.js → detect-Bg-d8iUV-Cr_BRLVW.js} +10 -12
  40. package/dist/tsdown/{dist-BsS7BOcb.js → dist-ByW_jJfv.js} +1226 -893
  41. package/dist/tsdown/index-types.d.ts +239 -317
  42. package/dist/tsdown/index.js +4 -4
  43. package/dist/tsdown/internal-DTYQdXId.js +3 -0
  44. package/dist/tsdown/{main-Bcv7jU2b.js → main-bgV9NlwM.js} +24 -145
  45. package/dist/tsdown/{resolver-cwLsPb2o-Bb9SDBm6.js → resolver-DE0_sy8o-UMsN-SXx.js} +4 -4
  46. package/dist/tsdown/rolldown-runtime-B4iAMlE-.js +35 -0
  47. package/dist/tsdown/run.js +44 -8
  48. package/dist/tsdown/{src-JVSpR8xt.js → src-D5xv98Iu.js} +5 -5
  49. package/dist/tsdown/{target-Bab3CUeB-8PBzMh3p.js → target-DgdLrXba-DaJJ11xX.js} +78 -74
  50. package/dist/tsdown/{tsc-B8FD48Oc.js → tsc-BFDF_Im9.js} +26 -20
  51. package/dist/tsdown/tsdown-css.js +19 -11
  52. package/dist/tsdown/tsdown-exe.js +4 -4
  53. package/dist/vite/client/bundledDevClient.mjs +77 -42
  54. package/dist/vite/client/client.mjs +288 -260
  55. package/dist/vite/node/chunks/build.js +21 -21
  56. package/dist/vite/node/chunks/lib.js +2 -2
  57. package/dist/vite/node/chunks/node.js +32781 -32305
  58. package/dist/vite/node/chunks/postcss-import.js +10 -10
  59. package/dist/vite/node/cli.js +12 -8
  60. package/dist/vite/node/index.d.ts +1568 -1577
  61. package/dist/vite/node/index.js +1 -1
  62. package/dist/vite/node/module-runner.d.ts +1 -1
  63. package/dist/vite/node/module-runner.js +201 -202
  64. package/dist/vite/types/customEvent.d.ts +2 -0
  65. package/dist/vite/types/hmrPayload.d.ts +2 -0
  66. package/dist/vite/types/internal/cssPreprocessorOptions.d.ts +2 -2
  67. package/dist/vite/types/internal/devtoolsOptions.d.ts +9 -0
  68. package/package.json +28 -31
  69. package/dist/tsdown/internal-DSmmwu4u.js +0 -3
@@ -1,2 +1,2 @@
1
- import { $ as mergeConfig, A as createServer, B as ssrTransform, C as fetchModule, D as optimizeDeps, E as createBuilder, F as createIdResolver, G as resolveEnvPrefix, H as createServerModuleRunnerTransport, I as perEnvironmentState, J as createLogger, K as transformWithOxc, L as isFileLoadingAllowed, M as formatPostcssSourceMap, N as preprocessCSS, P as searchForWorkspaceRoot, Q as mergeAlias, R as isFileServingAllowed, S as DevEnvironment, T as build, U as buildErrorMessage, V as createServerModuleRunner, W as loadEnv, X as createFilter, Y as perEnvironmentPlugin, Z as isCSSRequest, _ as runnerImport, a as minifySync, at as DEFAULT_CLIENT_MAIN_FIELDS, b as createRunnableDevEnvironment, c as parseAstAsync, ct as DEFAULT_SERVER_MAIN_FIELDS, d as isFetchableDevEnvironment, dt as defaultAllowedOrigins, et as normalizePath, g as sortUserPlugins, h as resolveConfig, i as minify, it as DEFAULT_CLIENT_CONDITIONS, k as createServerHotChannel, l as parseSync, lt as VERSION, m as loadConfigFromFile, n as esbuildVersion, nt as rollupVersion, o as parse, ot as DEFAULT_EXTERNAL_CONDITIONS, p as defineConfig, q as transformWithEsbuild, r as esmExternalRequirePlugin, rt as withFilter, s as parseAst, st as DEFAULT_SERVER_CONDITIONS, t as Visitor, tt as rolldownVersion, u as createFetchableDevEnvironment, v as preview, w as BuildEnvironment, x as isRunnableDevEnvironment, z as send } from "./chunks/node.js";
1
+ import { $ as normalizePath, A as optimizeDeps, B as createServerModuleRunner, D as formatPostcssSourceMap, E as createBuilder, F as searchForWorkspaceRoot, G as perEnvironmentState, H as buildErrorMessage, I as isFileLoadingAllowed, J as perEnvironmentPlugin, K as loadEnv, L as isFileServingAllowed, M as createServerHotChannel, N as createServer, O as preprocessCSS, Q as mergeConfig, R as send, S as preview, T as build, U as transformWithOxc, V as createServerModuleRunnerTransport, W as transformWithEsbuild, X as isCSSRequest, Y as createFilter, Z as mergeAlias, _ as runnerImport, a as minifySync, at as DEFAULT_CLIENT_MAIN_FIELDS, b as DevEnvironment, c as parseAstAsync, ct as DEFAULT_SERVER_MAIN_FIELDS, d as isFetchableDevEnvironment, dt as defaultAllowedOrigins, et as rolldownVersion, g as sortUserPlugins, h as resolveConfig, i as minify, it as DEFAULT_CLIENT_CONDITIONS, k as createIdResolver, l as parseSync, lt as VERSION, m as loadConfigFromFile, n as esbuildVersion, nt as withFilter, o as parse, ot as DEFAULT_EXTERNAL_CONDITIONS, p as defineConfig, q as resolveEnvPrefix, r as esmExternalRequirePlugin, rt as createLogger, s as parseAst, st as DEFAULT_SERVER_CONDITIONS, t as Visitor, tt as rollupVersion, u as createFetchableDevEnvironment, v as createRunnableDevEnvironment, w as BuildEnvironment, x as fetchModule, y as isRunnableDevEnvironment, z as ssrTransform } from "./chunks/node.js";
2
2
  export { BuildEnvironment, DevEnvironment, Visitor, build, buildErrorMessage, createBuilder, createFetchableDevEnvironment, createFilter, createIdResolver, createLogger, createRunnableDevEnvironment, createServer, createServerHotChannel, createServerModuleRunner, createServerModuleRunnerTransport, defaultAllowedOrigins, DEFAULT_CLIENT_CONDITIONS as defaultClientConditions, DEFAULT_CLIENT_MAIN_FIELDS as defaultClientMainFields, DEFAULT_EXTERNAL_CONDITIONS as defaultExternalConditions, DEFAULT_SERVER_CONDITIONS as defaultServerConditions, DEFAULT_SERVER_MAIN_FIELDS as defaultServerMainFields, defineConfig, esbuildVersion, esmExternalRequirePlugin, fetchModule, formatPostcssSourceMap, isCSSRequest, isFetchableDevEnvironment, isFileLoadingAllowed, isFileServingAllowed, isRunnableDevEnvironment, loadConfigFromFile, loadEnv, mergeAlias, mergeConfig, minify, minifySync, ssrTransform as moduleRunnerTransform, normalizePath, optimizeDeps, parse, parseAst, parseAstAsync, parseSync, perEnvironmentPlugin, perEnvironmentState, preprocessCSS, preview, resolveConfig, resolveEnvPrefix, rolldownVersion, rollupVersion, runnerImport, searchForWorkspaceRoot, send, sortUserPlugins, transformWithEsbuild, transformWithOxc, VERSION as version, withFilter };
@@ -1,7 +1,7 @@
1
1
  import { a as ExternalFetchResult, c as ViteFetchResult, i as createWebSocketModuleRunnerTransport, n as ModuleRunnerTransportHandlers, o as FetchFunctionOptions, r as NormalizedModuleRunnerTransport, s as FetchResult, t as ModuleRunnerTransport } from "./chunks/moduleRunnerTransport.js";
2
2
  import { ModuleNamespace, ViteHotContext } from "#types/hot";
3
- import { HotPayload, Update } from "#types/hmrPayload";
4
3
  import { InferCustomEventPayload } from "#types/customEvent";
4
+ import { HotPayload, Update } from "#types/hmrPayload";
5
5
  //#region src/module-runner/sourcemap/decoder.d.ts
6
6
  interface SourceMapLike {
7
7
  version: number;
@@ -40,86 +40,21 @@ function promiseWithResolvers() {
40
40
  };
41
41
  }
42
42
  //#endregion
43
- //#region ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
44
- const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
45
- function normalizeWindowsPath(input = "") {
46
- return input && input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
47
- }
48
- const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/, _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
49
- function cwd() {
50
- return typeof process < "u" && typeof process.cwd == "function" ? process.cwd().replace(/\\/g, "/") : "/";
51
- }
52
- const resolve = function(...arguments_) {
53
- arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
54
- let resolvedPath = "", resolvedAbsolute = !1;
55
- for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
56
- let path = index >= 0 ? arguments_[index] : cwd();
57
- !path || path.length === 0 || (resolvedPath = `${path}/${resolvedPath}`, resolvedAbsolute = isAbsolute(path));
58
- }
59
- return resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute), resolvedAbsolute && !isAbsolute(resolvedPath) ? `/${resolvedPath}` : resolvedPath.length > 0 ? resolvedPath : ".";
60
- };
61
- function normalizeString(path, allowAboveRoot) {
62
- let res = "", lastSegmentLength = 0, lastSlash = -1, dots = 0, char = null;
63
- for (let index = 0; index <= path.length; ++index) {
64
- if (index < path.length) char = path[index];
65
- else if (char === "/") break;
66
- else char = "/";
67
- if (char === "/") {
68
- if (lastSlash !== index - 1 && dots !== 1) {
69
- if (dots === 2) {
70
- if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
71
- if (res.length > 2) {
72
- let lastSlashIndex = res.lastIndexOf("/");
73
- lastSlashIndex === -1 ? (res = "", lastSegmentLength = 0) : (res = res.slice(0, lastSlashIndex), lastSegmentLength = res.length - 1 - res.lastIndexOf("/")), lastSlash = index, dots = 0;
74
- continue;
75
- }
76
- if (res.length > 0) {
77
- res = "", lastSegmentLength = 0, lastSlash = index, dots = 0;
78
- continue;
79
- }
80
- }
81
- allowAboveRoot && (res += res.length > 0 ? "/.." : "..", lastSegmentLength = 2);
82
- } else res.length > 0 ? res += `/${path.slice(lastSlash + 1, index)}` : res = path.slice(lastSlash + 1, index), lastSegmentLength = index - lastSlash - 1;
83
- }
84
- lastSlash = index, dots = 0;
85
- } else char === "." && dots !== -1 ? ++dots : dots = -1;
86
- }
87
- return res;
88
- }
89
- const isAbsolute = function(p) {
90
- return _IS_ABSOLUTE_RE.test(p);
91
- }, dirname = function(p) {
92
- let segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
93
- return segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0]) && (segments[0] += "/"), segments.join("/") || (isAbsolute(p) ? "/" : ".");
94
- }, textDecoder = new TextDecoder(), decodeBase64 = (() => {
95
- let capturedBuffer = typeof Buffer == "function" ? Buffer : void 0;
96
- return capturedBuffer && typeof capturedBuffer.from == "function" ? (base64) => capturedBuffer.from(base64, "base64").toString("utf-8") : (base64) => textDecoder.decode(Uint8Array.from(atob(base64), (c) => c.charCodeAt(0)));
97
- })(), percentRegEx = /%/g, backslashRegEx = /\\/g, newlineRegEx = /\n/g, carriageReturnRegEx = /\r/g, tabRegEx = /\t/g, questionRegex = /\?/g, hashRegex = /#/g;
98
- function encodePathChars(filepath) {
99
- return filepath.includes("%") && (filepath = filepath.replace(percentRegEx, "%25")), !isWindows && filepath.includes("\\") && (filepath = filepath.replace(backslashRegEx, "%5C")), filepath.includes("\n") && (filepath = filepath.replace(newlineRegEx, "%0A")), filepath.includes("\r") && (filepath = filepath.replace(carriageReturnRegEx, "%0D")), filepath.includes(" ") && (filepath = filepath.replace(tabRegEx, "%09")), filepath;
100
- }
101
- const posixDirname = dirname, posixResolve = resolve;
102
- function posixPathToFileHref(posixPath) {
103
- let resolved = posixResolve(posixPath), filePathLast = posixPath.charCodeAt(posixPath.length - 1);
104
- return (filePathLast === 47 || isWindows && filePathLast === 92) && resolved[resolved.length - 1] !== "/" && (resolved += "/"), resolved = encodePathChars(resolved), resolved.includes("?") && (resolved = resolved.replace(questionRegex, "%3F")), resolved.includes("#") && (resolved = resolved.replace(hashRegex, "%23")), new URL(`file://${resolved}`).href;
105
- }
106
- function toWindowsPath(path) {
107
- return path.replace(/\//g, "\\");
108
- }
109
- //#endregion
110
- //#region ../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
43
+ //#region ../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.6.0/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
111
44
  var comma = 44, chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", intToChar = /* @__PURE__ */ new Uint8Array(64), charToInt = /* @__PURE__ */ new Uint8Array(128);
112
45
  for (let i = 0; i < chars.length; i++) {
113
46
  let c = chars.charCodeAt(i);
114
47
  intToChar[i] = c, charToInt[c] = i;
115
48
  }
116
- function decodeInteger(reader, relative) {
49
+ function decodeInteger(reader) {
117
50
  let value = 0, shift = 0, integer = 0;
118
51
  do
119
52
  integer = charToInt[reader.next()], value |= (integer & 31) << shift, shift += 5;
120
53
  while (integer & 32);
121
- let shouldNegate = value & 1;
122
- return value >>>= 1, shouldNegate && (value = -2147483648 | -value), relative + value;
54
+ return value;
55
+ }
56
+ function decodeSign(num) {
57
+ return num & 1 ? -2147483648 | -(num >>> 1) : num >>> 1;
123
58
  }
124
59
  function hasMoreVlq(reader, max) {
125
60
  return reader.pos >= max ? !1 : reader.peek() !== comma;
@@ -145,7 +80,7 @@ function decode(mappings) {
145
80
  let semi = reader.indexOf(";"), line = [], sorted = !0, lastCol = 0;
146
81
  for (genColumn = 0; reader.pos < semi;) {
147
82
  let seg;
148
- genColumn = decodeInteger(reader, genColumn), genColumn < lastCol && (sorted = !1), lastCol = genColumn, hasMoreVlq(reader, semi) ? (sourcesIndex = decodeInteger(reader, sourcesIndex), sourceLine = decodeInteger(reader, sourceLine), sourceColumn = decodeInteger(reader, sourceColumn), hasMoreVlq(reader, semi) ? (namesIndex = decodeInteger(reader, namesIndex), seg = [
83
+ genColumn += decodeSign(decodeInteger(reader)), genColumn < lastCol && (sorted = !1), lastCol = genColumn, hasMoreVlq(reader, semi) ? (sourcesIndex += decodeSign(decodeInteger(reader)), sourceLine += decodeSign(decodeInteger(reader)), sourceColumn += decodeSign(decodeInteger(reader)), hasMoreVlq(reader, semi) ? (namesIndex += decodeSign(decodeInteger(reader)), seg = [
149
84
  genColumn,
150
85
  sourcesIndex,
151
86
  sourceLine,
@@ -229,6 +164,73 @@ function traceSegmentInternal(segments, memo, line, column, bias) {
229
164
  return found ? index = (bias === -1 ? upperBound : lowerBound)(segments, column, index) : bias === -1 && index++, index === -1 || index === segments.length ? -1 : index;
230
165
  }
231
166
  //#endregion
167
+ //#region ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
168
+ const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
169
+ function normalizeWindowsPath(input = "") {
170
+ return input && input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
171
+ }
172
+ const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/, _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
173
+ function cwd() {
174
+ return typeof process < "u" && typeof process.cwd == "function" ? process.cwd().replace(/\\/g, "/") : "/";
175
+ }
176
+ const resolve = function(...arguments_) {
177
+ arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
178
+ let resolvedPath = "", resolvedAbsolute = !1;
179
+ for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
180
+ let path = index >= 0 ? arguments_[index] : cwd();
181
+ path && path.length !== 0 && (resolvedPath = `${path}/${resolvedPath}`, resolvedAbsolute = isAbsolute(path));
182
+ }
183
+ return resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute), resolvedAbsolute && !isAbsolute(resolvedPath) ? `/${resolvedPath}` : resolvedPath.length > 0 ? resolvedPath : ".";
184
+ };
185
+ function normalizeString(path, allowAboveRoot) {
186
+ let res = "", lastSegmentLength = 0, lastSlash = -1, dots = 0, char = null;
187
+ for (let index = 0; index <= path.length; ++index) {
188
+ if (index < path.length) char = path[index];
189
+ else if (char === "/") break;
190
+ else char = "/";
191
+ if (char === "/") {
192
+ if (lastSlash !== index - 1 && dots !== 1) {
193
+ if (dots === 2) {
194
+ if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
195
+ if (res.length > 2) {
196
+ let lastSlashIndex = res.lastIndexOf("/");
197
+ lastSlashIndex === -1 ? (res = "", lastSegmentLength = 0) : (res = res.slice(0, lastSlashIndex), lastSegmentLength = res.length - 1 - res.lastIndexOf("/")), lastSlash = index, dots = 0;
198
+ continue;
199
+ }
200
+ if (res.length > 0) {
201
+ res = "", lastSegmentLength = 0, lastSlash = index, dots = 0;
202
+ continue;
203
+ }
204
+ }
205
+ allowAboveRoot && (res += res.length > 0 ? "/.." : "..", lastSegmentLength = 2);
206
+ } else res.length > 0 ? res += `/${path.slice(lastSlash + 1, index)}` : res = path.slice(lastSlash + 1, index), lastSegmentLength = index - lastSlash - 1;
207
+ }
208
+ lastSlash = index, dots = 0;
209
+ } else char === "." && dots !== -1 ? ++dots : dots = -1;
210
+ }
211
+ return res;
212
+ }
213
+ const isAbsolute = function(p) {
214
+ return _IS_ABSOLUTE_RE.test(p);
215
+ }, dirname = function(p) {
216
+ let segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
217
+ return segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0]) && (segments[0] += "/"), segments.join("/") || (isAbsolute(p) ? "/" : ".");
218
+ }, textDecoder = new TextDecoder(), decodeBase64 = (() => {
219
+ let capturedBuffer = typeof Buffer == "function" ? Buffer : void 0;
220
+ return capturedBuffer && typeof capturedBuffer.from == "function" ? (base64) => capturedBuffer.from(base64, "base64").toString("utf-8") : (base64) => textDecoder.decode(Uint8Array.from(atob(base64), (c) => c.charCodeAt(0)));
221
+ })(), percentRegEx = /%/g, backslashRegEx = /\\/g, newlineRegEx = /\n/g, carriageReturnRegEx = /\r/g, tabRegEx = /\t/g, questionRegex = /\?/g, hashRegex = /#/g;
222
+ function encodePathChars(filepath) {
223
+ return filepath.includes("%") && (filepath = filepath.replace(percentRegEx, "%25")), !isWindows && filepath.includes("\\") && (filepath = filepath.replace(backslashRegEx, "%5C")), filepath.includes("\n") && (filepath = filepath.replace(newlineRegEx, "%0A")), filepath.includes("\r") && (filepath = filepath.replace(carriageReturnRegEx, "%0D")), filepath.includes(" ") && (filepath = filepath.replace(tabRegEx, "%09")), filepath;
224
+ }
225
+ const posixDirname = dirname, posixResolve = resolve;
226
+ function posixPathToFileHref(posixPath) {
227
+ let resolved = posixResolve(posixPath), filePathLast = posixPath.charCodeAt(posixPath.length - 1);
228
+ return (filePathLast === 47 || isWindows && filePathLast === 92) && resolved.at(-1) !== "/" && (resolved += "/"), resolved = encodePathChars(resolved), resolved.includes("?") && (resolved = resolved.replace(questionRegex, "%3F")), resolved.includes("#") && (resolved = resolved.replace(hashRegex, "%23")), new URL(`file://${resolved}`).href;
229
+ }
230
+ function toWindowsPath(path) {
231
+ return path.replace(/\//g, "\\");
232
+ }
233
+ //#endregion
232
234
  //#region ../../vite/packages/vite/src/module-runner/sourcemap/decoder.ts
233
235
  var DecodedMap = class {
234
236
  map;
@@ -356,6 +358,12 @@ function normalizeModuleId(file) {
356
358
  return prefixedBuiltins.has(file) ? file : slash(file).replace(/^\/@fs\//, isWindows ? "" : "/").replace(/^node:/, "").replace(/^\/+/, "/").replace(/^file:\/+/, isWindows ? "" : "/");
357
359
  }
358
360
  //#endregion
361
+ //#region ../../vite/packages/vite/src/shared/builtin.ts
362
+ function createIsBuiltin(builtins) {
363
+ let plainBuiltinsSet = new Set(builtins.filter((builtin) => typeof builtin == "string")), regexBuiltins = builtins.filter((builtin) => typeof builtin != "string");
364
+ return (id) => plainBuiltinsSet.has(id) || regexBuiltins.some((regexp) => regexp.test(id));
365
+ }
366
+ //#endregion
359
367
  //#region ../../vite/packages/vite/src/shared/hmr.ts
360
368
  var HMRContext = class {
361
369
  hmrClient;
@@ -522,28 +530,6 @@ var HMRContext = class {
522
530
  }
523
531
  };
524
532
  //#endregion
525
- //#region ../../vite/packages/vite/src/shared/ssrTransform.ts
526
- /**
527
- * Vite converts `import { } from 'foo'` to `const _ = __vite_ssr_import__('foo')`.
528
- * Top-level imports and dynamic imports work slightly differently in Node.js.
529
- * This function normalizes the differences so it matches prod behaviour.
530
- */
531
- function analyzeImportedModDifference(mod, rawId, moduleType, metadata) {
532
- if (!metadata?.isDynamicImport && metadata?.importedNames?.length) {
533
- let missingBindings = metadata.importedNames.filter((s) => !(s in mod));
534
- if (missingBindings.length) {
535
- let lastBinding = missingBindings[missingBindings.length - 1];
536
- throw SyntaxError(moduleType === "module" ? `[vite] The requested module '${rawId}' does not provide an export named '${lastBinding}'` : `\
537
- [vite] Named export '${lastBinding}' not found. The requested module '${rawId}' is a CommonJS module, which may not support all module.exports as named exports.
538
- CommonJS modules can always be imported via the default export, for example using:
539
-
540
- import pkg from '${rawId}';
541
- const {${missingBindings.join(", ")}} = pkg;
542
- `);
543
- }
544
- }
545
- }
546
- //#endregion
547
533
  //#region ../../node_modules/.pnpm/nanoid@5.1.16/node_modules/nanoid/non-secure/index.js
548
534
  let nanoid = (size = 21) => {
549
535
  let id = "", i = size | 0;
@@ -715,19 +701,118 @@ const createWebSocketModuleRunnerTransport = (options) => {
715
701
  };
716
702
  };
717
703
  //#endregion
718
- //#region ../../vite/packages/vite/src/shared/builtin.ts
719
- function createIsBuiltin(builtins) {
720
- let plainBuiltinsSet = new Set(builtins.filter((builtin) => typeof builtin == "string")), regexBuiltins = builtins.filter((builtin) => typeof builtin != "string");
721
- return (id) => plainBuiltinsSet.has(id) || regexBuiltins.some((regexp) => regexp.test(id));
704
+ //#region ../../vite/packages/vite/src/shared/ssrTransform.ts
705
+ /**
706
+ * Vite converts `import { } from 'foo'` to `const _ = __vite_ssr_import__('foo')`.
707
+ * Top-level imports and dynamic imports work slightly differently in Node.js.
708
+ * This function normalizes the differences so it matches prod behaviour.
709
+ */
710
+ function analyzeImportedModDifference(mod, rawId, moduleType, metadata) {
711
+ if (!metadata?.isDynamicImport && metadata?.importedNames?.length) {
712
+ let missingBindings = metadata.importedNames.filter((s) => !(s in mod));
713
+ if (missingBindings.length) {
714
+ let lastBinding = missingBindings.at(-1);
715
+ throw SyntaxError(moduleType === "module" ? `[vite] The requested module '${rawId}' does not provide an export named '${lastBinding}'` : `\
716
+ [vite] Named export '${lastBinding}' not found. The requested module '${rawId}' is a CommonJS module, which may not support all module.exports as named exports.
717
+ CommonJS modules can always be imported via the default export, for example using:
718
+
719
+ import pkg from '${rawId}';
720
+ const {${missingBindings.join(", ")}} = pkg;
721
+ `);
722
+ }
723
+ }
722
724
  }
723
725
  //#endregion
724
726
  //#region ../../vite/packages/vite/src/module-runner/constants.ts
725
- const ssrModuleExportsKey = "__vite_ssr_exports__", ssrImportKey = "__vite_ssr_import__", ssrDynamicImportKey = "__vite_ssr_dynamic_import__", ssrExportAllKey = "__vite_ssr_exportAll__", ssrExportNameKey = "__vite_ssr_exportName__", ssrImportMetaKey = "__vite_ssr_import_meta__", noop = () => {}, silentConsole = {
726
- debug: noop,
727
- error: noop
728
- }, hmrLogger = {
729
- debug: (...msg) => console.log("[vite]", ...msg),
730
- error: (error) => console.log("[vite]", error)
727
+ const ssrModuleExportsKey = "__vite_ssr_exports__", ssrImportKey = "__vite_ssr_import__", ssrDynamicImportKey = "__vite_ssr_dynamic_import__", ssrExportAllKey = "__vite_ssr_exportAll__", ssrExportNameKey = "__vite_ssr_exportName__", ssrImportMetaKey = "__vite_ssr_import_meta__", customizationHookNamespace = "vite-module-runner:import-meta-resolve/v1/", customizationHooksModule = `
728
+
729
+ export async function resolve(specifier, context, nextResolve) {
730
+ if (specifier.startsWith(${JSON.stringify(customizationHookNamespace)})) {
731
+ const data = specifier.slice(${JSON.stringify(customizationHookNamespace)}.length)
732
+ const [parsedSpecifier, parsedImporter] = JSON.parse(data)
733
+ specifier = parsedSpecifier
734
+ context.parentURL = parsedImporter
735
+ }
736
+ return nextResolve(specifier, context)
737
+ }
738
+
739
+ `;
740
+ function customizationHookResolve(specifier, context, nextResolve) {
741
+ if (specifier.startsWith(customizationHookNamespace)) {
742
+ let data = specifier.slice(42), [parsedSpecifier, parsedImporter] = JSON.parse(data);
743
+ specifier = parsedSpecifier, context.parentURL = parsedImporter;
744
+ }
745
+ return nextResolve(specifier, context);
746
+ }
747
+ let isHookRegistered = !1;
748
+ function createImportMetaResolver() {
749
+ if (isHookRegistered) return importMetaResolveWithCustomHook;
750
+ let module;
751
+ try {
752
+ module = typeof process < "u" ? process.getBuiltinModule("node:module").Module : void 0;
753
+ } catch {
754
+ return;
755
+ }
756
+ if (module) {
757
+ if (module.registerHooks) return module.registerHooks({ resolve: customizationHookResolve }), isHookRegistered = !0, importMetaResolveWithCustomHook;
758
+ if (module.register) {
759
+ try {
760
+ let hookModuleContent = `data:text/javascript,${encodeURI(customizationHooksModule)}`;
761
+ module.register(hookModuleContent);
762
+ } catch (e) {
763
+ if ("code" in e && e.code === "ERR_NETWORK_IMPORT_DISALLOWED") return;
764
+ throw e;
765
+ }
766
+ return isHookRegistered = !0, importMetaResolveWithCustomHook;
767
+ }
768
+ }
769
+ }
770
+ function importMetaResolveWithCustomHook(specifier, importer) {
771
+ return import.meta.resolve(`${customizationHookNamespace}${JSON.stringify([specifier, importer])}`);
772
+ }
773
+ //#endregion
774
+ //#region ../../vite/packages/vite/src/module-runner/createImportMeta.ts
775
+ const envProxy = new Proxy({}, { get(_, p) {
776
+ throw Error(`[module runner] Dynamic access of "import.meta.env" is not supported. Please, use "import.meta.env.${String(p)}" instead.`);
777
+ } });
778
+ function createDefaultImportMeta(modulePath) {
779
+ let href = posixPathToFileHref(modulePath), filename = modulePath, dirname = posixDirname(modulePath);
780
+ return {
781
+ filename: isWindows ? toWindowsPath(filename) : filename,
782
+ dirname: isWindows ? toWindowsPath(dirname) : dirname,
783
+ url: href,
784
+ env: envProxy,
785
+ resolve(_id, _parent) {
786
+ throw Error("[module runner] \"import.meta.resolve\" is not supported.");
787
+ },
788
+ glob() {
789
+ throw Error("[module runner] \"import.meta.glob\" is statically replaced during file transformation. Make sure to reference it by the full name.");
790
+ }
791
+ };
792
+ }
793
+ /**
794
+ * Create import.meta object for Node.js.
795
+ */
796
+ function createNodeImportMeta(modulePath) {
797
+ let defaultMeta = createDefaultImportMeta(modulePath), href = defaultMeta.url, importMetaResolver = createImportMetaResolver();
798
+ return {
799
+ ...defaultMeta,
800
+ main: !1,
801
+ resolve(id, parent) {
802
+ return (importMetaResolver ?? defaultMeta.resolve)(id, parent ?? href);
803
+ }
804
+ };
805
+ }
806
+ //#endregion
807
+ //#region ../../vite/packages/vite/src/module-runner/esmEvaluator.ts
808
+ var ESModulesEvaluator = class {
809
+ startOffset = getAsyncFunctionDeclarationPaddingLineCount() + 1;
810
+ async runInlinedModule(context, code) {
811
+ await new AsyncFunction(ssrModuleExportsKey, ssrImportMetaKey, ssrImportKey, ssrDynamicImportKey, ssrExportAllKey, ssrExportNameKey, "\"use strict\";\n" + code)(context[ssrModuleExportsKey], context[ssrImportMetaKey], context[ssrImportKey], context[ssrDynamicImportKey], context[ssrExportAllKey], context[ssrExportNameKey]), Object.seal(context[ssrModuleExportsKey]);
812
+ }
813
+ runExternalModule(filepath) {
814
+ return import(filepath);
815
+ }
731
816
  };
732
817
  //#endregion
733
818
  //#region ../../vite/packages/vite/src/shared/hmrHandler.ts
@@ -760,13 +845,13 @@ var Queue = class {
760
845
  function createHMRHandlerForRunner(runner) {
761
846
  return createHMRHandler(async (payload) => {
762
847
  let hmrClient = runner.hmrClient;
763
- if (!(!hmrClient || runner.isClosed())) switch (payload.type) {
848
+ if (hmrClient && !runner.isClosed()) switch (payload.type) {
764
849
  case "connected":
765
850
  hmrClient.logger.debug("connected.");
766
851
  break;
767
852
  case "update":
768
853
  await hmrClient.notifyListeners("vite:beforeUpdate", payload), await Promise.all(payload.updates.map(async (update) => {
769
- if (update.type === "js-update") return update.acceptedPath = unwrapId(update.acceptedPath), update.path = unwrapId(update.path), hmrClient.queueUpdate(update);
854
+ if (update.type === "js-update") return hmrClient.queueUpdate(update);
770
855
  hmrClient.logger.error("css hmr is not supported in runner mode.");
771
856
  })), await hmrClient.notifyListeners("vite:afterUpdate", payload);
772
857
  break;
@@ -827,8 +912,14 @@ function findAllEntrypoints(runner, entrypoints = /* @__PURE__ */ new Set()) {
827
912
  return entrypoints;
828
913
  }
829
914
  //#endregion
830
- //#region ../../vite/packages/vite/src/module-runner/sourcemap/interceptor.ts
831
- const sourceMapCache = {}, fileContentsCache = {}, evaluatedModulesCache = /* @__PURE__ */ new Set(), retrieveFileHandlers = /* @__PURE__ */ new Set(), retrieveSourceMapHandlers = /* @__PURE__ */ new Set(), createExecHandlers = (handlers) => ((...args) => {
915
+ //#region ../../vite/packages/vite/src/module-runner/hmrLogger.ts
916
+ const noop = () => {}, silentConsole = {
917
+ debug: noop,
918
+ error: noop
919
+ }, hmrLogger = {
920
+ debug: (...msg) => console.log("[vite]", ...msg),
921
+ error: (error) => console.log("[vite]", error)
922
+ }, sourceMapCache = {}, fileContentsCache = {}, evaluatedModulesCache = /* @__PURE__ */ new Set(), retrieveFileHandlers = /* @__PURE__ */ new Set(), retrieveSourceMapHandlers = /* @__PURE__ */ new Set(), createExecHandlers = (handlers) => ((...args) => {
832
923
  for (let handler of handlers) {
833
924
  let result = handler(...args);
834
925
  if (result) return result;
@@ -1014,98 +1105,6 @@ function enableSourceMapSupport(runner) {
1014
1105
  return interceptStackTrace(runner, typeof runner.options.sourcemapInterceptor == "object" ? runner.options.sourcemapInterceptor : void 0);
1015
1106
  }
1016
1107
  //#endregion
1017
- //#region ../../vite/packages/vite/src/module-runner/esmEvaluator.ts
1018
- var ESModulesEvaluator = class {
1019
- startOffset = getAsyncFunctionDeclarationPaddingLineCount() + 1;
1020
- async runInlinedModule(context, code) {
1021
- await new AsyncFunction(ssrModuleExportsKey, ssrImportMetaKey, ssrImportKey, ssrDynamicImportKey, ssrExportAllKey, ssrExportNameKey, "\"use strict\";\n" + code)(context[ssrModuleExportsKey], context[ssrImportMetaKey], context[ssrImportKey], context[ssrDynamicImportKey], context[ssrExportAllKey], context[ssrExportNameKey]), Object.seal(context[ssrModuleExportsKey]);
1022
- }
1023
- runExternalModule(filepath) {
1024
- return import(filepath);
1025
- }
1026
- };
1027
- //#endregion
1028
- //#region ../../vite/packages/vite/src/module-runner/importMetaResolver.ts
1029
- const customizationHookNamespace = "vite-module-runner:import-meta-resolve/v1/", customizationHooksModule = `
1030
-
1031
- export async function resolve(specifier, context, nextResolve) {
1032
- if (specifier.startsWith(${JSON.stringify(customizationHookNamespace)})) {
1033
- const data = specifier.slice(${JSON.stringify(customizationHookNamespace)}.length)
1034
- const [parsedSpecifier, parsedImporter] = JSON.parse(data)
1035
- specifier = parsedSpecifier
1036
- context.parentURL = parsedImporter
1037
- }
1038
- return nextResolve(specifier, context)
1039
- }
1040
-
1041
- `;
1042
- function customizationHookResolve(specifier, context, nextResolve) {
1043
- if (specifier.startsWith(customizationHookNamespace)) {
1044
- let data = specifier.slice(42), [parsedSpecifier, parsedImporter] = JSON.parse(data);
1045
- specifier = parsedSpecifier, context.parentURL = parsedImporter;
1046
- }
1047
- return nextResolve(specifier, context);
1048
- }
1049
- let isHookRegistered = !1;
1050
- function createImportMetaResolver() {
1051
- if (isHookRegistered) return importMetaResolveWithCustomHook;
1052
- let module;
1053
- try {
1054
- module = typeof process < "u" ? process.getBuiltinModule("node:module").Module : void 0;
1055
- } catch {
1056
- return;
1057
- }
1058
- if (module) {
1059
- if (module.registerHooks) return module.registerHooks({ resolve: customizationHookResolve }), isHookRegistered = !0, importMetaResolveWithCustomHook;
1060
- if (module.register) {
1061
- try {
1062
- let hookModuleContent = `data:text/javascript,${encodeURI(customizationHooksModule)}`;
1063
- module.register(hookModuleContent);
1064
- } catch (e) {
1065
- if ("code" in e && e.code === "ERR_NETWORK_IMPORT_DISALLOWED") return;
1066
- throw e;
1067
- }
1068
- return isHookRegistered = !0, importMetaResolveWithCustomHook;
1069
- }
1070
- }
1071
- }
1072
- function importMetaResolveWithCustomHook(specifier, importer) {
1073
- return import.meta.resolve(`${customizationHookNamespace}${JSON.stringify([specifier, importer])}`);
1074
- }
1075
- //#endregion
1076
- //#region ../../vite/packages/vite/src/module-runner/createImportMeta.ts
1077
- const envProxy = new Proxy({}, { get(_, p) {
1078
- throw Error(`[module runner] Dynamic access of "import.meta.env" is not supported. Please, use "import.meta.env.${String(p)}" instead.`);
1079
- } });
1080
- function createDefaultImportMeta(modulePath) {
1081
- let href = posixPathToFileHref(modulePath), filename = modulePath, dirname = posixDirname(modulePath);
1082
- return {
1083
- filename: isWindows ? toWindowsPath(filename) : filename,
1084
- dirname: isWindows ? toWindowsPath(dirname) : dirname,
1085
- url: href,
1086
- env: envProxy,
1087
- resolve(_id, _parent) {
1088
- throw Error("[module runner] \"import.meta.resolve\" is not supported.");
1089
- },
1090
- glob() {
1091
- throw Error("[module runner] \"import.meta.glob\" is statically replaced during file transformation. Make sure to reference it by the full name.");
1092
- }
1093
- };
1094
- }
1095
- /**
1096
- * Create import.meta object for Node.js.
1097
- */
1098
- function createNodeImportMeta(modulePath) {
1099
- let defaultMeta = createDefaultImportMeta(modulePath), href = defaultMeta.url, importMetaResolver = createImportMetaResolver();
1100
- return {
1101
- ...defaultMeta,
1102
- main: !1,
1103
- resolve(id, parent) {
1104
- return (importMetaResolver ?? defaultMeta.resolve)(id, parent ?? href);
1105
- }
1106
- };
1107
- }
1108
- //#endregion
1109
1108
  //#region ../../vite/packages/vite/src/module-runner/runner.ts
1110
1109
  var ModuleRunner = class {
1111
1110
  options;
@@ -1163,12 +1162,12 @@ var ModuleRunner = class {
1163
1162
  visited.add(mod.id);
1164
1163
  for (let importedModuleId of mod.imports) {
1165
1164
  let importedModule = this.evaluatedModules.getModuleById(importedModuleId);
1166
- if (!(!importedModule?.promise || importedModule.evaluated) && (callstack.includes(importedModuleId) || this.isCircularRequest(importedModule, callstack, visited))) return !0;
1165
+ if (importedModule?.promise && !importedModule.evaluated && (callstack.includes(importedModuleId) || this.isCircularRequest(importedModule, callstack, visited))) return !0;
1167
1166
  }
1168
1167
  return !1;
1169
1168
  }
1170
1169
  async cachedRequest(url, mod, callstack = [], metadata) {
1171
- let meta = mod.meta, moduleId = meta.id, importee = callstack[callstack.length - 1];
1170
+ let meta = mod.meta, moduleId = meta.id, importee = callstack.at(-1);
1172
1171
  if (importee && mod.importers.add(importee), mod.evaluated && mod.promise) return this.processImport(await mod.promise, meta, metadata);
1173
1172
  if (mod.promise) return mod.exports && (callstack.includes(moduleId) || this.isCircularRequest(mod, callstack)) ? this.processImport(mod.exports, meta, metadata) : this.processImport(await mod.promise, meta, metadata);
1174
1173
  let debugTimer;
@@ -39,8 +39,10 @@ export interface WebSocketConnectionPayload {
39
39
  }
40
40
 
41
41
  export interface InvalidatePayload {
42
+ /** Module URL of the invalidated module */
42
43
  path: string
43
44
  message: string | undefined
45
+ /** Module URL of the first module that invalidated the update */
44
46
  firstInvalidatedBy: string
45
47
  }
46
48
 
@@ -38,7 +38,9 @@ export interface BundledDevUpdatePayload {
38
38
 
39
39
  export interface Update {
40
40
  type: 'js-update' | 'css-update'
41
+ /** Module URL of the HMR boundary */
41
42
  path: string
43
+ /** Module URL of the accepted module */
42
44
  acceptedPath: string
43
45
  timestamp: number
44
46
  /** @internal */
@@ -1,11 +1,11 @@
1
1
  /* eslint-disable @typescript-eslint/ban-ts-comment */
2
2
 
3
+ // @ts-ignore `less` may not be installed
4
+ import type Less from 'less'
3
5
  // @ts-ignore `sass` may not be installed
4
6
  import type DartSass from 'sass'
5
7
  // @ts-ignore `sass-embedded` may not be installed
6
8
  import type SassEmbedded from 'sass-embedded'
7
- // @ts-ignore `less` may not be installed
8
- import type Less from 'less'
9
9
  // @ts-ignore `stylus` may not be installed
10
10
  import type Stylus from 'stylus'
11
11
 
@@ -0,0 +1,9 @@
1
+ /* eslint-disable @typescript-eslint/ban-ts-comment */
2
+
3
+ // @ts-ignore `@vitejs/devtools` may not be installed
4
+ import type * as DevToolsConfig from '@vitejs/devtools/config'
5
+
6
+ /* eslint-enable @typescript-eslint/ban-ts-comment */
7
+
8
+ export type DevToolsConfig = DevToolsConfig.DevToolsConfig
9
+ export type ResolvedDevToolsConfig = DevToolsConfig.ResolvedDevToolsConfig