|
| 1 | +diff --git a/node_modules/vite/dist/node/chunks/logger.js b/node_modules/vite/dist/node/chunks/logger.js |
| 2 | +index bcaf830..8f10b1b 100644 |
| 3 | +--- a/node_modules/vite/dist/node/chunks/logger.js |
| 4 | ++++ b/node_modules/vite/dist/node/chunks/logger.js |
| 5 | +@@ -195,6 +195,7 @@ const SPECIAL_QUERY_RE = /[?&](?:worker|sharedworker|raw|url)\b/; |
| 6 | + * Prefix for resolved fs paths, since windows paths may not be valid as URLs. |
| 7 | + */ |
| 8 | + const FS_PREFIX = `/@fs/`; |
| 9 | ++const FS_RAW_PREFIX = `/@fs-raw/` |
| 10 | + const CLIENT_PUBLIC_PATH = `/@vite/client`; |
| 11 | + const ENV_PUBLIC_PATH = `/@vite/env`; |
| 12 | + const VITE_PACKAGE_DIR = resolve(fileURLToPath(new URL("../../../src/node/constants.ts", import.meta.url)), "../../.."); |
| 13 | +@@ -354,4 +355,4 @@ function printServerUrls(urls, optionsHost, info) { |
| 14 | + if (urls.network.length === 0 && optionsHost === void 0) info(import_picocolors.default.dim(` ${import_picocolors.default.green("➜")} ${import_picocolors.default.bold("Network")}: use `) + import_picocolors.default.bold("--host") + import_picocolors.default.dim(" to expose")); |
| 15 | + } |
| 16 | + //#endregion |
| 17 | +-export { OPTIMIZABLE_ENTRY_RE as A, __esmMin as B, ERR_FILE_NOT_FOUND_IN_OPTIMIZED_DEP_DIR as C, JS_TYPES_RE as D, FS_PREFIX as E, defaultAllowedOrigins as F, __require as H, loopbackHosts as I, wildcardHosts as L, SPECIAL_QUERY_RE as M, VERSION as N, KNOWN_ASSET_TYPES as O, VITE_PACKAGE_DIR as P, require_picocolors as R, ENV_PUBLIC_PATH as S, ESBUILD_BASELINE_WIDELY_AVAILABLE_TARGET as T, __toCommonJS as U, __exportAll as V, __toESM as W, DEFAULT_SERVER_CONDITIONS as _, CLIENT_ENTRY as a, DEV_PROD_CONDITION as b, DEFAULT_ASSETS_INLINE_LIMIT as c, DEFAULT_CLIENT_MAIN_FIELDS as d, DEFAULT_CONFIG_FILES as f, DEFAULT_PREVIEW_PORT as g, DEFAULT_EXTERNAL_CONDITIONS as h, CLIENT_DIR as i, ROLLUP_HOOKS as j, METADATA_FILENAME as k, DEFAULT_ASSETS_RE as l, DEFAULT_EXTENSIONS as m, createLogger as n, CLIENT_PUBLIC_PATH as o, DEFAULT_DEV_PORT as p, printServerUrls as r, CSS_LANGS_RE as s, LogLevels as t, DEFAULT_CLIENT_CONDITIONS as u, DEFAULT_SERVER_MAIN_FIELDS as v, ERR_OPTIMIZE_DEPS_PROCESSING_ERROR as w, ENV_ENTRY as x, DEP_VERSION_RE as y, __commonJSMin as z }; |
| 18 | ++export { OPTIMIZABLE_ENTRY_RE as A, __esmMin as B, ERR_FILE_NOT_FOUND_IN_OPTIMIZED_DEP_DIR as C, JS_TYPES_RE as D, FS_PREFIX as E, FS_RAW_PREFIX, defaultAllowedOrigins as F, __require as H, loopbackHosts as I, wildcardHosts as L, SPECIAL_QUERY_RE as M, VERSION as N, KNOWN_ASSET_TYPES as O, VITE_PACKAGE_DIR as P, require_picocolors as R, ENV_PUBLIC_PATH as S, ESBUILD_BASELINE_WIDELY_AVAILABLE_TARGET as T, __toCommonJS as U, __exportAll as V, __toESM as W, DEFAULT_SERVER_CONDITIONS as _, CLIENT_ENTRY as a, DEV_PROD_CONDITION as b, DEFAULT_ASSETS_INLINE_LIMIT as c, DEFAULT_CLIENT_MAIN_FIELDS as d, DEFAULT_CONFIG_FILES as f, DEFAULT_PREVIEW_PORT as g, DEFAULT_EXTERNAL_CONDITIONS as h, CLIENT_DIR as i, ROLLUP_HOOKS as j, METADATA_FILENAME as k, DEFAULT_ASSETS_RE as l, DEFAULT_EXTENSIONS as m, createLogger as n, CLIENT_PUBLIC_PATH as o, DEFAULT_DEV_PORT as p, printServerUrls as r, CSS_LANGS_RE as s, LogLevels as t, DEFAULT_CLIENT_CONDITIONS as u, DEFAULT_SERVER_MAIN_FIELDS as v, ERR_OPTIMIZE_DEPS_PROCESSING_ERROR as w, ENV_ENTRY as x, DEP_VERSION_RE as y, __commonJSMin as z }; |
| 19 | +diff --git a/node_modules/vite/dist/node/chunks/node.js b/node_modules/vite/dist/node/chunks/node.js |
| 20 | +index 668fc3e..449bc9b 100644 |
| 21 | +--- a/node_modules/vite/dist/node/chunks/node.js |
| 22 | ++++ b/node_modules/vite/dist/node/chunks/node.js |
| 23 | +@@ -1,4 +1,4 @@ |
| 24 | +-import { A as OPTIMIZABLE_ENTRY_RE, B as __esmMin, C as ERR_FILE_NOT_FOUND_IN_OPTIMIZED_DEP_DIR, D as JS_TYPES_RE, E as FS_PREFIX, F as defaultAllowedOrigins, H as __require, I as loopbackHosts, L as wildcardHosts, M as SPECIAL_QUERY_RE, N as VERSION, O as KNOWN_ASSET_TYPES, P as VITE_PACKAGE_DIR, R as require_picocolors, S as ENV_PUBLIC_PATH, T as ESBUILD_BASELINE_WIDELY_AVAILABLE_TARGET, U as __toCommonJS, V as __exportAll, W as __toESM, _ as DEFAULT_SERVER_CONDITIONS, a as CLIENT_ENTRY, b as DEV_PROD_CONDITION, c as DEFAULT_ASSETS_INLINE_LIMIT, d as DEFAULT_CLIENT_MAIN_FIELDS, f as DEFAULT_CONFIG_FILES, g as DEFAULT_PREVIEW_PORT, h as DEFAULT_EXTERNAL_CONDITIONS, i as CLIENT_DIR, j as ROLLUP_HOOKS, k as METADATA_FILENAME, l as DEFAULT_ASSETS_RE, m as DEFAULT_EXTENSIONS, n as createLogger, o as CLIENT_PUBLIC_PATH, p as DEFAULT_DEV_PORT, r as printServerUrls, s as CSS_LANGS_RE, t as LogLevels, u as DEFAULT_CLIENT_CONDITIONS, v as DEFAULT_SERVER_MAIN_FIELDS, w as ERR_OPTIMIZE_DEPS_PROCESSING_ERROR, x as ENV_ENTRY, y as DEP_VERSION_RE, z as __commonJSMin } from "./logger.js"; |
| 25 | ++import { A as OPTIMIZABLE_ENTRY_RE, B as __esmMin, C as ERR_FILE_NOT_FOUND_IN_OPTIMIZED_DEP_DIR, D as JS_TYPES_RE, E as FS_PREFIX, FS_RAW_PREFIX, F as defaultAllowedOrigins, H as __require, I as loopbackHosts, L as wildcardHosts, M as SPECIAL_QUERY_RE, N as VERSION, O as KNOWN_ASSET_TYPES, P as VITE_PACKAGE_DIR, R as require_picocolors, S as ENV_PUBLIC_PATH, T as ESBUILD_BASELINE_WIDELY_AVAILABLE_TARGET, U as __toCommonJS, V as __exportAll, W as __toESM, _ as DEFAULT_SERVER_CONDITIONS, a as CLIENT_ENTRY, b as DEV_PROD_CONDITION, c as DEFAULT_ASSETS_INLINE_LIMIT, d as DEFAULT_CLIENT_MAIN_FIELDS, f as DEFAULT_CONFIG_FILES, g as DEFAULT_PREVIEW_PORT, h as DEFAULT_EXTERNAL_CONDITIONS, i as CLIENT_DIR, j as ROLLUP_HOOKS, k as METADATA_FILENAME, l as DEFAULT_ASSETS_RE, m as DEFAULT_EXTENSIONS, n as createLogger, o as CLIENT_PUBLIC_PATH, p as DEFAULT_DEV_PORT, r as printServerUrls, s as CSS_LANGS_RE, t as LogLevels, u as DEFAULT_CLIENT_CONDITIONS, v as DEFAULT_SERVER_MAIN_FIELDS, w as ERR_OPTIMIZE_DEPS_PROCESSING_ERROR, x as ENV_ENTRY, y as DEP_VERSION_RE, z as __commonJSMin } from "./logger.js"; |
| 26 | + import { builtinModules, createRequire } from "node:module"; |
| 27 | + import { parseAst, parseAstAsync } from "rolldown/parseAst"; |
| 28 | + import { esmExternalRequirePlugin, esmExternalRequirePlugin as esmExternalRequirePlugin$1 } from "rolldown/plugins"; |
| 29 | +@@ -19207,12 +19207,12 @@ function assetPlugin(config) { |
| 30 | + } |
| 31 | + }; |
| 32 | + } |
| 33 | +-async function fileToUrl$1(pluginContext, id, asFileUrl = false) { |
| 34 | ++async function fileToUrl$1(pluginContext, id, asFileUrl = false, raw = false) { |
| 35 | + const { environment } = pluginContext; |
| 36 | +- if (!environment.config.isBundled) return fileToDevUrl(environment, id, asFileUrl); |
| 37 | ++ if (!environment.config.isBundled) return fileToDevUrl(environment, id, asFileUrl, raw); |
| 38 | + else return fileToBuiltUrl(pluginContext, id); |
| 39 | + } |
| 40 | +-async function fileToDevUrl(environment, id, asFileUrl = false) { |
| 41 | ++async function fileToDevUrl(environment, id, asFileUrl = false, raw) { |
| 42 | + const config = environment.getTopLevelConfig(); |
| 43 | + const publicFile = checkPublicFile(id, config); |
| 44 | + if (inlineRE$3.test(id)) { |
| 45 | +@@ -19228,6 +19228,7 @@ async function fileToDevUrl(environment, id, asFileUrl = false) { |
| 46 | + if (asFileUrl) return pathToFileURL(cleanedId).href; |
| 47 | + let rtn; |
| 48 | + if (publicFile) rtn = id; |
| 49 | ++ else if (raw) rtn = path.posix.join(FS_RAW_PREFIX, id); |
| 50 | + else if (id.startsWith(withTrailingSlash(config.root))) rtn = "/" + path.posix.relative(config.root, id); |
| 51 | + else rtn = path.posix.join(FS_PREFIX, id); |
| 52 | + return joinUrlSegments(joinUrlSegments(config.server.origin ?? "", config.decodedBase), removeLeadingSlash(rtn)); |
| 53 | +@@ -24203,17 +24204,17 @@ function serveStaticMiddleware(server) { |
| 54 | + } |
| 55 | + }; |
| 56 | + } |
| 57 | +-function serveRawFsMiddleware(server) { |
| 58 | ++function serveRawFsMiddleware(server, prefix) { |
| 59 | + const serveFromRoot = build_default$1("/", sirvOptions({ |
| 60 | + config: server.config, |
| 61 | + getHeaders: () => server.config.server.headers |
| 62 | + })); |
| 63 | + return function viteServeRawFsMiddleware(req, res, next) { |
| 64 | +- if (req.url.startsWith(FS_PREFIX)) { |
| 65 | ++ if (req.url.startsWith(prefix)) { |
| 66 | + const url = new URL(req.url, "http://example.com"); |
| 67 | + const pathname = decodeURIIfPossible(url.pathname); |
| 68 | + if (pathname === void 0) return next(); |
| 69 | +- let newPathname = pathname.slice(FS_PREFIX.length); |
| 70 | ++ let newPathname = pathname.slice(prefix.length); |
| 71 | + if (isWindows) newPathname = newPathname.replace(/^[A-Z]:/i, ""); |
| 72 | + url.pathname = encodeURI(newPathname); |
| 73 | + req.url = url.href.slice(url.origin.length); |
| 74 | +@@ -26455,8 +26456,9 @@ async function _createServer(inlineConfig = {}, options) { |
| 75 | + middlewares.use(triggerLazyBundlingMiddleware(server)); |
| 76 | + middlewares.use(memoryFilesMiddleware(server)); |
| 77 | + } else { |
| 78 | ++ middlewares.use(serveRawFsMiddleware(server, FS_RAW_PREFIX)); |
| 79 | + middlewares.use(transformMiddleware(server)); |
| 80 | +- middlewares.use(serveRawFsMiddleware(server)); |
| 81 | ++ middlewares.use(serveRawFsMiddleware(server, FS_PREFIX)); |
| 82 | + middlewares.use(serveStaticMiddleware(server)); |
| 83 | + } |
| 84 | + if (config.appType === "spa" || config.appType === "mpa") middlewares.use(htmlFallbackMiddleware(root, config.appType === "spa", server.environments.client)); |
| 85 | +@@ -28715,9 +28717,9 @@ function assetImportMetaUrlPlugin(config) { |
| 86 | + if (file) try { |
| 87 | + if (publicDir && isParentDirectory(publicDir, file)) { |
| 88 | + const publicPath = "/" + path.posix.relative(publicDir, file); |
| 89 | +- builtUrl = await fileToUrl$1(this, publicPath); |
| 90 | ++ builtUrl = await fileToUrl$1(this, publicPath, undefined, true); |
| 91 | + } else { |
| 92 | +- builtUrl = await fileToUrl$1(this, file); |
| 93 | ++ builtUrl = await fileToUrl$1(this, file, undefined, true); |
| 94 | + if (tryStatSync(file)?.isFile()) this.addWatchFile(file); |
| 95 | + } |
| 96 | + } catch {} |
| 97 | +@@ -31459,7 +31461,7 @@ function rolldownDepPlugin(environment, qualified, external) { |
| 98 | + const rawUrl = code.slice(urlStart, urlEnd); |
| 99 | + if (rawUrl[0] === "`" && rawUrl.includes("${")) continue; |
| 100 | + const url = rawUrl.slice(1, -1); |
| 101 | +- if (isDataUrl(url) || isExternalUrl(url) || url.startsWith("/")) continue; |
| 102 | ++ if (!url.startsWith('.')) continue; |
| 103 | + if (!s) s = new MagicString(code); |
| 104 | + const absolutePath = path.resolve(path.dirname(id), url); |
| 105 | + const normalizedRelativePath = normalizePath(path.relative(bundleOutputDir, absolutePath)); |
0 commit comments