vite 4.0.0 → 4.0.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.
Potentially problematic release.
This version of vite might be problematic. Click here for more details.
- package/dist/client/client.mjs +2 -1
- package/dist/client/client.mjs.map +1 -1
- package/dist/node/chunks/{dep-ed9cb113.js → dep-2285ba4f.js} +118 -138
- package/dist/node/chunks/{dep-1e0f5bc1.js → dep-a1fa0d33.js} +33 -1
- package/dist/node/chunks/{dep-8f344fbd.js → dep-ec9f7a0d.js} +1 -1
- package/dist/node/cli.js +5 -7
- package/dist/node/index.d.ts +10 -10
- package/dist/node/index.js +1 -1
- package/dist/node-cjs/publicUtils.cjs +5 -6
- package/package.json +4 -4
package/dist/client/client.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import '@vite/env';
|
|
2
2
|
|
|
3
|
+
const base$1 = __BASE__ || '/';
|
|
3
4
|
// set :host styles to make playwright detect the element as visible
|
|
4
5
|
const template = /*html*/ `
|
|
5
6
|
<style>
|
|
@@ -183,7 +184,7 @@ class ErrorOverlay extends HTMLElement {
|
|
|
183
184
|
link.textContent = file;
|
|
184
185
|
link.className = 'file-link';
|
|
185
186
|
link.onclick = () => {
|
|
186
|
-
fetch(
|
|
187
|
+
fetch(`${base$1}__open-in-editor?file=` + encodeURIComponent(file));
|
|
187
188
|
};
|
|
188
189
|
el.appendChild(link);
|
|
189
190
|
curIndex += frag.length + file.length;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.mjs","sources":["../../src/client/overlay.ts","../../src/client/client.ts"],"sourcesContent":["import type { ErrorPayload } from 'types/hmrPayload'\n\n// set :host styles to make playwright detect the element as visible\nconst template = /*html*/ `\n<style>\n:host {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 99999;\n --monospace: 'SFMono-Regular', Consolas,\n 'Liberation Mono', Menlo, Courier, monospace;\n --red: #ff5555;\n --yellow: #e2aa53;\n --purple: #cfa4ff;\n --cyan: #2dd9da;\n --dim: #c9c9c9;\n\n --window-background: #181818;\n --window-color: #d8d8d8;\n}\n\n.backdrop {\n position: fixed;\n z-index: 99999;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n overflow-y: scroll;\n margin: 0;\n background: rgba(0, 0, 0, 0.66);\n}\n\n.window {\n font-family: var(--monospace);\n line-height: 1.5;\n width: 800px;\n color: var(--window-color);\n margin: 30px auto;\n padding: 25px 40px;\n position: relative;\n background: var(--window-background);\n border-radius: 6px 6px 8px 8px;\n box-shadow: 0 19px 38px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22);\n overflow: hidden;\n border-top: 8px solid var(--red);\n direction: ltr;\n text-align: left;\n}\n\npre {\n font-family: var(--monospace);\n font-size: 16px;\n margin-top: 0;\n margin-bottom: 1em;\n overflow-x: scroll;\n scrollbar-width: none;\n}\n\npre::-webkit-scrollbar {\n display: none;\n}\n\n.message {\n line-height: 1.3;\n font-weight: 600;\n white-space: pre-wrap;\n}\n\n.message-body {\n color: var(--red);\n}\n\n.plugin {\n color: var(--purple);\n}\n\n.file {\n color: var(--cyan);\n margin-bottom: 0;\n white-space: pre-wrap;\n word-break: break-all;\n}\n\n.frame {\n color: var(--yellow);\n}\n\n.stack {\n font-size: 13px;\n color: var(--dim);\n}\n\n.tip {\n font-size: 13px;\n color: #999;\n border-top: 1px dotted #999;\n padding-top: 13px;\n}\n\ncode {\n font-size: 13px;\n font-family: var(--monospace);\n color: var(--yellow);\n}\n\n.file-link {\n text-decoration: underline;\n cursor: pointer;\n}\n</style>\n<div class=\"backdrop\" part=\"backdrop\">\n <div class=\"window\" part=\"window\">\n <pre class=\"message\" part=\"message\"><span class=\"plugin\"></span><span class=\"message-body\"></span></pre>\n <pre class=\"file\" part=\"file\"></pre>\n <pre class=\"frame\" part=\"frame\"></pre>\n <pre class=\"stack\" part=\"stack\"></pre>\n <div class=\"tip\" part=\"tip\">\n Click outside or fix the code to dismiss.<br>\n You can also disable this overlay by setting\n <code>server.hmr.overlay</code> to <code>false</code> in <code>vite.config.js.</code>\n </div>\n </div>\n</div>\n`\n\nconst fileRE = /(?:[a-zA-Z]:\\\\|\\/).*?:\\d+:\\d+/g\nconst codeframeRE = /^(?:>?\\s+\\d+\\s+\\|.*|\\s+\\|\\s*\\^.*)\\r?\\n/gm\n\n// Allow `ErrorOverlay` to extend `HTMLElement` even in environments where\n// `HTMLElement` was not originally defined.\nconst { HTMLElement = class {} as typeof globalThis.HTMLElement } = globalThis\nexport class ErrorOverlay extends HTMLElement {\n root: ShadowRoot\n\n constructor(err: ErrorPayload['err'], links = true) {\n super()\n this.root = this.attachShadow({ mode: 'open' })\n this.root.innerHTML = template\n\n codeframeRE.lastIndex = 0\n const hasFrame = err.frame && codeframeRE.test(err.frame)\n const message = hasFrame\n ? err.message.replace(codeframeRE, '')\n : err.message\n if (err.plugin) {\n this.text('.plugin', `[plugin:${err.plugin}] `)\n }\n this.text('.message-body', message.trim())\n\n const [file] = (err.loc?.file || err.id || 'unknown file').split(`?`)\n if (err.loc) {\n this.text('.file', `${file}:${err.loc.line}:${err.loc.column}`, links)\n } else if (err.id) {\n this.text('.file', file)\n }\n\n if (hasFrame) {\n this.text('.frame', err.frame!.trim())\n }\n this.text('.stack', err.stack, links)\n\n this.root.querySelector('.window')!.addEventListener('click', (e) => {\n e.stopPropagation()\n })\n this.addEventListener('click', () => {\n this.close()\n })\n }\n\n text(selector: string, text: string, linkFiles = false): void {\n const el = this.root.querySelector(selector)!\n if (!linkFiles) {\n el.textContent = text\n } else {\n let curIndex = 0\n let match: RegExpExecArray | null\n fileRE.lastIndex = 0\n while ((match = fileRE.exec(text))) {\n const { 0: file, index } = match\n if (index != null) {\n const frag = text.slice(curIndex, index)\n el.appendChild(document.createTextNode(frag))\n const link = document.createElement('a')\n link.textContent = file\n link.className = 'file-link'\n link.onclick = () => {\n fetch('/__open-in-editor?file=' + encodeURIComponent(file))\n }\n el.appendChild(link)\n curIndex += frag.length + file.length\n }\n }\n }\n }\n\n close(): void {\n this.parentNode?.removeChild(this)\n }\n}\n\nexport const overlayId = 'vite-error-overlay'\nconst { customElements } = globalThis // Ensure `customElements` is defined before the next line.\nif (customElements && !customElements.get(overlayId)) {\n customElements.define(overlayId, ErrorOverlay)\n}\n","import type { ErrorPayload, HMRPayload, Update } from 'types/hmrPayload'\nimport type { ModuleNamespace, ViteHotContext } from 'types/hot'\nimport type { InferCustomEventPayload } from 'types/customEvent'\nimport { ErrorOverlay, overlayId } from './overlay'\n// eslint-disable-next-line node/no-missing-import\nimport '@vite/env'\n\n// injected by the hmr plugin when served\ndeclare const __BASE__: string\ndeclare const __SERVER_HOST__: string\ndeclare const __HMR_PROTOCOL__: string | null\ndeclare const __HMR_HOSTNAME__: string | null\ndeclare const __HMR_PORT__: number | null\ndeclare const __HMR_DIRECT_TARGET__: string\ndeclare const __HMR_BASE__: string\ndeclare const __HMR_TIMEOUT__: number\ndeclare const __HMR_ENABLE_OVERLAY__: boolean\n\nconsole.debug('[vite] connecting...')\n\nconst importMetaUrl = new URL(import.meta.url)\n\n// use server configuration, then fallback to inference\nconst serverHost = __SERVER_HOST__\nconst socketProtocol =\n __HMR_PROTOCOL__ || (location.protocol === 'https:' ? 'wss' : 'ws')\nconst hmrPort = __HMR_PORT__\nconst socketHost = `${__HMR_HOSTNAME__ || importMetaUrl.hostname}:${\n hmrPort || importMetaUrl.port\n}${__HMR_BASE__}`\nconst directSocketHost = __HMR_DIRECT_TARGET__\nconst base = __BASE__ || '/'\nconst messageBuffer: string[] = []\n\nlet socket: WebSocket\ntry {\n let fallback: (() => void) | undefined\n // only use fallback when port is inferred to prevent confusion\n if (!hmrPort) {\n fallback = () => {\n // fallback to connecting directly to the hmr server\n // for servers which does not support proxying websocket\n socket = setupWebSocket(socketProtocol, directSocketHost, () => {\n const currentScriptHostURL = new URL(import.meta.url)\n const currentScriptHost =\n currentScriptHostURL.host +\n currentScriptHostURL.pathname.replace(/@vite\\/client$/, '')\n console.error(\n '[vite] failed to connect to websocket.\\n' +\n 'your current setup:\\n' +\n ` (browser) ${currentScriptHost} <--[HTTP]--> ${serverHost} (server)\\n` +\n ` (browser) ${socketHost} <--[WebSocket (failing)]--> ${directSocketHost} (server)\\n` +\n 'Check out your Vite / network configuration and https://vitejs.dev/config/server-options.html#server-hmr .',\n )\n })\n socket.addEventListener(\n 'open',\n () => {\n console.info(\n '[vite] Direct websocket connection fallback. Check out https://vitejs.dev/config/server-options.html#server-hmr to remove the previous connection error.',\n )\n },\n { once: true },\n )\n }\n }\n\n socket = setupWebSocket(socketProtocol, socketHost, fallback)\n} catch (error) {\n console.error(`[vite] failed to connect to websocket (${error}). `)\n}\n\nfunction setupWebSocket(\n protocol: string,\n hostAndPath: string,\n onCloseWithoutOpen?: () => void,\n) {\n const socket = new WebSocket(`${protocol}://${hostAndPath}`, 'vite-hmr')\n let isOpened = false\n\n socket.addEventListener(\n 'open',\n () => {\n isOpened = true\n },\n { once: true },\n )\n\n // Listen for messages\n socket.addEventListener('message', async ({ data }) => {\n handleMessage(JSON.parse(data))\n })\n\n // ping server\n socket.addEventListener('close', async ({ wasClean }) => {\n if (wasClean) return\n\n if (!isOpened && onCloseWithoutOpen) {\n onCloseWithoutOpen()\n return\n }\n\n console.log(`[vite] server connection lost. polling for restart...`)\n await waitForSuccessfulPing(protocol, hostAndPath)\n location.reload()\n })\n\n return socket\n}\n\nfunction warnFailedFetch(err: Error, path: string | string[]) {\n if (!err.message.match('fetch')) {\n console.error(err)\n }\n console.error(\n `[hmr] Failed to reload ${path}. ` +\n `This could be due to syntax errors or importing non-existent ` +\n `modules. (see errors above)`,\n )\n}\n\nfunction cleanUrl(pathname: string): string {\n const url = new URL(pathname, location.toString())\n url.searchParams.delete('direct')\n return url.pathname + url.search\n}\n\nlet isFirstUpdate = true\nconst outdatedLinkTags = new WeakSet<HTMLLinkElement>()\n\nasync function handleMessage(payload: HMRPayload) {\n switch (payload.type) {\n case 'connected':\n console.debug(`[vite] connected.`)\n sendMessageBuffer()\n // proxy(nginx, docker) hmr ws maybe caused timeout,\n // so send ping package let ws keep alive.\n setInterval(() => {\n if (socket.readyState === socket.OPEN) {\n socket.send('{\"type\":\"ping\"}')\n }\n }, __HMR_TIMEOUT__)\n break\n case 'update':\n notifyListeners('vite:beforeUpdate', payload)\n // if this is the first update and there's already an error overlay, it\n // means the page opened with existing server compile error and the whole\n // module script failed to load (since one of the nested imports is 500).\n // in this case a normal update won't work and a full reload is needed.\n if (isFirstUpdate && hasErrorOverlay()) {\n window.location.reload()\n return\n } else {\n clearErrorOverlay()\n isFirstUpdate = false\n }\n await Promise.all(\n payload.updates.map(async (update): Promise<void> => {\n if (update.type === 'js-update') {\n return queueUpdate(fetchUpdate(update))\n }\n\n // css-update\n // this is only sent when a css file referenced with <link> is updated\n const { path, timestamp } = update\n const searchUrl = cleanUrl(path)\n // can't use querySelector with `[href*=]` here since the link may be\n // using relative paths so we need to use link.href to grab the full\n // URL for the include check.\n const el = Array.from(\n document.querySelectorAll<HTMLLinkElement>('link'),\n ).find(\n (e) =>\n !outdatedLinkTags.has(e) && cleanUrl(e.href).includes(searchUrl),\n )\n\n if (!el) {\n return\n }\n\n const newPath = `${base}${searchUrl.slice(1)}${\n searchUrl.includes('?') ? '&' : '?'\n }t=${timestamp}`\n\n // rather than swapping the href on the existing tag, we will\n // create a new link tag. Once the new stylesheet has loaded we\n // will remove the existing link tag. This removes a Flash Of\n // Unstyled Content that can occur when swapping out the tag href\n // directly, as the new stylesheet has not yet been loaded.\n return new Promise((resolve) => {\n const newLinkTag = el.cloneNode() as HTMLLinkElement\n newLinkTag.href = new URL(newPath, el.href).href\n const removeOldEl = () => {\n el.remove()\n console.debug(`[vite] css hot updated: ${searchUrl}`)\n resolve()\n }\n newLinkTag.addEventListener('load', removeOldEl)\n newLinkTag.addEventListener('error', removeOldEl)\n outdatedLinkTags.add(el)\n el.after(newLinkTag)\n })\n }),\n )\n notifyListeners('vite:afterUpdate', payload)\n break\n case 'custom': {\n notifyListeners(payload.event, payload.data)\n break\n }\n case 'full-reload':\n notifyListeners('vite:beforeFullReload', payload)\n if (payload.path && payload.path.endsWith('.html')) {\n // if html file is edited, only reload the page if the browser is\n // currently on that page.\n const pagePath = decodeURI(location.pathname)\n const payloadPath = base + payload.path.slice(1)\n if (\n pagePath === payloadPath ||\n payload.path === '/index.html' ||\n (pagePath.endsWith('/') && pagePath + 'index.html' === payloadPath)\n ) {\n location.reload()\n }\n return\n } else {\n location.reload()\n }\n break\n case 'prune':\n notifyListeners('vite:beforePrune', payload)\n // After an HMR update, some modules are no longer imported on the page\n // but they may have left behind side effects that need to be cleaned up\n // (.e.g style injections)\n // TODO Trigger their dispose callbacks.\n payload.paths.forEach((path) => {\n const fn = pruneMap.get(path)\n if (fn) {\n fn(dataMap.get(path))\n }\n })\n break\n case 'error': {\n notifyListeners('vite:error', payload)\n const err = payload.err\n if (enableOverlay) {\n createErrorOverlay(err)\n } else {\n console.error(\n `[vite] Internal Server Error\\n${err.message}\\n${err.stack}`,\n )\n }\n break\n }\n default: {\n const check: never = payload\n return check\n }\n }\n}\n\nfunction notifyListeners<T extends string>(\n event: T,\n data: InferCustomEventPayload<T>,\n): void\nfunction notifyListeners(event: string, data: any): void {\n const cbs = customListenersMap.get(event)\n if (cbs) {\n cbs.forEach((cb) => cb(data))\n }\n}\n\nconst enableOverlay = __HMR_ENABLE_OVERLAY__\n\nfunction createErrorOverlay(err: ErrorPayload['err']) {\n if (!enableOverlay) return\n clearErrorOverlay()\n document.body.appendChild(new ErrorOverlay(err))\n}\n\nfunction clearErrorOverlay() {\n document\n .querySelectorAll(overlayId)\n .forEach((n) => (n as ErrorOverlay).close())\n}\n\nfunction hasErrorOverlay() {\n return document.querySelectorAll(overlayId).length\n}\n\nlet pending = false\nlet queued: Promise<(() => void) | undefined>[] = []\n\n/**\n * buffer multiple hot updates triggered by the same src change\n * so that they are invoked in the same order they were sent.\n * (otherwise the order may be inconsistent because of the http request round trip)\n */\nasync function queueUpdate(p: Promise<(() => void) | undefined>) {\n queued.push(p)\n if (!pending) {\n pending = true\n await Promise.resolve()\n pending = false\n const loading = [...queued]\n queued = []\n ;(await Promise.all(loading)).forEach((fn) => fn && fn())\n }\n}\n\nasync function waitForSuccessfulPing(\n socketProtocol: string,\n hostAndPath: string,\n ms = 1000,\n) {\n const pingHostProtocol = socketProtocol === 'wss' ? 'https' : 'http'\n\n // eslint-disable-next-line no-constant-condition\n while (true) {\n try {\n // A fetch on a websocket URL will return a successful promise with status 400,\n // but will reject a networking error.\n // When running on middleware mode, it returns status 426, and an cors error happens if mode is not no-cors\n await fetch(`${pingHostProtocol}://${hostAndPath}`, {\n mode: 'no-cors',\n })\n break\n } catch (e) {\n // wait ms before attempting to ping again\n await new Promise((resolve) => setTimeout(resolve, ms))\n }\n }\n}\n\n// https://wicg.github.io/construct-stylesheets\nconst supportsConstructedSheet = (() => {\n // TODO: re-enable this try block once Chrome fixes the performance of\n // rule insertion in really big stylesheets\n // try {\n // new CSSStyleSheet()\n // return true\n // } catch (e) {}\n return false\n})()\n\nconst sheetsMap = new Map<\n string,\n HTMLStyleElement | CSSStyleSheet | undefined\n>()\n\nexport function updateStyle(id: string, content: string): void {\n let style = sheetsMap.get(id)\n if (supportsConstructedSheet && !content.includes('@import')) {\n if (style && !(style instanceof CSSStyleSheet)) {\n removeStyle(id)\n style = undefined\n }\n\n if (!style) {\n style = new CSSStyleSheet()\n style.replaceSync(content)\n document.adoptedStyleSheets = [...document.adoptedStyleSheets, style]\n } else {\n style.replaceSync(content)\n }\n } else {\n if (style && !(style instanceof HTMLStyleElement)) {\n removeStyle(id)\n style = undefined\n }\n\n if (!style) {\n style = document.createElement('style')\n style.setAttribute('type', 'text/css')\n style.setAttribute('data-vite-dev-id', id)\n style.textContent = content\n document.head.appendChild(style)\n } else {\n style.textContent = content\n }\n }\n sheetsMap.set(id, style)\n}\n\nexport function removeStyle(id: string): void {\n const style = sheetsMap.get(id)\n if (style) {\n if (style instanceof CSSStyleSheet) {\n document.adoptedStyleSheets = document.adoptedStyleSheets.filter(\n (s: CSSStyleSheet) => s !== style,\n )\n } else {\n document.head.removeChild(style)\n }\n sheetsMap.delete(id)\n }\n}\n\nasync function fetchUpdate({\n path,\n acceptedPath,\n timestamp,\n explicitImportRequired,\n}: Update) {\n const mod = hotModulesMap.get(path)\n if (!mod) {\n // In a code-splitting project,\n // it is common that the hot-updating module is not loaded yet.\n // https://github.com/vitejs/vite/issues/721\n return\n }\n\n let fetchedModule: ModuleNamespace | undefined\n const isSelfUpdate = path === acceptedPath\n\n // determine the qualified callbacks before we re-import the modules\n const qualifiedCallbacks = mod.callbacks.filter(({ deps }) =>\n deps.includes(acceptedPath),\n )\n\n if (isSelfUpdate || qualifiedCallbacks.length > 0) {\n const disposer = disposeMap.get(acceptedPath)\n if (disposer) await disposer(dataMap.get(acceptedPath))\n const [acceptedPathWithoutQuery, query] = acceptedPath.split(`?`)\n try {\n fetchedModule = await import(\n /* @vite-ignore */\n base +\n acceptedPathWithoutQuery.slice(1) +\n `?${explicitImportRequired ? 'import&' : ''}t=${timestamp}${\n query ? `&${query}` : ''\n }`\n )\n } catch (e) {\n warnFailedFetch(e, acceptedPath)\n }\n }\n\n return () => {\n for (const { deps, fn } of qualifiedCallbacks) {\n fn(deps.map((dep) => (dep === acceptedPath ? fetchedModule : undefined)))\n }\n const loggedPath = isSelfUpdate ? path : `${acceptedPath} via ${path}`\n console.debug(`[vite] hot updated: ${loggedPath}`)\n }\n}\n\nfunction sendMessageBuffer() {\n if (socket.readyState === 1) {\n messageBuffer.forEach((msg) => socket.send(msg))\n messageBuffer.length = 0\n }\n}\n\ninterface HotModule {\n id: string\n callbacks: HotCallback[]\n}\n\ninterface HotCallback {\n // the dependencies must be fetchable paths\n deps: string[]\n fn: (modules: Array<ModuleNamespace | undefined>) => void\n}\n\ntype CustomListenersMap = Map<string, ((data: any) => void)[]>\n\nconst hotModulesMap = new Map<string, HotModule>()\nconst disposeMap = new Map<string, (data: any) => void | Promise<void>>()\nconst pruneMap = new Map<string, (data: any) => void | Promise<void>>()\nconst dataMap = new Map<string, any>()\nconst customListenersMap: CustomListenersMap = new Map()\nconst ctxToListenersMap = new Map<string, CustomListenersMap>()\n\nexport function createHotContext(ownerPath: string): ViteHotContext {\n if (!dataMap.has(ownerPath)) {\n dataMap.set(ownerPath, {})\n }\n\n // when a file is hot updated, a new context is created\n // clear its stale callbacks\n const mod = hotModulesMap.get(ownerPath)\n if (mod) {\n mod.callbacks = []\n }\n\n // clear stale custom event listeners\n const staleListeners = ctxToListenersMap.get(ownerPath)\n if (staleListeners) {\n for (const [event, staleFns] of staleListeners) {\n const listeners = customListenersMap.get(event)\n if (listeners) {\n customListenersMap.set(\n event,\n listeners.filter((l) => !staleFns.includes(l)),\n )\n }\n }\n }\n\n const newListeners: CustomListenersMap = new Map()\n ctxToListenersMap.set(ownerPath, newListeners)\n\n function acceptDeps(deps: string[], callback: HotCallback['fn'] = () => {}) {\n const mod: HotModule = hotModulesMap.get(ownerPath) || {\n id: ownerPath,\n callbacks: [],\n }\n mod.callbacks.push({\n deps,\n fn: callback,\n })\n hotModulesMap.set(ownerPath, mod)\n }\n\n const hot: ViteHotContext = {\n get data() {\n return dataMap.get(ownerPath)\n },\n\n accept(deps?: any, callback?: any) {\n if (typeof deps === 'function' || !deps) {\n // self-accept: hot.accept(() => {})\n acceptDeps([ownerPath], ([mod]) => deps?.(mod))\n } else if (typeof deps === 'string') {\n // explicit deps\n acceptDeps([deps], ([mod]) => callback?.(mod))\n } else if (Array.isArray(deps)) {\n acceptDeps(deps, callback)\n } else {\n throw new Error(`invalid hot.accept() usage.`)\n }\n },\n\n // export names (first arg) are irrelevant on the client side, they're\n // extracted in the server for propagation\n acceptExports(_, callback) {\n acceptDeps([ownerPath], ([mod]) => callback?.(mod))\n },\n\n dispose(cb) {\n disposeMap.set(ownerPath, cb)\n },\n\n prune(cb) {\n pruneMap.set(ownerPath, cb)\n },\n\n // Kept for backward compatibility (#11036)\n // @ts-expect-error untyped\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n decline() {},\n\n // tell the server to re-perform hmr propagation from this module as root\n invalidate(message) {\n notifyListeners('vite:invalidate', { path: ownerPath, message })\n this.send('vite:invalidate', { path: ownerPath, message })\n console.debug(\n `[vite] invalidate ${ownerPath}${message ? `: ${message}` : ''}`,\n )\n },\n\n // custom events\n on(event, cb) {\n const addToMap = (map: Map<string, any[]>) => {\n const existing = map.get(event) || []\n existing.push(cb)\n map.set(event, existing)\n }\n addToMap(customListenersMap)\n addToMap(newListeners)\n },\n\n send(event, data) {\n messageBuffer.push(JSON.stringify({ type: 'custom', event, data }))\n sendMessageBuffer()\n },\n }\n\n return hot\n}\n\n/**\n * urls here are dynamic import() urls that couldn't be statically analyzed\n */\nexport function injectQuery(url: string, queryToInject: string): string {\n // skip urls that won't be handled by vite\n if (!url.startsWith('.') && !url.startsWith('/')) {\n return url\n }\n\n // can't use pathname from URL since it may be relative like ../\n const pathname = url.replace(/#.*$/, '').replace(/\\?.*$/, '')\n const { search, hash } = new URL(url, 'http://vitejs.dev')\n\n return `${pathname}?${queryToInject}${search ? `&` + search.slice(1) : ''}${\n hash || ''\n }`\n}\n\nexport { ErrorOverlay }\n"],"names":[],"mappings":";;AAEA;AACA,MAAM,QAAQ,YAAY,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4HzB,CAAA;AAED,MAAM,MAAM,GAAG,gCAAgC,CAAA;AAC/C,MAAM,WAAW,GAAG,0CAA0C,CAAA;AAE9D;AACA;AACA,MAAM,EAAE,WAAW,GAAG,MAAA;CAAyC,EAAE,GAAG,UAAU,CAAA;AACxE,MAAO,YAAa,SAAQ,WAAW,CAAA;AAG3C,IAAA,WAAA,CAAY,GAAwB,EAAE,KAAK,GAAG,IAAI,EAAA;;AAChD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AAI,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;AACnE,YAAA,iBAAiB,EAAE,CAAA;SACpB;KACF,CAAA;AAED,IAAA,OAAO,GAAG,CAAA;AACZ,CAAC;AAED;;AAEG;AACa,SAAA,WAAW,CAAC,GAAW,EAAE,aAAqB,EAAA;;AAE5D,IAAA,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;AAChD,QAAA,OAAO,GAAG,CAAA;AACX,KAAA;;AAGD,IAAA,MAAM,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA;AAC7D,IAAA,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,GAAG,CAAC,GAAG,EAAE,mBAAmB,CAAC,CAAA;IAE1D,OAAO,CAAA,EAAG,QAAQ,CAAA,CAAA,EAAI,aAAa,CAAA,EAAG,MAAM,GAAG,CAAG,CAAA,CAAA,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,EAAE,CAAA,EACvE,IAAI,IAAI,EACV,CAAA,CAAE,CAAA;AACJ;;;;"}
|
|
1
|
+
{"version":3,"file":"client.mjs","sources":["../../src/client/overlay.ts","../../src/client/client.ts"],"sourcesContent":["import type { ErrorPayload } from 'types/hmrPayload'\n\n// injected by the hmr plugin when served\ndeclare const __BASE__: string\n\nconst base = __BASE__ || '/'\n\n// set :host styles to make playwright detect the element as visible\nconst template = /*html*/ `\n<style>\n:host {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 99999;\n --monospace: 'SFMono-Regular', Consolas,\n 'Liberation Mono', Menlo, Courier, monospace;\n --red: #ff5555;\n --yellow: #e2aa53;\n --purple: #cfa4ff;\n --cyan: #2dd9da;\n --dim: #c9c9c9;\n\n --window-background: #181818;\n --window-color: #d8d8d8;\n}\n\n.backdrop {\n position: fixed;\n z-index: 99999;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n overflow-y: scroll;\n margin: 0;\n background: rgba(0, 0, 0, 0.66);\n}\n\n.window {\n font-family: var(--monospace);\n line-height: 1.5;\n width: 800px;\n color: var(--window-color);\n margin: 30px auto;\n padding: 25px 40px;\n position: relative;\n background: var(--window-background);\n border-radius: 6px 6px 8px 8px;\n box-shadow: 0 19px 38px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22);\n overflow: hidden;\n border-top: 8px solid var(--red);\n direction: ltr;\n text-align: left;\n}\n\npre {\n font-family: var(--monospace);\n font-size: 16px;\n margin-top: 0;\n margin-bottom: 1em;\n overflow-x: scroll;\n scrollbar-width: none;\n}\n\npre::-webkit-scrollbar {\n display: none;\n}\n\n.message {\n line-height: 1.3;\n font-weight: 600;\n white-space: pre-wrap;\n}\n\n.message-body {\n color: var(--red);\n}\n\n.plugin {\n color: var(--purple);\n}\n\n.file {\n color: var(--cyan);\n margin-bottom: 0;\n white-space: pre-wrap;\n word-break: break-all;\n}\n\n.frame {\n color: var(--yellow);\n}\n\n.stack {\n font-size: 13px;\n color: var(--dim);\n}\n\n.tip {\n font-size: 13px;\n color: #999;\n border-top: 1px dotted #999;\n padding-top: 13px;\n}\n\ncode {\n font-size: 13px;\n font-family: var(--monospace);\n color: var(--yellow);\n}\n\n.file-link {\n text-decoration: underline;\n cursor: pointer;\n}\n</style>\n<div class=\"backdrop\" part=\"backdrop\">\n <div class=\"window\" part=\"window\">\n <pre class=\"message\" part=\"message\"><span class=\"plugin\"></span><span class=\"message-body\"></span></pre>\n <pre class=\"file\" part=\"file\"></pre>\n <pre class=\"frame\" part=\"frame\"></pre>\n <pre class=\"stack\" part=\"stack\"></pre>\n <div class=\"tip\" part=\"tip\">\n Click outside or fix the code to dismiss.<br>\n You can also disable this overlay by setting\n <code>server.hmr.overlay</code> to <code>false</code> in <code>vite.config.js.</code>\n </div>\n </div>\n</div>\n`\n\nconst fileRE = /(?:[a-zA-Z]:\\\\|\\/).*?:\\d+:\\d+/g\nconst codeframeRE = /^(?:>?\\s+\\d+\\s+\\|.*|\\s+\\|\\s*\\^.*)\\r?\\n/gm\n\n// Allow `ErrorOverlay` to extend `HTMLElement` even in environments where\n// `HTMLElement` was not originally defined.\nconst { HTMLElement = class {} as typeof globalThis.HTMLElement } = globalThis\nexport class ErrorOverlay extends HTMLElement {\n root: ShadowRoot\n\n constructor(err: ErrorPayload['err'], links = true) {\n super()\n this.root = this.attachShadow({ mode: 'open' })\n this.root.innerHTML = template\n\n codeframeRE.lastIndex = 0\n const hasFrame = err.frame && codeframeRE.test(err.frame)\n const message = hasFrame\n ? err.message.replace(codeframeRE, '')\n : err.message\n if (err.plugin) {\n this.text('.plugin', `[plugin:${err.plugin}] `)\n }\n this.text('.message-body', message.trim())\n\n const [file] = (err.loc?.file || err.id || 'unknown file').split(`?`)\n if (err.loc) {\n this.text('.file', `${file}:${err.loc.line}:${err.loc.column}`, links)\n } else if (err.id) {\n this.text('.file', file)\n }\n\n if (hasFrame) {\n this.text('.frame', err.frame!.trim())\n }\n this.text('.stack', err.stack, links)\n\n this.root.querySelector('.window')!.addEventListener('click', (e) => {\n e.stopPropagation()\n })\n this.addEventListener('click', () => {\n this.close()\n })\n }\n\n text(selector: string, text: string, linkFiles = false): void {\n const el = this.root.querySelector(selector)!\n if (!linkFiles) {\n el.textContent = text\n } else {\n let curIndex = 0\n let match: RegExpExecArray | null\n fileRE.lastIndex = 0\n while ((match = fileRE.exec(text))) {\n const { 0: file, index } = match\n if (index != null) {\n const frag = text.slice(curIndex, index)\n el.appendChild(document.createTextNode(frag))\n const link = document.createElement('a')\n link.textContent = file\n link.className = 'file-link'\n link.onclick = () => {\n fetch(`${base}__open-in-editor?file=` + encodeURIComponent(file))\n }\n el.appendChild(link)\n curIndex += frag.length + file.length\n }\n }\n }\n }\n\n close(): void {\n this.parentNode?.removeChild(this)\n }\n}\n\nexport const overlayId = 'vite-error-overlay'\nconst { customElements } = globalThis // Ensure `customElements` is defined before the next line.\nif (customElements && !customElements.get(overlayId)) {\n customElements.define(overlayId, ErrorOverlay)\n}\n","import type { ErrorPayload, HMRPayload, Update } from 'types/hmrPayload'\nimport type { ModuleNamespace, ViteHotContext } from 'types/hot'\nimport type { InferCustomEventPayload } from 'types/customEvent'\nimport { ErrorOverlay, overlayId } from './overlay'\n// eslint-disable-next-line node/no-missing-import\nimport '@vite/env'\n\n// injected by the hmr plugin when served\ndeclare const __BASE__: string\ndeclare const __SERVER_HOST__: string\ndeclare const __HMR_PROTOCOL__: string | null\ndeclare const __HMR_HOSTNAME__: string | null\ndeclare const __HMR_PORT__: number | null\ndeclare const __HMR_DIRECT_TARGET__: string\ndeclare const __HMR_BASE__: string\ndeclare const __HMR_TIMEOUT__: number\ndeclare const __HMR_ENABLE_OVERLAY__: boolean\n\nconsole.debug('[vite] connecting...')\n\nconst importMetaUrl = new URL(import.meta.url)\n\n// use server configuration, then fallback to inference\nconst serverHost = __SERVER_HOST__\nconst socketProtocol =\n __HMR_PROTOCOL__ || (location.protocol === 'https:' ? 'wss' : 'ws')\nconst hmrPort = __HMR_PORT__\nconst socketHost = `${__HMR_HOSTNAME__ || importMetaUrl.hostname}:${\n hmrPort || importMetaUrl.port\n}${__HMR_BASE__}`\nconst directSocketHost = __HMR_DIRECT_TARGET__\nconst base = __BASE__ || '/'\nconst messageBuffer: string[] = []\n\nlet socket: WebSocket\ntry {\n let fallback: (() => void) | undefined\n // only use fallback when port is inferred to prevent confusion\n if (!hmrPort) {\n fallback = () => {\n // fallback to connecting directly to the hmr server\n // for servers which does not support proxying websocket\n socket = setupWebSocket(socketProtocol, directSocketHost, () => {\n const currentScriptHostURL = new URL(import.meta.url)\n const currentScriptHost =\n currentScriptHostURL.host +\n currentScriptHostURL.pathname.replace(/@vite\\/client$/, '')\n console.error(\n '[vite] failed to connect to websocket.\\n' +\n 'your current setup:\\n' +\n ` (browser) ${currentScriptHost} <--[HTTP]--> ${serverHost} (server)\\n` +\n ` (browser) ${socketHost} <--[WebSocket (failing)]--> ${directSocketHost} (server)\\n` +\n 'Check out your Vite / network configuration and https://vitejs.dev/config/server-options.html#server-hmr .',\n )\n })\n socket.addEventListener(\n 'open',\n () => {\n console.info(\n '[vite] Direct websocket connection fallback. Check out https://vitejs.dev/config/server-options.html#server-hmr to remove the previous connection error.',\n )\n },\n { once: true },\n )\n }\n }\n\n socket = setupWebSocket(socketProtocol, socketHost, fallback)\n} catch (error) {\n console.error(`[vite] failed to connect to websocket (${error}). `)\n}\n\nfunction setupWebSocket(\n protocol: string,\n hostAndPath: string,\n onCloseWithoutOpen?: () => void,\n) {\n const socket = new WebSocket(`${protocol}://${hostAndPath}`, 'vite-hmr')\n let isOpened = false\n\n socket.addEventListener(\n 'open',\n () => {\n isOpened = true\n },\n { once: true },\n )\n\n // Listen for messages\n socket.addEventListener('message', async ({ data }) => {\n handleMessage(JSON.parse(data))\n })\n\n // ping server\n socket.addEventListener('close', async ({ wasClean }) => {\n if (wasClean) return\n\n if (!isOpened && onCloseWithoutOpen) {\n onCloseWithoutOpen()\n return\n }\n\n console.log(`[vite] server connection lost. polling for restart...`)\n await waitForSuccessfulPing(protocol, hostAndPath)\n location.reload()\n })\n\n return socket\n}\n\nfunction warnFailedFetch(err: Error, path: string | string[]) {\n if (!err.message.match('fetch')) {\n console.error(err)\n }\n console.error(\n `[hmr] Failed to reload ${path}. ` +\n `This could be due to syntax errors or importing non-existent ` +\n `modules. (see errors above)`,\n )\n}\n\nfunction cleanUrl(pathname: string): string {\n const url = new URL(pathname, location.toString())\n url.searchParams.delete('direct')\n return url.pathname + url.search\n}\n\nlet isFirstUpdate = true\nconst outdatedLinkTags = new WeakSet<HTMLLinkElement>()\n\nasync function handleMessage(payload: HMRPayload) {\n switch (payload.type) {\n case 'connected':\n console.debug(`[vite] connected.`)\n sendMessageBuffer()\n // proxy(nginx, docker) hmr ws maybe caused timeout,\n // so send ping package let ws keep alive.\n setInterval(() => {\n if (socket.readyState === socket.OPEN) {\n socket.send('{\"type\":\"ping\"}')\n }\n }, __HMR_TIMEOUT__)\n break\n case 'update':\n notifyListeners('vite:beforeUpdate', payload)\n // if this is the first update and there's already an error overlay, it\n // means the page opened with existing server compile error and the whole\n // module script failed to load (since one of the nested imports is 500).\n // in this case a normal update won't work and a full reload is needed.\n if (isFirstUpdate && hasErrorOverlay()) {\n window.location.reload()\n return\n } else {\n clearErrorOverlay()\n isFirstUpdate = false\n }\n await Promise.all(\n payload.updates.map(async (update): Promise<void> => {\n if (update.type === 'js-update') {\n return queueUpdate(fetchUpdate(update))\n }\n\n // css-update\n // this is only sent when a css file referenced with <link> is updated\n const { path, timestamp } = update\n const searchUrl = cleanUrl(path)\n // can't use querySelector with `[href*=]` here since the link may be\n // using relative paths so we need to use link.href to grab the full\n // URL for the include check.\n const el = Array.from(\n document.querySelectorAll<HTMLLinkElement>('link'),\n ).find(\n (e) =>\n !outdatedLinkTags.has(e) && cleanUrl(e.href).includes(searchUrl),\n )\n\n if (!el) {\n return\n }\n\n const newPath = `${base}${searchUrl.slice(1)}${\n searchUrl.includes('?') ? '&' : '?'\n }t=${timestamp}`\n\n // rather than swapping the href on the existing tag, we will\n // create a new link tag. Once the new stylesheet has loaded we\n // will remove the existing link tag. This removes a Flash Of\n // Unstyled Content that can occur when swapping out the tag href\n // directly, as the new stylesheet has not yet been loaded.\n return new Promise((resolve) => {\n const newLinkTag = el.cloneNode() as HTMLLinkElement\n newLinkTag.href = new URL(newPath, el.href).href\n const removeOldEl = () => {\n el.remove()\n console.debug(`[vite] css hot updated: ${searchUrl}`)\n resolve()\n }\n newLinkTag.addEventListener('load', removeOldEl)\n newLinkTag.addEventListener('error', removeOldEl)\n outdatedLinkTags.add(el)\n el.after(newLinkTag)\n })\n }),\n )\n notifyListeners('vite:afterUpdate', payload)\n break\n case 'custom': {\n notifyListeners(payload.event, payload.data)\n break\n }\n case 'full-reload':\n notifyListeners('vite:beforeFullReload', payload)\n if (payload.path && payload.path.endsWith('.html')) {\n // if html file is edited, only reload the page if the browser is\n // currently on that page.\n const pagePath = decodeURI(location.pathname)\n const payloadPath = base + payload.path.slice(1)\n if (\n pagePath === payloadPath ||\n payload.path === '/index.html' ||\n (pagePath.endsWith('/') && pagePath + 'index.html' === payloadPath)\n ) {\n location.reload()\n }\n return\n } else {\n location.reload()\n }\n break\n case 'prune':\n notifyListeners('vite:beforePrune', payload)\n // After an HMR update, some modules are no longer imported on the page\n // but they may have left behind side effects that need to be cleaned up\n // (.e.g style injections)\n // TODO Trigger their dispose callbacks.\n payload.paths.forEach((path) => {\n const fn = pruneMap.get(path)\n if (fn) {\n fn(dataMap.get(path))\n }\n })\n break\n case 'error': {\n notifyListeners('vite:error', payload)\n const err = payload.err\n if (enableOverlay) {\n createErrorOverlay(err)\n } else {\n console.error(\n `[vite] Internal Server Error\\n${err.message}\\n${err.stack}`,\n )\n }\n break\n }\n default: {\n const check: never = payload\n return check\n }\n }\n}\n\nfunction notifyListeners<T extends string>(\n event: T,\n data: InferCustomEventPayload<T>,\n): void\nfunction notifyListeners(event: string, data: any): void {\n const cbs = customListenersMap.get(event)\n if (cbs) {\n cbs.forEach((cb) => cb(data))\n }\n}\n\nconst enableOverlay = __HMR_ENABLE_OVERLAY__\n\nfunction createErrorOverlay(err: ErrorPayload['err']) {\n if (!enableOverlay) return\n clearErrorOverlay()\n document.body.appendChild(new ErrorOverlay(err))\n}\n\nfunction clearErrorOverlay() {\n document\n .querySelectorAll(overlayId)\n .forEach((n) => (n as ErrorOverlay).close())\n}\n\nfunction hasErrorOverlay() {\n return document.querySelectorAll(overlayId).length\n}\n\nlet pending = false\nlet queued: Promise<(() => void) | undefined>[] = []\n\n/**\n * buffer multiple hot updates triggered by the same src change\n * so that they are invoked in the same order they were sent.\n * (otherwise the order may be inconsistent because of the http request round trip)\n */\nasync function queueUpdate(p: Promise<(() => void) | undefined>) {\n queued.push(p)\n if (!pending) {\n pending = true\n await Promise.resolve()\n pending = false\n const loading = [...queued]\n queued = []\n ;(await Promise.all(loading)).forEach((fn) => fn && fn())\n }\n}\n\nasync function waitForSuccessfulPing(\n socketProtocol: string,\n hostAndPath: string,\n ms = 1000,\n) {\n const pingHostProtocol = socketProtocol === 'wss' ? 'https' : 'http'\n\n // eslint-disable-next-line no-constant-condition\n while (true) {\n try {\n // A fetch on a websocket URL will return a successful promise with status 400,\n // but will reject a networking error.\n // When running on middleware mode, it returns status 426, and an cors error happens if mode is not no-cors\n await fetch(`${pingHostProtocol}://${hostAndPath}`, {\n mode: 'no-cors',\n })\n break\n } catch (e) {\n // wait ms before attempting to ping again\n await new Promise((resolve) => setTimeout(resolve, ms))\n }\n }\n}\n\n// https://wicg.github.io/construct-stylesheets\nconst supportsConstructedSheet = (() => {\n // TODO: re-enable this try block once Chrome fixes the performance of\n // rule insertion in really big stylesheets\n // try {\n // new CSSStyleSheet()\n // return true\n // } catch (e) {}\n return false\n})()\n\nconst sheetsMap = new Map<\n string,\n HTMLStyleElement | CSSStyleSheet | undefined\n>()\n\nexport function updateStyle(id: string, content: string): void {\n let style = sheetsMap.get(id)\n if (supportsConstructedSheet && !content.includes('@import')) {\n if (style && !(style instanceof CSSStyleSheet)) {\n removeStyle(id)\n style = undefined\n }\n\n if (!style) {\n style = new CSSStyleSheet()\n style.replaceSync(content)\n document.adoptedStyleSheets = [...document.adoptedStyleSheets, style]\n } else {\n style.replaceSync(content)\n }\n } else {\n if (style && !(style instanceof HTMLStyleElement)) {\n removeStyle(id)\n style = undefined\n }\n\n if (!style) {\n style = document.createElement('style')\n style.setAttribute('type', 'text/css')\n style.setAttribute('data-vite-dev-id', id)\n style.textContent = content\n document.head.appendChild(style)\n } else {\n style.textContent = content\n }\n }\n sheetsMap.set(id, style)\n}\n\nexport function removeStyle(id: string): void {\n const style = sheetsMap.get(id)\n if (style) {\n if (style instanceof CSSStyleSheet) {\n document.adoptedStyleSheets = document.adoptedStyleSheets.filter(\n (s: CSSStyleSheet) => s !== style,\n )\n } else {\n document.head.removeChild(style)\n }\n sheetsMap.delete(id)\n }\n}\n\nasync function fetchUpdate({\n path,\n acceptedPath,\n timestamp,\n explicitImportRequired,\n}: Update) {\n const mod = hotModulesMap.get(path)\n if (!mod) {\n // In a code-splitting project,\n // it is common that the hot-updating module is not loaded yet.\n // https://github.com/vitejs/vite/issues/721\n return\n }\n\n let fetchedModule: ModuleNamespace | undefined\n const isSelfUpdate = path === acceptedPath\n\n // determine the qualified callbacks before we re-import the modules\n const qualifiedCallbacks = mod.callbacks.filter(({ deps }) =>\n deps.includes(acceptedPath),\n )\n\n if (isSelfUpdate || qualifiedCallbacks.length > 0) {\n const disposer = disposeMap.get(acceptedPath)\n if (disposer) await disposer(dataMap.get(acceptedPath))\n const [acceptedPathWithoutQuery, query] = acceptedPath.split(`?`)\n try {\n fetchedModule = await import(\n /* @vite-ignore */\n base +\n acceptedPathWithoutQuery.slice(1) +\n `?${explicitImportRequired ? 'import&' : ''}t=${timestamp}${\n query ? `&${query}` : ''\n }`\n )\n } catch (e) {\n warnFailedFetch(e, acceptedPath)\n }\n }\n\n return () => {\n for (const { deps, fn } of qualifiedCallbacks) {\n fn(deps.map((dep) => (dep === acceptedPath ? fetchedModule : undefined)))\n }\n const loggedPath = isSelfUpdate ? path : `${acceptedPath} via ${path}`\n console.debug(`[vite] hot updated: ${loggedPath}`)\n }\n}\n\nfunction sendMessageBuffer() {\n if (socket.readyState === 1) {\n messageBuffer.forEach((msg) => socket.send(msg))\n messageBuffer.length = 0\n }\n}\n\ninterface HotModule {\n id: string\n callbacks: HotCallback[]\n}\n\ninterface HotCallback {\n // the dependencies must be fetchable paths\n deps: string[]\n fn: (modules: Array<ModuleNamespace | undefined>) => void\n}\n\ntype CustomListenersMap = Map<string, ((data: any) => void)[]>\n\nconst hotModulesMap = new Map<string, HotModule>()\nconst disposeMap = new Map<string, (data: any) => void | Promise<void>>()\nconst pruneMap = new Map<string, (data: any) => void | Promise<void>>()\nconst dataMap = new Map<string, any>()\nconst customListenersMap: CustomListenersMap = new Map()\nconst ctxToListenersMap = new Map<string, CustomListenersMap>()\n\nexport function createHotContext(ownerPath: string): ViteHotContext {\n if (!dataMap.has(ownerPath)) {\n dataMap.set(ownerPath, {})\n }\n\n // when a file is hot updated, a new context is created\n // clear its stale callbacks\n const mod = hotModulesMap.get(ownerPath)\n if (mod) {\n mod.callbacks = []\n }\n\n // clear stale custom event listeners\n const staleListeners = ctxToListenersMap.get(ownerPath)\n if (staleListeners) {\n for (const [event, staleFns] of staleListeners) {\n const listeners = customListenersMap.get(event)\n if (listeners) {\n customListenersMap.set(\n event,\n listeners.filter((l) => !staleFns.includes(l)),\n )\n }\n }\n }\n\n const newListeners: CustomListenersMap = new Map()\n ctxToListenersMap.set(ownerPath, newListeners)\n\n function acceptDeps(deps: string[], callback: HotCallback['fn'] = () => {}) {\n const mod: HotModule = hotModulesMap.get(ownerPath) || {\n id: ownerPath,\n callbacks: [],\n }\n mod.callbacks.push({\n deps,\n fn: callback,\n })\n hotModulesMap.set(ownerPath, mod)\n }\n\n const hot: ViteHotContext = {\n get data() {\n return dataMap.get(ownerPath)\n },\n\n accept(deps?: any, callback?: any) {\n if (typeof deps === 'function' || !deps) {\n // self-accept: hot.accept(() => {})\n acceptDeps([ownerPath], ([mod]) => deps?.(mod))\n } else if (typeof deps === 'string') {\n // explicit deps\n acceptDeps([deps], ([mod]) => callback?.(mod))\n } else if (Array.isArray(deps)) {\n acceptDeps(deps, callback)\n } else {\n throw new Error(`invalid hot.accept() usage.`)\n }\n },\n\n // export names (first arg) are irrelevant on the client side, they're\n // extracted in the server for propagation\n acceptExports(_, callback) {\n acceptDeps([ownerPath], ([mod]) => callback?.(mod))\n },\n\n dispose(cb) {\n disposeMap.set(ownerPath, cb)\n },\n\n prune(cb) {\n pruneMap.set(ownerPath, cb)\n },\n\n // Kept for backward compatibility (#11036)\n // @ts-expect-error untyped\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n decline() {},\n\n // tell the server to re-perform hmr propagation from this module as root\n invalidate(message) {\n notifyListeners('vite:invalidate', { path: ownerPath, message })\n this.send('vite:invalidate', { path: ownerPath, message })\n console.debug(\n `[vite] invalidate ${ownerPath}${message ? `: ${message}` : ''}`,\n )\n },\n\n // custom events\n on(event, cb) {\n const addToMap = (map: Map<string, any[]>) => {\n const existing = map.get(event) || []\n existing.push(cb)\n map.set(event, existing)\n }\n addToMap(customListenersMap)\n addToMap(newListeners)\n },\n\n send(event, data) {\n messageBuffer.push(JSON.stringify({ type: 'custom', event, data }))\n sendMessageBuffer()\n },\n }\n\n return hot\n}\n\n/**\n * urls here are dynamic import() urls that couldn't be statically analyzed\n */\nexport function injectQuery(url: string, queryToInject: string): string {\n // skip urls that won't be handled by vite\n if (!url.startsWith('.') && !url.startsWith('/')) {\n return url\n }\n\n // can't use pathname from URL since it may be relative like ../\n const pathname = url.replace(/#.*$/, '').replace(/\\?.*$/, '')\n const { search, hash } = new URL(url, 'http://vitejs.dev')\n\n return `${pathname}?${queryToInject}${search ? `&` + search.slice(1) : ''}${\n hash || ''\n }`\n}\n\nexport { ErrorOverlay }\n"],"names":["base"],"mappings":";;AAKA,MAAMA,MAAI,GAAG,QAAQ,IAAI,GAAG,CAAA;AAE5B;AACA,MAAM,QAAQ,YAAY,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4HzB,CAAA;AAED,MAAM,MAAM,GAAG,gCAAgC,CAAA;AAC/C,MAAM,WAAW,GAAG,0CAA0C,CAAA;AAE9D;AACA;AACA,MAAM,EAAE,WAAW,GAAG,MAAA;CAAyC,EAAE,GAAG,UAAU,CAAA;AACxE,MAAO,YAAa,SAAQ,WAAW,CAAA;AAG3C,IAAA,WAAA,CAA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AAA;SACvB;QAED,IAAI,CAAC,KAAK,EAAE,IAAI,EAAA;AACd,YAAA,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;AACnE,YAAA,iBAAiB,EAAE,CAAA;SACpB;KACF,CAAA;AAED,IAAA,OAAO,GAAG,CAAA;AACZ,CAAC;AAED;;AAEG;AACa,SAAA,WAAW,CAAC,GAAW,EAAE,aAAqB,EAAA;;AAE5D,IAAA,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;AAChD,QAAA,OAAO,GAAG,CAAA;AACX,KAAA;;AAGD,IAAA,MAAM,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA;AAC7D,IAAA,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,GAAG,CAAC,GAAG,EAAE,mBAAmB,CAAC,CAAA;IAE1D,OAAO,CAAA,EAAG,QAAQ,CAAA,CAAA,EAAI,aAAa,CAAA,EAAG,MAAM,GAAG,CAAG,CAAA,CAAA,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,EAAE,CAAA,EACvE,IAAI,IAAI,EACV,CAAA,CAAE,CAAA;AACJ;;;;"}
|
|
@@ -7295,7 +7295,7 @@ function isReference(node, parent) {
|
|
|
7295
7295
|
return false;
|
|
7296
7296
|
}
|
|
7297
7297
|
|
|
7298
|
-
var version$3 = "23.0.
|
|
7298
|
+
var version$3 = "23.0.4";
|
|
7299
7299
|
var peerDependencies = {
|
|
7300
7300
|
rollup: "^2.68.0||^3.0.0"
|
|
7301
7301
|
};
|
|
@@ -12175,10 +12175,8 @@ async function resolveServerUrls(server, options, config) {
|
|
|
12175
12175
|
.flatMap((nInterface) => nInterface ?? [])
|
|
12176
12176
|
.filter((detail) => detail &&
|
|
12177
12177
|
detail.address &&
|
|
12178
|
-
// Node < v18
|
|
12179
12178
|
((typeof detail.family === 'string' && detail.family === 'IPv4') ||
|
|
12180
|
-
// Node
|
|
12181
|
-
// @ts-expect-error
|
|
12179
|
+
// @ts-expect-error Node 18.0 - 18.3 returns number
|
|
12182
12180
|
(typeof detail.family === 'number' && detail.family === 4)))
|
|
12183
12181
|
.forEach((detail) => {
|
|
12184
12182
|
const host = detail.address.replace('127.0.0.1', hostname.name);
|
|
@@ -12203,7 +12201,7 @@ function toUpperCaseDriveLetter(pathName) {
|
|
|
12203
12201
|
const multilineCommentsRE$1 = /\/\*[^*]*\*+(?:[^/*][^*]*\*+)*\//g;
|
|
12204
12202
|
const singlelineCommentsRE$1 = /\/\/.*/g;
|
|
12205
12203
|
const requestQuerySplitRE = /\?(?!.*[/|}])/;
|
|
12206
|
-
// @ts-expect-error
|
|
12204
|
+
// @ts-expect-error jest only exists when running Jest
|
|
12207
12205
|
const usingDynamicImport = typeof jest === 'undefined';
|
|
12208
12206
|
/**
|
|
12209
12207
|
* Dynamically import files. It will make sure it's not being compiled away by TS/Rollup.
|
|
@@ -12421,23 +12419,11 @@ const isNonDriveRelativeAbsolutePath = (p) => {
|
|
|
12421
12419
|
* Determine if a file is being requested with the correct case, to ensure
|
|
12422
12420
|
* consistent behaviour between dev and prod and across operating systems.
|
|
12423
12421
|
*/
|
|
12424
|
-
function
|
|
12425
|
-
|
|
12426
|
-
|
|
12427
|
-
// like `await page.goto(viteTestUrl + '/example')` giving us URLs beginning with a double slash
|
|
12428
|
-
const pathname = decodeURI(new URL$3(url.startsWith('//') ? url.substring(1) : url, 'http://example.com').pathname);
|
|
12429
|
-
const file = path$o.join(assetsDir, pathname);
|
|
12430
|
-
if (!fs$l.existsSync(file) ||
|
|
12431
|
-
(isCaseInsensitiveFS && // can skip case check on Linux
|
|
12432
|
-
!fs$l.statSync(file).isDirectory() &&
|
|
12433
|
-
!hasCorrectCase(file, assetsDir))) {
|
|
12434
|
-
return false;
|
|
12435
|
-
}
|
|
12422
|
+
function shouldServeFile(filePath, root) {
|
|
12423
|
+
// can skip case check on Linux
|
|
12424
|
+
if (!isCaseInsensitiveFS)
|
|
12436
12425
|
return true;
|
|
12437
|
-
|
|
12438
|
-
catch (err) {
|
|
12439
|
-
return false;
|
|
12440
|
-
}
|
|
12426
|
+
return hasCorrectCase(filePath, root);
|
|
12441
12427
|
}
|
|
12442
12428
|
/**
|
|
12443
12429
|
* Note that we can't use realpath here, because we don't want to follow
|
|
@@ -13378,7 +13364,7 @@ async function transformWithEsbuild(code, filename, options, inMap) {
|
|
|
13378
13364
|
const loadedCompilerOptions = loadedTsconfig.compilerOptions ?? {};
|
|
13379
13365
|
for (const field of meaningfulFields) {
|
|
13380
13366
|
if (field in loadedCompilerOptions) {
|
|
13381
|
-
// @ts-
|
|
13367
|
+
// @ts-expect-error TypeScript can't tell they are of the same type
|
|
13382
13368
|
compilerOptionsForFile[field] = loadedCompilerOptions[field];
|
|
13383
13369
|
}
|
|
13384
13370
|
}
|
|
@@ -13390,6 +13376,23 @@ async function transformWithEsbuild(code, filename, options, inMap) {
|
|
|
13390
13376
|
...tsconfigRaw?.compilerOptions,
|
|
13391
13377
|
},
|
|
13392
13378
|
};
|
|
13379
|
+
const { compilerOptions } = tsconfigRaw;
|
|
13380
|
+
if (compilerOptions) {
|
|
13381
|
+
// esbuild derives `useDefineForClassFields` from `target` instead of `tsconfig.compilerOptions.target`
|
|
13382
|
+
// https://github.com/evanw/esbuild/issues/2584
|
|
13383
|
+
// but we want `useDefineForClassFields` to be derived from `tsconfig.compilerOptions.target`
|
|
13384
|
+
if (compilerOptions.useDefineForClassFields === undefined) {
|
|
13385
|
+
const lowercaseTarget = compilerOptions.target?.toLowerCase() ?? 'es3';
|
|
13386
|
+
if (lowercaseTarget.startsWith('es')) {
|
|
13387
|
+
const esVersion = lowercaseTarget.slice(2);
|
|
13388
|
+
compilerOptions.useDefineForClassFields =
|
|
13389
|
+
esVersion === 'next' || +esVersion >= 2022;
|
|
13390
|
+
}
|
|
13391
|
+
else {
|
|
13392
|
+
compilerOptions.useDefineForClassFields = false;
|
|
13393
|
+
}
|
|
13394
|
+
}
|
|
13395
|
+
}
|
|
13393
13396
|
}
|
|
13394
13397
|
const resolvedOptions = {
|
|
13395
13398
|
sourcemap: true,
|
|
@@ -13529,7 +13532,7 @@ const buildEsbuildPlugin = (config) => {
|
|
|
13529
13532
|
await initTSConfck(config);
|
|
13530
13533
|
},
|
|
13531
13534
|
async renderChunk(code, chunk, opts) {
|
|
13532
|
-
// @ts-
|
|
13535
|
+
// @ts-expect-error injected by @vitejs/plugin-legacy
|
|
13533
13536
|
if (opts.__vite_skip_esbuild__) {
|
|
13534
13537
|
return null;
|
|
13535
13538
|
}
|
|
@@ -13843,7 +13846,7 @@ function terserPlugin(config) {
|
|
|
13843
13846
|
// so that normal chunks can use the preferred minifier, and legacy chunks
|
|
13844
13847
|
// can use terser.
|
|
13845
13848
|
if (config.build.minify !== 'terser' &&
|
|
13846
|
-
// @ts-
|
|
13849
|
+
// @ts-expect-error injected by @vitejs/plugin-legacy
|
|
13847
13850
|
!outputOptions.__vite_force_terser__) {
|
|
13848
13851
|
return null;
|
|
13849
13852
|
}
|
|
@@ -22241,7 +22244,7 @@ function webWorkerPlugin(config) {
|
|
|
22241
22244
|
return result();
|
|
22242
22245
|
},
|
|
22243
22246
|
generateBundle(opts) {
|
|
22244
|
-
// @ts-
|
|
22247
|
+
// @ts-expect-error asset emits are skipped in legacy bundle
|
|
22245
22248
|
if (opts.__vite_skip_asset_emit__ || isWorker) {
|
|
22246
22249
|
return;
|
|
22247
22250
|
}
|
|
@@ -22797,12 +22800,14 @@ async function tryOptimizedResolve(depsOptimizer, id, importer) {
|
|
|
22797
22800
|
// We should be able to remove this in the future
|
|
22798
22801
|
await depsOptimizer.scanProcessing;
|
|
22799
22802
|
const metadata = depsOptimizer.metadata;
|
|
22800
|
-
|
|
22801
|
-
|
|
22802
|
-
|
|
22803
|
-
|
|
22804
|
-
|
|
22803
|
+
if (!importer) {
|
|
22804
|
+
// no importer. try our best to find an optimized dep
|
|
22805
|
+
const depInfo = optimizedDepInfoFromId(metadata, id);
|
|
22806
|
+
if (depInfo) {
|
|
22807
|
+
return depsOptimizer.getOptimizedDepId(depInfo);
|
|
22808
|
+
}
|
|
22805
22809
|
return;
|
|
22810
|
+
}
|
|
22806
22811
|
// further check if id is imported by nested dependency
|
|
22807
22812
|
let resolvedSrc;
|
|
22808
22813
|
for (const optimizedData of metadata.depInfoList) {
|
|
@@ -36388,12 +36393,12 @@ function formatParseError(parserError, id, html) {
|
|
|
36388
36393
|
const formattedError = {
|
|
36389
36394
|
code: parserError.code,
|
|
36390
36395
|
message: `parse5 error code ${parserError.code}`,
|
|
36391
|
-
|
|
36392
|
-
|
|
36393
|
-
|
|
36394
|
-
|
|
36395
|
-
|
|
36396
|
-
|
|
36396
|
+
frame: generateCodeFrame(html, parserError.startOffset),
|
|
36397
|
+
loc: {
|
|
36398
|
+
file: id,
|
|
36399
|
+
line: parserError.startLine,
|
|
36400
|
+
column: parserError.startCol,
|
|
36401
|
+
},
|
|
36397
36402
|
};
|
|
36398
36403
|
return formattedError;
|
|
36399
36404
|
}
|
|
@@ -36413,12 +36418,10 @@ function handleParseError(parserError, html, filePath) {
|
|
|
36413
36418
|
// Allow self closing on non-void elements #10439
|
|
36414
36419
|
return;
|
|
36415
36420
|
}
|
|
36416
|
-
const parseError =
|
|
36417
|
-
|
|
36418
|
-
|
|
36419
|
-
|
|
36420
|
-
};
|
|
36421
|
-
throw new Error(`Unable to parse HTML; ${parseError.message}\n at ${JSON.stringify(parseError.loc)}\n${parseError.frame}`);
|
|
36421
|
+
const parseError = formatParseError(parserError, filePath, html);
|
|
36422
|
+
throw new Error(`Unable to parse HTML; ${parseError.message}\n` +
|
|
36423
|
+
` at ${parseError.loc.file}:${parseError.loc.line}:${parseError.loc.column}\n` +
|
|
36424
|
+
`${parseError.frame}`);
|
|
36422
36425
|
}
|
|
36423
36426
|
/**
|
|
36424
36427
|
* Compiles index.html into an entry js module
|
|
@@ -37407,7 +37410,7 @@ function cssPostPlugin(config) {
|
|
|
37407
37410
|
return null;
|
|
37408
37411
|
},
|
|
37409
37412
|
async generateBundle(opts, bundle) {
|
|
37410
|
-
// @ts-
|
|
37413
|
+
// @ts-expect-error asset emits are skipped in legacy bundle
|
|
37411
37414
|
if (opts.__vite_skip_asset_emit__) {
|
|
37412
37415
|
return;
|
|
37413
37416
|
}
|
|
@@ -37585,7 +37588,7 @@ async function compileCSS(id, code, config, urlReplacer) {
|
|
|
37585
37588
|
}
|
|
37586
37589
|
const postcssPlugins = postcssConfig && postcssConfig.plugins ? postcssConfig.plugins.slice() : [];
|
|
37587
37590
|
if (needInlineImport) {
|
|
37588
|
-
postcssPlugins.unshift((await import('./dep-
|
|
37591
|
+
postcssPlugins.unshift((await import('./dep-a1fa0d33.js').then(function (n) { return n.i; })).default({
|
|
37589
37592
|
async resolve(id, basedir) {
|
|
37590
37593
|
const publicFile = checkPublicFile(id, config);
|
|
37591
37594
|
if (publicFile) {
|
|
@@ -37609,7 +37612,7 @@ async function compileCSS(id, code, config, urlReplacer) {
|
|
|
37609
37612
|
}));
|
|
37610
37613
|
}
|
|
37611
37614
|
if (isModule) {
|
|
37612
|
-
postcssPlugins.unshift((await import('./dep-
|
|
37615
|
+
postcssPlugins.unshift((await import('./dep-ec9f7a0d.js').then(function (n) { return n.i; })).default({
|
|
37613
37616
|
...modulesOptions,
|
|
37614
37617
|
localsConvention: modulesOptions?.localsConvention,
|
|
37615
37618
|
getJSON(cssFileName, _modules, outputFileName) {
|
|
@@ -37784,7 +37787,6 @@ async function resolvePostcssConfig(config, dialect = 'css') {
|
|
|
37784
37787
|
else {
|
|
37785
37788
|
const searchPath = typeof inlineOptions === 'string' ? inlineOptions : config.root;
|
|
37786
37789
|
try {
|
|
37787
|
-
// @ts-ignore
|
|
37788
37790
|
result = await src$1({}, searchPath);
|
|
37789
37791
|
}
|
|
37790
37792
|
catch (e) {
|
|
@@ -38034,11 +38036,9 @@ function fixScssBugImportValue(data) {
|
|
|
38034
38036
|
typeof window !== 'undefined' &&
|
|
38035
38037
|
typeof location !== 'undefined' &&
|
|
38036
38038
|
data &&
|
|
38037
|
-
|
|
38038
|
-
data.
|
|
38039
|
-
// @ts-expect-error
|
|
38040
|
-
data.contents == null) {
|
|
38041
|
-
// @ts-expect-error
|
|
38039
|
+
'file' in data &&
|
|
38040
|
+
(!('contents' in data) || data.contents == null)) {
|
|
38041
|
+
// @ts-expect-error we need to preserve file property for HMR
|
|
38042
38042
|
data.contents = fs$l.readFileSync(data.file, 'utf-8');
|
|
38043
38043
|
}
|
|
38044
38044
|
return data;
|
|
@@ -39897,7 +39897,7 @@ function viaCache(cache, uri, extns) {
|
|
|
39897
39897
|
}
|
|
39898
39898
|
}
|
|
39899
39899
|
|
|
39900
|
-
function viaLocal(dir, isEtag, uri, extns) {
|
|
39900
|
+
function viaLocal(dir, isEtag, uri, extns, shouldServe) {
|
|
39901
39901
|
let i=0, arr=toAssume(uri, extns);
|
|
39902
39902
|
let abs, stats, name, headers;
|
|
39903
39903
|
for (; i < arr.length; i++) {
|
|
@@ -39905,6 +39905,7 @@ function viaLocal(dir, isEtag, uri, extns) {
|
|
|
39905
39905
|
if (abs.startsWith(dir) && require$$0$2.existsSync(abs)) {
|
|
39906
39906
|
stats = require$$0$2.statSync(abs);
|
|
39907
39907
|
if (stats.isDirectory()) continue;
|
|
39908
|
+
if (shouldServe && !shouldServe(abs)) continue;
|
|
39908
39909
|
headers = toHeaders(name, stats, isEtag);
|
|
39909
39910
|
headers['Cache-Control'] = isEtag ? 'no-cache' : 'no-store';
|
|
39910
39911
|
return { abs, stats, headers };
|
|
@@ -40034,7 +40035,7 @@ function sirv (dir, opts={}) {
|
|
|
40034
40035
|
catch (err) { /* malform uri */ }
|
|
40035
40036
|
}
|
|
40036
40037
|
|
|
40037
|
-
let data = lookup(pathname, extns) || isSPA && !isMatch(pathname, ignores) && lookup(fallback, extns);
|
|
40038
|
+
let data = lookup(pathname, extns, opts.shouldServe) || isSPA && !isMatch(pathname, ignores) && lookup(fallback, extns, opts.shouldServe);
|
|
40038
40039
|
if (!data) return next ? next() : isNotFound(req, res);
|
|
40039
40040
|
|
|
40040
40041
|
if (isEtag && req.headers['if-none-match'] === data.headers['ETag']) {
|
|
@@ -40051,7 +40052,7 @@ function sirv (dir, opts={}) {
|
|
|
40051
40052
|
};
|
|
40052
40053
|
}
|
|
40053
40054
|
|
|
40054
|
-
const sirvOptions = (headers) => {
|
|
40055
|
+
const sirvOptions = ({ headers, shouldServe, }) => {
|
|
40055
40056
|
return {
|
|
40056
40057
|
dev: true,
|
|
40057
40058
|
etag: true,
|
|
@@ -40071,24 +40072,27 @@ const sirvOptions = (headers) => {
|
|
|
40071
40072
|
}
|
|
40072
40073
|
}
|
|
40073
40074
|
},
|
|
40075
|
+
shouldServe,
|
|
40074
40076
|
};
|
|
40075
40077
|
};
|
|
40076
40078
|
function servePublicMiddleware(dir, headers) {
|
|
40077
|
-
const serve = sirv(dir, sirvOptions(
|
|
40079
|
+
const serve = sirv(dir, sirvOptions({
|
|
40080
|
+
headers,
|
|
40081
|
+
shouldServe: (filePath) => shouldServeFile(filePath, dir),
|
|
40082
|
+
}));
|
|
40078
40083
|
// Keep the named function. The name is visible in debug logs via `DEBUG=connect:dispatcher ...`
|
|
40079
40084
|
return function viteServePublicMiddleware(req, res, next) {
|
|
40080
40085
|
// skip import request and internal requests `/@fs/ /@vite-client` etc...
|
|
40081
40086
|
if (isImportRequest(req.url) || isInternalRequest(req.url)) {
|
|
40082
40087
|
return next();
|
|
40083
40088
|
}
|
|
40084
|
-
|
|
40085
|
-
return serve(req, res, next);
|
|
40086
|
-
}
|
|
40087
|
-
next();
|
|
40089
|
+
serve(req, res, next);
|
|
40088
40090
|
};
|
|
40089
40091
|
}
|
|
40090
40092
|
function serveStaticMiddleware(dir, server) {
|
|
40091
|
-
const serve = sirv(dir, sirvOptions(
|
|
40093
|
+
const serve = sirv(dir, sirvOptions({
|
|
40094
|
+
headers: server.config.server.headers,
|
|
40095
|
+
}));
|
|
40092
40096
|
// Keep the named function. The name is visible in debug logs via `DEBUG=connect:dispatcher ...`
|
|
40093
40097
|
return function viteServeStaticMiddleware(req, res, next) {
|
|
40094
40098
|
// only serve the file if it's not an html request or ends with `/`
|
|
@@ -40136,7 +40140,7 @@ function serveStaticMiddleware(dir, server) {
|
|
|
40136
40140
|
};
|
|
40137
40141
|
}
|
|
40138
40142
|
function serveRawFsMiddleware(server) {
|
|
40139
|
-
const serveFromRoot = sirv('/', sirvOptions(server.config.server.headers));
|
|
40143
|
+
const serveFromRoot = sirv('/', sirvOptions({ headers: server.config.server.headers }));
|
|
40140
40144
|
// Keep the named function. The name is visible in debug logs via `DEBUG=connect:dispatcher ...`
|
|
40141
40145
|
return function viteServeRawFsMiddleware(req, res, next) {
|
|
40142
40146
|
const url = new URL(req.url, 'http://example.com');
|
|
@@ -40695,26 +40699,6 @@ function importAnalysisPlugin(config) {
|
|
|
40695
40699
|
if (!isDynamicImport && assertIndex > -1) {
|
|
40696
40700
|
str().remove(end + 1, expEnd);
|
|
40697
40701
|
}
|
|
40698
|
-
if (!isDynamicImport &&
|
|
40699
|
-
specifier &&
|
|
40700
|
-
!specifier.includes('?') && // ignore custom queries
|
|
40701
|
-
isCSSRequest(specifier) &&
|
|
40702
|
-
!isModuleCSSRequest(specifier)) {
|
|
40703
|
-
const sourceExp = source.slice(expStart, start);
|
|
40704
|
-
if (sourceExp.includes('from') && // check default and named imports
|
|
40705
|
-
!sourceExp.includes('__vite_glob_') // glob handles deprecation message itself
|
|
40706
|
-
) {
|
|
40707
|
-
const newImport = sourceExp + specifier + `?inline` + source.slice(end, expEnd);
|
|
40708
|
-
this.warn(`\n` +
|
|
40709
|
-
picocolors.exports.cyan(importerModule.file) +
|
|
40710
|
-
`\n` +
|
|
40711
|
-
picocolors.exports.reset(generateCodeFrame(source, start)) +
|
|
40712
|
-
`\n` +
|
|
40713
|
-
picocolors.exports.yellow(`Default and named imports from CSS files are deprecated. ` +
|
|
40714
|
-
`Use the ?inline query instead. ` +
|
|
40715
|
-
`For example: ${newImport}`));
|
|
40716
|
-
}
|
|
40717
|
-
}
|
|
40718
40702
|
// static import or valid string in dynamic import
|
|
40719
40703
|
// If resolvable, let's resolve it
|
|
40720
40704
|
if (specifier) {
|
|
@@ -40751,6 +40735,26 @@ function importAnalysisPlugin(config) {
|
|
|
40751
40735
|
}
|
|
40752
40736
|
// normalize
|
|
40753
40737
|
const [url, resolvedId] = await normalizeUrl(specifier, start);
|
|
40738
|
+
if (!isDynamicImport &&
|
|
40739
|
+
specifier &&
|
|
40740
|
+
!specifier.includes('?') && // ignore custom queries
|
|
40741
|
+
isCSSRequest(resolvedId) &&
|
|
40742
|
+
!isModuleCSSRequest(resolvedId)) {
|
|
40743
|
+
const sourceExp = source.slice(expStart, start);
|
|
40744
|
+
if (sourceExp.includes('from') && // check default and named imports
|
|
40745
|
+
!sourceExp.includes('__vite_glob_') // glob handles deprecation message itself
|
|
40746
|
+
) {
|
|
40747
|
+
const newImport = sourceExp + specifier + `?inline` + source.slice(end, expEnd);
|
|
40748
|
+
this.warn(`\n` +
|
|
40749
|
+
picocolors.exports.cyan(importerModule.file) +
|
|
40750
|
+
`\n` +
|
|
40751
|
+
picocolors.exports.reset(generateCodeFrame(source, start)) +
|
|
40752
|
+
`\n` +
|
|
40753
|
+
picocolors.exports.yellow(`Default and named imports from CSS files are deprecated. ` +
|
|
40754
|
+
`Use the ?inline query instead. ` +
|
|
40755
|
+
`For example: ${newImport}`));
|
|
40756
|
+
}
|
|
40757
|
+
}
|
|
40754
40758
|
// record as safe modules
|
|
40755
40759
|
server?.moduleGraph.safeModulesPath.add(fsPathFromUrl(url));
|
|
40756
40760
|
if (url !== specifier) {
|
|
@@ -41072,7 +41076,7 @@ function clientInjectionsPlugin(config) {
|
|
|
41072
41076
|
}
|
|
41073
41077
|
return code
|
|
41074
41078
|
.replace(`__MODE__`, JSON.stringify(config.mode))
|
|
41075
|
-
.replace(
|
|
41079
|
+
.replace(/__BASE__/g, JSON.stringify(devBase))
|
|
41076
41080
|
.replace(`__DEFINES__`, serializeDefine(config.define || {}))
|
|
41077
41081
|
.replace(`__SERVER_HOST__`, JSON.stringify(serverHost))
|
|
41078
41082
|
.replace(`__HMR_PROTOCOL__`, JSON.stringify(protocol))
|
|
@@ -41112,7 +41116,6 @@ const wasmHelper = async (opts = {}, url) => {
|
|
|
41112
41116
|
bytes = Buffer.from(urlContent, 'base64');
|
|
41113
41117
|
}
|
|
41114
41118
|
else if (typeof atob === 'function') {
|
|
41115
|
-
// @ts-ignore
|
|
41116
41119
|
const binaryString = atob(urlContent);
|
|
41117
41120
|
bytes = new Uint8Array(binaryString.length);
|
|
41118
41121
|
for (let i = 0; i < binaryString.length; i++) {
|
|
@@ -41122,7 +41125,6 @@ const wasmHelper = async (opts = {}, url) => {
|
|
|
41122
41125
|
else {
|
|
41123
41126
|
throw new Error('Failed to decode base64-encoded data URL, Buffer and atob are not supported');
|
|
41124
41127
|
}
|
|
41125
|
-
// @ts-ignore
|
|
41126
41128
|
result = await WebAssembly.instantiate(bytes, opts);
|
|
41127
41129
|
}
|
|
41128
41130
|
else {
|
|
@@ -41131,19 +41133,14 @@ const wasmHelper = async (opts = {}, url) => {
|
|
|
41131
41133
|
// correct MIME type for .wasm files, which unfortunately doesn't work for
|
|
41132
41134
|
// a lot of static file servers, so we just work around it by getting the
|
|
41133
41135
|
// raw buffer.
|
|
41134
|
-
// @ts-ignore
|
|
41135
41136
|
const response = await fetch(url);
|
|
41136
41137
|
const contentType = response.headers.get('Content-Type') || '';
|
|
41137
|
-
if (
|
|
41138
|
-
// @ts-ignore
|
|
41139
|
-
'instantiateStreaming' in WebAssembly &&
|
|
41138
|
+
if ('instantiateStreaming' in WebAssembly &&
|
|
41140
41139
|
contentType.startsWith('application/wasm')) {
|
|
41141
|
-
// @ts-ignore
|
|
41142
41140
|
result = await WebAssembly.instantiateStreaming(response, opts);
|
|
41143
41141
|
}
|
|
41144
41142
|
else {
|
|
41145
41143
|
const buffer = await response.arrayBuffer();
|
|
41146
|
-
// @ts-ignore
|
|
41147
41144
|
result = await WebAssembly.instantiate(buffer, opts);
|
|
41148
41145
|
}
|
|
41149
41146
|
}
|
|
@@ -42173,7 +42170,7 @@ async function createPluginContainer(config, moduleGraph, watcher) {
|
|
|
42173
42170
|
const hook = plugin[hookName];
|
|
42174
42171
|
if (!hook)
|
|
42175
42172
|
continue;
|
|
42176
|
-
// @ts-expect-error
|
|
42173
|
+
// @ts-expect-error hook is not a primitive
|
|
42177
42174
|
const handler = 'handler' in hook ? hook.handler : hook;
|
|
42178
42175
|
if (hook.sequential) {
|
|
42179
42176
|
await Promise.all(parallelPromises);
|
|
@@ -43348,7 +43345,7 @@ async function createDepsOptimizer(config, server) {
|
|
|
43348
43345
|
metadata.discovered = {};
|
|
43349
43346
|
}
|
|
43350
43347
|
currentlyProcessing = false;
|
|
43351
|
-
// @ts-
|
|
43348
|
+
// @ts-expect-error `enqueuedRerun` could exist because `debouncedProcessing` may run while awaited
|
|
43352
43349
|
enqueuedRerun?.();
|
|
43353
43350
|
}
|
|
43354
43351
|
function fullReload() {
|
|
@@ -44321,26 +44318,22 @@ function toRelativePath(filename, importer) {
|
|
|
44321
44318
|
* the async chunk itself.
|
|
44322
44319
|
*/
|
|
44323
44320
|
function detectScriptRel() {
|
|
44324
|
-
// @ts-ignore
|
|
44325
44321
|
const relList = document.createElement('link').relList;
|
|
44326
|
-
// @ts-ignore
|
|
44327
44322
|
return relList && relList.supports && relList.supports('modulepreload')
|
|
44328
44323
|
? 'modulepreload'
|
|
44329
44324
|
: 'preload';
|
|
44330
44325
|
}
|
|
44331
44326
|
function preload(baseModule, deps, importerUrl) {
|
|
44332
|
-
// @ts-
|
|
44327
|
+
// @ts-expect-error __VITE_IS_MODERN__ will be replaced with boolean later
|
|
44333
44328
|
if (!__VITE_IS_MODERN__ || !deps || deps.length === 0) {
|
|
44334
44329
|
return baseModule();
|
|
44335
44330
|
}
|
|
44336
44331
|
const links = document.getElementsByTagName('link');
|
|
44337
44332
|
return Promise.all(deps.map((dep) => {
|
|
44338
|
-
// @ts-
|
|
44333
|
+
// @ts-expect-error assetsURL is declared before preload.toString()
|
|
44339
44334
|
dep = assetsURL(dep, importerUrl);
|
|
44340
|
-
// @ts-ignore
|
|
44341
44335
|
if (dep in seen)
|
|
44342
44336
|
return;
|
|
44343
|
-
// @ts-ignore
|
|
44344
44337
|
seen[dep] = true;
|
|
44345
44338
|
const isCss = dep.endsWith('.css');
|
|
44346
44339
|
const cssSelector = isCss ? '[rel="stylesheet"]' : '';
|
|
@@ -44361,16 +44354,13 @@ function preload(baseModule, deps, importerUrl) {
|
|
|
44361
44354
|
else if (document.querySelector(`link[href="${dep}"]${cssSelector}`)) {
|
|
44362
44355
|
return;
|
|
44363
44356
|
}
|
|
44364
|
-
// @ts-ignore
|
|
44365
44357
|
const link = document.createElement('link');
|
|
44366
|
-
// @ts-ignore
|
|
44367
44358
|
link.rel = isCss ? 'stylesheet' : scriptRel;
|
|
44368
44359
|
if (!isCss) {
|
|
44369
44360
|
link.as = 'script';
|
|
44370
44361
|
link.crossOrigin = '';
|
|
44371
44362
|
}
|
|
44372
44363
|
link.href = dep;
|
|
44373
|
-
// @ts-ignore
|
|
44374
44364
|
document.head.appendChild(link);
|
|
44375
44365
|
if (isCss) {
|
|
44376
44366
|
return new Promise((res, rej) => {
|
|
@@ -45246,6 +45236,10 @@ function loadEnv(mode, envDir, prefixes = 'VITE_') {
|
|
|
45246
45236
|
return [];
|
|
45247
45237
|
return Object.entries(parse_1$1(fs$l.readFileSync(path)));
|
|
45248
45238
|
}));
|
|
45239
|
+
// test NODE_ENV override before expand as otherwise process.env.NODE_ENV would override this
|
|
45240
|
+
if (parsed.NODE_ENV && process.env.VITE_USER_NODE_ENV === undefined) {
|
|
45241
|
+
process.env.VITE_USER_NODE_ENV = parsed.NODE_ENV;
|
|
45242
|
+
}
|
|
45249
45243
|
try {
|
|
45250
45244
|
// let environment variables use each other
|
|
45251
45245
|
expand_1({ parsed });
|
|
@@ -45263,11 +45257,6 @@ function loadEnv(mode, envDir, prefixes = 'VITE_') {
|
|
|
45263
45257
|
if (prefixes.some((prefix) => key.startsWith(prefix))) {
|
|
45264
45258
|
env[key] = value;
|
|
45265
45259
|
}
|
|
45266
|
-
else if (key === 'NODE_ENV' &&
|
|
45267
|
-
process.env.VITE_USER_NODE_ENV === undefined) {
|
|
45268
|
-
// NODE_ENV override in .env file
|
|
45269
|
-
process.env.VITE_USER_NODE_ENV = value;
|
|
45270
|
-
}
|
|
45271
45260
|
}
|
|
45272
45261
|
// check if there are actual env variables starting with VITE_*
|
|
45273
45262
|
// these are typically provided inline and should be prioritized
|
|
@@ -45489,8 +45478,7 @@ async function doBuild(inlineConfig = {}) {
|
|
|
45489
45478
|
};
|
|
45490
45479
|
try {
|
|
45491
45480
|
const buildOutputOptions = (output = {}) => {
|
|
45492
|
-
// See https://github.com/vitejs/vite/issues/5812#issuecomment-984345618
|
|
45493
|
-
// @ts-ignore
|
|
45481
|
+
// @ts-expect-error See https://github.com/vitejs/vite/issues/5812#issuecomment-984345618
|
|
45494
45482
|
if (output.output) {
|
|
45495
45483
|
config.logger.warn(`You've set "rollupOptions.output.output" in your config. ` +
|
|
45496
45484
|
`This is deprecated and will override all Vite.js default output options. ` +
|
|
@@ -53269,7 +53257,7 @@ async function nodeImport(id, importer, resolveOptions) {
|
|
|
53269
53257
|
const resolved = tryNodeResolve(id, importer,
|
|
53270
53258
|
// Non-external modules can import ESM-only modules, but only outside
|
|
53271
53259
|
// of test runs, because we use Node `require` in Jest to avoid segfault.
|
|
53272
|
-
// @ts-expect-error
|
|
53260
|
+
// @ts-expect-error jest only exists when running Jest
|
|
53273
53261
|
typeof jest === 'undefined'
|
|
53274
53262
|
? { ...resolveOptions, tryEsmOnly: true }
|
|
53275
53263
|
: resolveOptions, false);
|
|
@@ -54484,6 +54472,14 @@ const BASE_SHORTCUTS = [
|
|
|
54484
54472
|
await server.restart();
|
|
54485
54473
|
},
|
|
54486
54474
|
},
|
|
54475
|
+
{
|
|
54476
|
+
key: 'u',
|
|
54477
|
+
description: 'show server url',
|
|
54478
|
+
action(server) {
|
|
54479
|
+
server.config.logger.info('');
|
|
54480
|
+
server.printUrls();
|
|
54481
|
+
},
|
|
54482
|
+
},
|
|
54487
54483
|
{
|
|
54488
54484
|
key: 'o',
|
|
54489
54485
|
description: 'open in browser',
|
|
@@ -59838,7 +59834,7 @@ var debug_1 = function () {
|
|
|
59838
59834
|
if (!debug$3) {
|
|
59839
59835
|
try {
|
|
59840
59836
|
/* eslint global-require: off */
|
|
59841
|
-
debug$3 =
|
|
59837
|
+
debug$3 = src$2.exports("follow-redirects");
|
|
59842
59838
|
}
|
|
59843
59839
|
catch (error) { /* */ }
|
|
59844
59840
|
if (typeof debug$3 !== "function") {
|
|
@@ -61591,7 +61587,7 @@ const devHtmlHook = async (html, { path: htmlPath, filename, server, originalUrl
|
|
|
61591
61587
|
}
|
|
61592
61588
|
s.update(node.sourceCodeLocation.startOffset, node.sourceCodeLocation.endOffset, `<script type="module" src="${modulePath}"></script>`);
|
|
61593
61589
|
};
|
|
61594
|
-
await traverseHtml(html,
|
|
61590
|
+
await traverseHtml(html, filename, (node) => {
|
|
61595
61591
|
if (!nodeIsElement(node)) {
|
|
61596
61592
|
return;
|
|
61597
61593
|
}
|
|
@@ -61682,7 +61678,6 @@ function timeMiddleware(root) {
|
|
|
61682
61678
|
const end = res.end;
|
|
61683
61679
|
res.end = (...args) => {
|
|
61684
61680
|
logTime(`${timeFrom(start)} ${prettifyUrl(req.url, root)}`);
|
|
61685
|
-
// @ts-ignore
|
|
61686
61681
|
return end.call(res, ...args);
|
|
61687
61682
|
};
|
|
61688
61683
|
next();
|
|
@@ -62234,7 +62229,6 @@ function resolveServerOptions(root, raw, logger) {
|
|
|
62234
62229
|
return server;
|
|
62235
62230
|
}
|
|
62236
62231
|
async function restartServer(server) {
|
|
62237
|
-
// @ts-ignore
|
|
62238
62232
|
global.__vite_start_time = performance.now();
|
|
62239
62233
|
const { port: prevPort, host: prevHost } = server.config.server;
|
|
62240
62234
|
const shortcutsOptions = server._shortcutsOptions;
|
|
@@ -62257,17 +62251,9 @@ async function restartServer(server) {
|
|
|
62257
62251
|
});
|
|
62258
62252
|
return;
|
|
62259
62253
|
}
|
|
62260
|
-
|
|
62261
|
-
|
|
62262
|
-
|
|
62263
|
-
// @ts-ignore
|
|
62264
|
-
newServer[key] = server[key];
|
|
62265
|
-
}
|
|
62266
|
-
else {
|
|
62267
|
-
// @ts-ignore
|
|
62268
|
-
server[key] = newServer[key];
|
|
62269
|
-
}
|
|
62270
|
-
}
|
|
62254
|
+
// prevent new server `restart` function from calling
|
|
62255
|
+
newServer._restartPromise = server._restartPromise;
|
|
62256
|
+
Object.assign(server, newServer);
|
|
62271
62257
|
const { logger, server: { port, host, middlewareMode }, } = server.config;
|
|
62272
62258
|
if (!middlewareMode) {
|
|
62273
62259
|
await server.listen(port, true);
|
|
@@ -62315,7 +62301,7 @@ var index = {
|
|
|
62315
62301
|
searchForWorkspaceRoot: searchForWorkspaceRoot
|
|
62316
62302
|
};
|
|
62317
62303
|
|
|
62318
|
-
|
|
62304
|
+
/* eslint-disable */
|
|
62319
62305
|
/* global Buffer */
|
|
62320
62306
|
const noop = () => { };
|
|
62321
62307
|
const mimes = /text|javascript|\/json|xml/i;
|
|
@@ -62346,7 +62332,6 @@ function compression() {
|
|
|
62346
62332
|
let size = 0;
|
|
62347
62333
|
function start() {
|
|
62348
62334
|
started = true;
|
|
62349
|
-
// @ts-ignore
|
|
62350
62335
|
size = res.getHeader('Content-Length') | 0 || size;
|
|
62351
62336
|
const compressible = mimes.test(String(res.getHeader('Content-Type') || 'text/plain'));
|
|
62352
62337
|
const cleartext = !res.getHeader('Content-Encoding');
|
|
@@ -62473,13 +62458,11 @@ async function preview(inlineConfig = {}) {
|
|
|
62473
62458
|
}
|
|
62474
62459
|
}
|
|
62475
62460
|
},
|
|
62461
|
+
shouldServe(filePath) {
|
|
62462
|
+
return shouldServeFile(filePath, distDir);
|
|
62463
|
+
},
|
|
62476
62464
|
});
|
|
62477
|
-
app.use(previewBase,
|
|
62478
|
-
if (shouldServe(req.url, distDir)) {
|
|
62479
|
-
return assetServer(req, res, next);
|
|
62480
|
-
}
|
|
62481
|
-
next();
|
|
62482
|
-
});
|
|
62465
|
+
app.use(previewBase, assetServer);
|
|
62483
62466
|
// apply post server hooks from plugins
|
|
62484
62467
|
postHooks.forEach((fn) => fn && fn());
|
|
62485
62468
|
const options = config.preview;
|
|
@@ -62622,14 +62605,11 @@ async function resolveConfig(inlineConfig, command, defaultMode = 'development',
|
|
|
62622
62605
|
// resolve root
|
|
62623
62606
|
const resolvedRoot = normalizePath$3(config.root ? path$o.resolve(config.root) : process.cwd());
|
|
62624
62607
|
const clientAlias = [
|
|
62625
|
-
{ find: /^\/?@vite\/env/, replacement:
|
|
62626
|
-
{ find: /^\/?@vite\/client/, replacement:
|
|
62608
|
+
{ find: /^\/?@vite\/env/, replacement: ENV_ENTRY },
|
|
62609
|
+
{ find: /^\/?@vite\/client/, replacement: CLIENT_ENTRY },
|
|
62627
62610
|
];
|
|
62628
62611
|
// resolve alias with internal client alias
|
|
62629
|
-
const resolvedAlias = normalizeAlias(mergeAlias(
|
|
62630
|
-
// @ts-ignore because @rollup/plugin-alias' type doesn't allow function
|
|
62631
|
-
// replacement, but its implementation does work with function values.
|
|
62632
|
-
clientAlias, config.resolve?.alias || []));
|
|
62612
|
+
const resolvedAlias = normalizeAlias(mergeAlias(clientAlias, config.resolve?.alias || []));
|
|
62633
62613
|
const resolveOptions = {
|
|
62634
62614
|
mainFields: config.resolve?.mainFields ?? DEFAULT_MAIN_FIELDS,
|
|
62635
62615
|
browserField: config.resolve?.browserField ?? true,
|
|
@@ -249,9 +249,32 @@ readCache$1.exports.clear = function () {
|
|
|
249
249
|
cache = Object.create(null);
|
|
250
250
|
};
|
|
251
251
|
|
|
252
|
+
const dataURLRegexp = /^data:text\/css;base64,/i;
|
|
253
|
+
|
|
254
|
+
function isValid(url) {
|
|
255
|
+
return dataURLRegexp.test(url)
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
function contents(url) {
|
|
259
|
+
// "data:text/css;base64,".length === 21
|
|
260
|
+
return Buffer.from(url.slice(21), "base64").toString()
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
var dataUrl = {
|
|
264
|
+
isValid,
|
|
265
|
+
contents,
|
|
266
|
+
};
|
|
267
|
+
|
|
252
268
|
const readCache = readCache$1.exports;
|
|
269
|
+
const dataURL$1 = dataUrl;
|
|
253
270
|
|
|
254
|
-
var loadContent$1 = filename =>
|
|
271
|
+
var loadContent$1 = filename => {
|
|
272
|
+
if (dataURL$1.isValid(filename)) {
|
|
273
|
+
return dataURL$1.contents(filename)
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
return readCache(filename, "utf-8")
|
|
277
|
+
};
|
|
255
278
|
|
|
256
279
|
// builtin tooling
|
|
257
280
|
const path$1 = require$$0;
|
|
@@ -509,6 +532,7 @@ const loadContent = loadContent$1;
|
|
|
509
532
|
const processContent = processContent$1;
|
|
510
533
|
const parseStatements = parseStatements$1;
|
|
511
534
|
const assignLayerNames = assignLayerNames$1;
|
|
535
|
+
const dataURL = dataUrl;
|
|
512
536
|
|
|
513
537
|
function AtImport(options) {
|
|
514
538
|
options = {
|
|
@@ -789,6 +813,14 @@ function AtImport(options) {
|
|
|
789
813
|
}
|
|
790
814
|
|
|
791
815
|
function resolveImportId(result, stmt, options, state) {
|
|
816
|
+
if (dataURL.isValid(stmt.uri)) {
|
|
817
|
+
return loadImportContent(result, stmt, stmt.uri, options, state).then(
|
|
818
|
+
result => {
|
|
819
|
+
stmt.children = result;
|
|
820
|
+
}
|
|
821
|
+
)
|
|
822
|
+
}
|
|
823
|
+
|
|
792
824
|
const atRule = stmt.node;
|
|
793
825
|
let sourceFile;
|
|
794
826
|
if (atRule.source?.input?.file) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import require$$0__default from 'fs';
|
|
2
2
|
import require$$0 from 'postcss';
|
|
3
|
-
import { C as commonjsGlobal } from './dep-
|
|
3
|
+
import { C as commonjsGlobal } from './dep-2285ba4f.js';
|
|
4
4
|
import require$$0$1 from 'path';
|
|
5
5
|
import require$$5 from 'crypto';
|
|
6
6
|
import require$$0$2 from 'util';
|
package/dist/node/cli.js
CHANGED
|
@@ -2,7 +2,7 @@ import path from 'node:path';
|
|
|
2
2
|
import fs from 'node:fs';
|
|
3
3
|
import { performance } from 'node:perf_hooks';
|
|
4
4
|
import { EventEmitter } from 'events';
|
|
5
|
-
import { A as picocolors, B as bindShortcuts, w as createLogger, h as resolveConfig } from './chunks/dep-
|
|
5
|
+
import { A as picocolors, B as bindShortcuts, w as createLogger, h as resolveConfig } from './chunks/dep-2285ba4f.js';
|
|
6
6
|
import { VERSION } from './constants.js';
|
|
7
7
|
import 'node:url';
|
|
8
8
|
import 'node:module';
|
|
@@ -652,7 +652,6 @@ class CAC extends EventEmitter {
|
|
|
652
652
|
const cac = (name = "") => new CAC(name);
|
|
653
653
|
|
|
654
654
|
const cli = cac('vite');
|
|
655
|
-
// @ts-ignore
|
|
656
655
|
let profileSession = global.__vite_profile_session;
|
|
657
656
|
let profileCount = 0;
|
|
658
657
|
const stopProfiler = (log) => {
|
|
@@ -725,7 +724,7 @@ cli
|
|
|
725
724
|
filterDuplicateOptions(options);
|
|
726
725
|
// output structure is preserved even after bundling so require()
|
|
727
726
|
// is ok here
|
|
728
|
-
const { createServer } = await import('./chunks/dep-
|
|
727
|
+
const { createServer } = await import('./chunks/dep-2285ba4f.js').then(function (n) { return n.F; });
|
|
729
728
|
try {
|
|
730
729
|
const server = await createServer({
|
|
731
730
|
root,
|
|
@@ -742,7 +741,6 @@ cli
|
|
|
742
741
|
}
|
|
743
742
|
await server.listen();
|
|
744
743
|
const info = server.config.logger.info;
|
|
745
|
-
// @ts-ignore
|
|
746
744
|
const viteStartTime = global.__vite_start_time ?? false;
|
|
747
745
|
const startupDurationString = viteStartTime
|
|
748
746
|
? picocolors.exports.dim(`ready in ${picocolors.exports.reset(picocolors.exports.bold(Math.ceil(performance.now() - viteStartTime)))} ms`)
|
|
@@ -804,7 +802,7 @@ cli
|
|
|
804
802
|
.option('-w, --watch', `[boolean] rebuilds when modules have changed on disk`)
|
|
805
803
|
.action(async (root, options) => {
|
|
806
804
|
filterDuplicateOptions(options);
|
|
807
|
-
const { build } = await import('./chunks/dep-
|
|
805
|
+
const { build } = await import('./chunks/dep-2285ba4f.js').then(function (n) { return n.E; });
|
|
808
806
|
const buildOptions = cleanOptions(options);
|
|
809
807
|
try {
|
|
810
808
|
await build({
|
|
@@ -832,7 +830,7 @@ cli
|
|
|
832
830
|
.option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
|
|
833
831
|
.action(async (root, options) => {
|
|
834
832
|
filterDuplicateOptions(options);
|
|
835
|
-
const { optimizeDeps } = await import('./chunks/dep-
|
|
833
|
+
const { optimizeDeps } = await import('./chunks/dep-2285ba4f.js').then(function (n) { return n.D; });
|
|
836
834
|
try {
|
|
837
835
|
const config = await resolveConfig({
|
|
838
836
|
root,
|
|
@@ -857,7 +855,7 @@ cli
|
|
|
857
855
|
.option('--outDir <dir>', `[string] output directory (default: dist)`)
|
|
858
856
|
.action(async (root, options) => {
|
|
859
857
|
filterDuplicateOptions(options);
|
|
860
|
-
const { preview } = await import('./chunks/dep-
|
|
858
|
+
const { preview } = await import('./chunks/dep-2285ba4f.js').then(function (n) { return n.G; });
|
|
861
859
|
try {
|
|
862
860
|
const server = await preview({
|
|
863
861
|
root,
|
package/dist/node/index.d.ts
CHANGED
|
@@ -1852,17 +1852,17 @@ export declare interface RollupCommonJSOptions {
|
|
|
1852
1852
|
* they should be left unconverted as it requires an optional dependency
|
|
1853
1853
|
* that may or may not be installed beside the rolled up package.
|
|
1854
1854
|
* Due to the conversion of `require` to a static `import` - the call is
|
|
1855
|
-
* hoisted to the top of the file, outside
|
|
1855
|
+
* hoisted to the top of the file, outside the `try-catch` clause.
|
|
1856
1856
|
*
|
|
1857
|
-
* - `true`: All `require` calls inside a `try` will be left unconverted.
|
|
1857
|
+
* - `true`: Default. All `require` calls inside a `try` will be left unconverted.
|
|
1858
1858
|
* - `false`: All `require` calls inside a `try` will be converted as if the
|
|
1859
1859
|
* `try-catch` clause is not there.
|
|
1860
1860
|
* - `remove`: Remove all `require` calls from inside any `try` block.
|
|
1861
1861
|
* - `string[]`: Pass an array containing the IDs to left unconverted.
|
|
1862
|
-
* - `((id: string) => boolean|'remove')`: Pass a function that
|
|
1862
|
+
* - `((id: string) => boolean|'remove')`: Pass a function that controls
|
|
1863
1863
|
* individual IDs.
|
|
1864
1864
|
*
|
|
1865
|
-
* @default
|
|
1865
|
+
* @default true
|
|
1866
1866
|
*/
|
|
1867
1867
|
ignoreTryCatch?:
|
|
1868
1868
|
| boolean
|
|
@@ -1876,14 +1876,14 @@ export declare interface RollupCommonJSOptions {
|
|
|
1876
1876
|
* NodeJS where ES modules can only import a default export from a CommonJS
|
|
1877
1877
|
* dependency.
|
|
1878
1878
|
*
|
|
1879
|
-
* If you set `esmExternals` to `true`, this
|
|
1879
|
+
* If you set `esmExternals` to `true`, this plugin assumes that all
|
|
1880
1880
|
* external dependencies are ES modules and respect the
|
|
1881
1881
|
* `requireReturnsDefault` option. If that option is not set, they will be
|
|
1882
1882
|
* rendered as namespace imports.
|
|
1883
1883
|
*
|
|
1884
1884
|
* You can also supply an array of ids to be treated as ES modules, or a
|
|
1885
|
-
* function that will be passed each external id to determine
|
|
1886
|
-
* module.
|
|
1885
|
+
* function that will be passed each external id to determine whether it is
|
|
1886
|
+
* an ES module.
|
|
1887
1887
|
* @default false
|
|
1888
1888
|
*/
|
|
1889
1889
|
esmExternals?: boolean | ReadonlyArray<string> | ((id: string) => boolean)
|
|
@@ -1901,7 +1901,7 @@ export declare interface RollupCommonJSOptions {
|
|
|
1901
1901
|
* import * as foo from 'foo';
|
|
1902
1902
|
* ```
|
|
1903
1903
|
*
|
|
1904
|
-
* However there are some situations where this may not be desired.
|
|
1904
|
+
* However, there are some situations where this may not be desired.
|
|
1905
1905
|
* For these situations, you can change Rollup's behaviour either globally or
|
|
1906
1906
|
* per module. To change it globally, set the `requireReturnsDefault` option
|
|
1907
1907
|
* to one of the following values:
|
|
@@ -1952,7 +1952,7 @@ export declare interface RollupCommonJSOptions {
|
|
|
1952
1952
|
* Some modules contain dynamic `require` calls, or require modules that
|
|
1953
1953
|
* contain circular dependencies, which are not handled well by static
|
|
1954
1954
|
* imports. Including those modules as `dynamicRequireTargets` will simulate a
|
|
1955
|
-
* CommonJS (NodeJS-like)
|
|
1955
|
+
* CommonJS (NodeJS-like) environment for them with support for dynamic
|
|
1956
1956
|
* dependencies. It also enables `strictRequires` for those modules.
|
|
1957
1957
|
*
|
|
1958
1958
|
* Note: In extreme cases, this feature may result in some paths being
|
|
@@ -1966,7 +1966,7 @@ export declare interface RollupCommonJSOptions {
|
|
|
1966
1966
|
* To avoid long paths when using the `dynamicRequireTargets` option, you can use this option to specify a directory
|
|
1967
1967
|
* that is a common parent for all files that use dynamic require statements. Using a directory higher up such as `/`
|
|
1968
1968
|
* may lead to unnecessarily long paths in the generated code and may expose directory names on your machine like your
|
|
1969
|
-
* home directory name. By default it uses the current working directory.
|
|
1969
|
+
* home directory name. By default, it uses the current working directory.
|
|
1970
1970
|
*/
|
|
1971
1971
|
dynamicRequireRoot?: string
|
|
1972
1972
|
}
|
package/dist/node/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { b as build, e as buildErrorMessage, u as createFilter, w as createLogger, c as createServer, g as defineConfig, f as formatPostcssSourceMap, j as getDepOptimizationConfig, k as isDepsOptimizerEnabled, l as loadConfigFromFile, y as loadEnv, q as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, a as preprocessCSS, p as preview, i as resolveBaseUrl, h as resolveConfig, z as resolveEnvPrefix, d as resolvePackageData, r as resolvePackageEntry, x as searchForWorkspaceRoot, v as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-
|
|
1
|
+
export { b as build, e as buildErrorMessage, u as createFilter, w as createLogger, c as createServer, g as defineConfig, f as formatPostcssSourceMap, j as getDepOptimizationConfig, k as isDepsOptimizerEnabled, l as loadConfigFromFile, y as loadEnv, q as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, a as preprocessCSS, p as preview, i as resolveBaseUrl, h as resolveConfig, z as resolveEnvPrefix, d as resolvePackageData, r as resolvePackageEntry, x as searchForWorkspaceRoot, v as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-2285ba4f.js';
|
|
2
2
|
export { VERSION as version } from './constants.js';
|
|
3
3
|
export { version as esbuildVersion } from 'esbuild';
|
|
4
4
|
export { VERSION as rollupVersion } from 'rollup';
|
|
@@ -3464,7 +3464,7 @@ isWindows ? node_util.promisify(gracefulRename) : fs$1.renameSync;
|
|
|
3464
3464
|
function arraify(target) {
|
|
3465
3465
|
return Array.isArray(target) ? target : [target];
|
|
3466
3466
|
}
|
|
3467
|
-
// @ts-expect-error
|
|
3467
|
+
// @ts-expect-error jest only exists when running Jest
|
|
3468
3468
|
const usingDynamicImport = typeof jest === 'undefined';
|
|
3469
3469
|
/**
|
|
3470
3470
|
* Dynamically import files. It will make sure it's not being compiled away by TS/Rollup.
|
|
@@ -4231,6 +4231,10 @@ function loadEnv(mode, envDir, prefixes = 'VITE_') {
|
|
|
4231
4231
|
return [];
|
|
4232
4232
|
return Object.entries(parse_1(fs$1.readFileSync(path)));
|
|
4233
4233
|
}));
|
|
4234
|
+
// test NODE_ENV override before expand as otherwise process.env.NODE_ENV would override this
|
|
4235
|
+
if (parsed.NODE_ENV && process.env.VITE_USER_NODE_ENV === undefined) {
|
|
4236
|
+
process.env.VITE_USER_NODE_ENV = parsed.NODE_ENV;
|
|
4237
|
+
}
|
|
4234
4238
|
try {
|
|
4235
4239
|
// let environment variables use each other
|
|
4236
4240
|
expand_1({ parsed });
|
|
@@ -4248,11 +4252,6 @@ function loadEnv(mode, envDir, prefixes = 'VITE_') {
|
|
|
4248
4252
|
if (prefixes.some((prefix) => key.startsWith(prefix))) {
|
|
4249
4253
|
env[key] = value;
|
|
4250
4254
|
}
|
|
4251
|
-
else if (key === 'NODE_ENV' &&
|
|
4252
|
-
process.env.VITE_USER_NODE_ENV === undefined) {
|
|
4253
|
-
// NODE_ENV override in .env file
|
|
4254
|
-
process.env.VITE_USER_NODE_ENV = value;
|
|
4255
|
-
}
|
|
4256
4255
|
}
|
|
4257
4256
|
// check if there are actual env variables starting with VITE_*
|
|
4258
4257
|
// these are typically provided inline and should be prioritized
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Evan You",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"//": "READ CONTRIBUTING.md to understand what to put under deps vs. devDeps!",
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"esbuild": "^0.16.3",
|
|
62
|
-
"postcss": "^8.4.
|
|
62
|
+
"postcss": "^8.4.20",
|
|
63
63
|
"resolve": "^1.22.1",
|
|
64
64
|
"rollup": "^3.7.0"
|
|
65
65
|
},
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"@babel/types": "^7.20.5",
|
|
73
73
|
"@jridgewell/trace-mapping": "^0.3.17",
|
|
74
74
|
"@rollup/plugin-alias": "^4.0.2",
|
|
75
|
-
"@rollup/plugin-commonjs": "^23.0.
|
|
75
|
+
"@rollup/plugin-commonjs": "^23.0.4",
|
|
76
76
|
"@rollup/plugin-dynamic-import-vars": "^2.0.1",
|
|
77
77
|
"@rollup/plugin-json": "^5.0.2",
|
|
78
78
|
"@rollup/plugin-node-resolve": "15.0.1",
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
"periscopic": "^3.0.4",
|
|
108
108
|
"picocolors": "^1.0.0",
|
|
109
109
|
"picomatch": "^2.3.1",
|
|
110
|
-
"postcss-import": "^15.0
|
|
110
|
+
"postcss-import": "^15.1.0",
|
|
111
111
|
"postcss-load-config": "^4.0.1",
|
|
112
112
|
"postcss-modules": "^6.0.0",
|
|
113
113
|
"resolve.exports": "^1.1.0",
|