vite 3.0.5 → 3.0.8

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.
@@ -243,7 +243,7 @@ function setupWebSocket(protocol, hostAndPath, onCloseWithoutOpen) {
243
243
  return;
244
244
  }
245
245
  console.log(`[vite] server connection lost. polling for restart...`);
246
- await waitForSuccessfulPing(hostAndPath);
246
+ await waitForSuccessfulPing(protocol, hostAndPath);
247
247
  location.reload();
248
248
  });
249
249
  return socket;
@@ -411,14 +411,17 @@ async function queueUpdate(p) {
411
411
  (await Promise.all(loading)).forEach((fn) => fn && fn());
412
412
  }
413
413
  }
414
- async function waitForSuccessfulPing(hostAndPath, ms = 1000) {
414
+ async function waitForSuccessfulPing(socketProtocol, hostAndPath, ms = 1000) {
415
+ const pingHostProtocol = socketProtocol === 'wss' ? 'https' : 'http';
415
416
  // eslint-disable-next-line no-constant-condition
416
417
  while (true) {
417
418
  try {
418
419
  // A fetch on a websocket URL will return a successful promise with status 400,
419
420
  // but will reject a networking error.
420
421
  // When running on middleware mode, it returns status 426, and an cors error happens if mode is not no-cors
421
- await fetch(`${location.protocol}//${hostAndPath}`, { mode: 'no-cors' });
422
+ await fetch(`${pingHostProtocol}://${hostAndPath}`, {
423
+ mode: 'no-cors'
424
+ });
422
425
  break;
423
426
  }
424
427
  catch (e) {
@@ -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\nconst template = /*html*/ `\n<style>\n:host {\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 --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\n.window {\n font-family: var(--monospace);\n line-height: 1.5;\n width: 800px;\n color: #d8d8d8;\n margin: 30px auto;\n padding: 25px 40px;\n position: relative;\n background: #181818;\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=\"window\">\n <pre class=\"message\"><span class=\"plugin\"></span><span class=\"message-body\"></span></pre>\n <pre class=\"file\"></pre>\n <pre class=\"frame\"></pre>\n <pre class=\"stack\"></pre>\n <div class=\"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`\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']) {\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}`, true)\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, true)\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 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(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\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 payload.updates.forEach((update) => {\n if (update.type === 'js-update') {\n queueUpdate(fetchUpdate(update))\n } else {\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((e) => cleanUrl(e.href).includes(searchUrl))\n if (el) {\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 const newLinkTag = el.cloneNode() as HTMLLinkElement\n newLinkTag.href = new URL(newPath, el.href).href\n const removeOldEl = () => el.remove()\n newLinkTag.addEventListener('load', removeOldEl)\n newLinkTag.addEventListener('error', removeOldEl)\n el.after(newLinkTag)\n }\n console.log(`[vite] css hot updated: ${searchUrl}`)\n }\n })\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(hostAndPath: string, ms = 1000) {\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(`${location.protocol}//${hostAndPath}`, { mode: 'no-cors' })\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 // @ts-expect-error: using experimental API\n style.replaceSync(content)\n // @ts-expect-error: using experimental API\n document.adoptedStyleSheets = [...document.adoptedStyleSheets, style]\n } else {\n // @ts-expect-error: using experimental API\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.innerHTML = content\n document.head.appendChild(style)\n } else {\n style.innerHTML = 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 // @ts-expect-error: using experimental API\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({ path, acceptedPath, timestamp }: 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 const moduleMap = new Map<string, ModuleNamespace>()\n const isSelfUpdate = path === acceptedPath\n\n // make sure we only import each dep once\n const modulesToUpdate = new Set<string>()\n if (isSelfUpdate) {\n // self update - only update self\n modulesToUpdate.add(path)\n } else {\n // dep update\n for (const { deps } of mod.callbacks) {\n deps.forEach((dep) => {\n if (acceptedPath === dep) {\n modulesToUpdate.add(dep)\n }\n })\n }\n }\n\n // determine the qualified callbacks before we re-import the modules\n const qualifiedCallbacks = mod.callbacks.filter(({ deps }) => {\n return deps.some((dep) => modulesToUpdate.has(dep))\n })\n\n await Promise.all(\n Array.from(modulesToUpdate).map(async (dep) => {\n const disposer = disposeMap.get(dep)\n if (disposer) await disposer(dataMap.get(dep))\n const [path, query] = dep.split(`?`)\n try {\n const newMod: ModuleNamespace = await import(\n /* @vite-ignore */\n base +\n path.slice(1) +\n `?import&t=${timestamp}${query ? `&${query}` : ''}`\n )\n moduleMap.set(dep, newMod)\n } catch (e) {\n warnFailedFetch(e, dep)\n }\n })\n )\n\n return () => {\n for (const { deps, fn } of qualifiedCallbacks) {\n fn(deps.map((dep) => moduleMap.get(dep)))\n }\n const loggedPath = isSelfUpdate ? path : `${acceptedPath} via ${path}`\n console.log(`[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 && deps(mod))\n } else if (typeof deps === 'string') {\n // explicit deps\n acceptDeps([deps], ([mod]) => callback && 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(_: string | readonly string[], callback?: any) {\n acceptDeps([ownerPath], callback && (([mod]) => callback(mod)))\n },\n\n dispose(cb) {\n disposeMap.set(ownerPath, cb)\n },\n\n // @ts-expect-error untyped\n prune(cb: (data: any) => void) {\n pruneMap.set(ownerPath, cb)\n },\n\n // TODO\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n decline() {},\n\n invalidate() {\n // TODO should tell the server to re-perform hmr propagation\n // from this module as root\n location.reload()\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,MAAM,QAAQ,YAAY,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8GzB,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,EAAA;;AAClC,QAAA,KAAK,EAAE,CAAA;AACP,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAA;AAC/C,QAAA,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAA;AAE9B,QAAA,WAAW,CAAC,SAAS,GAAG,CAAC,CAAA;AACzB,QAAA,MAAM,QAAQ,GAAG,GAAG,CAAC,KAAK,IAAI,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;QACzD,MAAM,OAAO,GAAG,QAAQ;cACpB,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC;AACtC,cAAE,GAAG,CAAC,OAAO,CAAA;QACf,IAAI,GAAG,CAAC,MAAM,EAAE;YACd,IAAI,CAAC,IAAI,CAAC,SAAS,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C,IAAI,CAAC,EAAE,CAAC,CAAA;AACjB,gBAAA,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;AAC1B,aAAC,CAAA;YACD,QAAQ,CAAC,kBAAkB,CAAC,CAAA;YAC5B,QAAQ,CAAC,YAAY,CAAC,CAAA;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;;;;"}
1
+ {"version":3,"file":"client.mjs","sources":["../../src/client/overlay.ts","../../src/client/client.ts"],"sourcesContent":["import type { ErrorPayload } from 'types/hmrPayload'\n\nconst template = /*html*/ `\n<style>\n:host {\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 --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\n.window {\n font-family: var(--monospace);\n line-height: 1.5;\n width: 800px;\n color: #d8d8d8;\n margin: 30px auto;\n padding: 25px 40px;\n position: relative;\n background: #181818;\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=\"window\">\n <pre class=\"message\"><span class=\"plugin\"></span><span class=\"message-body\"></span></pre>\n <pre class=\"file\"></pre>\n <pre class=\"frame\"></pre>\n <pre class=\"stack\"></pre>\n <div class=\"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`\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']) {\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}`, true)\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, true)\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 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\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 payload.updates.forEach((update) => {\n if (update.type === 'js-update') {\n queueUpdate(fetchUpdate(update))\n } else {\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((e) => cleanUrl(e.href).includes(searchUrl))\n if (el) {\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 const newLinkTag = el.cloneNode() as HTMLLinkElement\n newLinkTag.href = new URL(newPath, el.href).href\n const removeOldEl = () => el.remove()\n newLinkTag.addEventListener('load', removeOldEl)\n newLinkTag.addEventListener('error', removeOldEl)\n el.after(newLinkTag)\n }\n console.log(`[vite] css hot updated: ${searchUrl}`)\n }\n })\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 // @ts-expect-error: using experimental API\n style.replaceSync(content)\n // @ts-expect-error: using experimental API\n document.adoptedStyleSheets = [...document.adoptedStyleSheets, style]\n } else {\n // @ts-expect-error: using experimental API\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.innerHTML = content\n document.head.appendChild(style)\n } else {\n style.innerHTML = 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 // @ts-expect-error: using experimental API\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({ path, acceptedPath, timestamp }: 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 const moduleMap = new Map<string, ModuleNamespace>()\n const isSelfUpdate = path === acceptedPath\n\n // make sure we only import each dep once\n const modulesToUpdate = new Set<string>()\n if (isSelfUpdate) {\n // self update - only update self\n modulesToUpdate.add(path)\n } else {\n // dep update\n for (const { deps } of mod.callbacks) {\n deps.forEach((dep) => {\n if (acceptedPath === dep) {\n modulesToUpdate.add(dep)\n }\n })\n }\n }\n\n // determine the qualified callbacks before we re-import the modules\n const qualifiedCallbacks = mod.callbacks.filter(({ deps }) => {\n return deps.some((dep) => modulesToUpdate.has(dep))\n })\n\n await Promise.all(\n Array.from(modulesToUpdate).map(async (dep) => {\n const disposer = disposeMap.get(dep)\n if (disposer) await disposer(dataMap.get(dep))\n const [path, query] = dep.split(`?`)\n try {\n const newMod: ModuleNamespace = await import(\n /* @vite-ignore */\n base +\n path.slice(1) +\n `?import&t=${timestamp}${query ? `&${query}` : ''}`\n )\n moduleMap.set(dep, newMod)\n } catch (e) {\n warnFailedFetch(e, dep)\n }\n })\n )\n\n return () => {\n for (const { deps, fn } of qualifiedCallbacks) {\n fn(deps.map((dep) => moduleMap.get(dep)))\n }\n const loggedPath = isSelfUpdate ? path : `${acceptedPath} via ${path}`\n console.log(`[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 && deps(mod))\n } else if (typeof deps === 'string') {\n // explicit deps\n acceptDeps([deps], ([mod]) => callback && 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(_: string | readonly string[], callback?: any) {\n acceptDeps([ownerPath], callback && (([mod]) => callback(mod)))\n },\n\n dispose(cb) {\n disposeMap.set(ownerPath, cb)\n },\n\n // @ts-expect-error untyped\n prune(cb: (data: any) => void) {\n pruneMap.set(ownerPath, cb)\n },\n\n // TODO\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n decline() {},\n\n invalidate() {\n // TODO should tell the server to re-perform hmr propagation\n // from this module as root\n location.reload()\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,MAAM,QAAQ,YAAY,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8GzB,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,EAAA;;AAClC,QAAA,KAAK,EAAE,CAAA;AACP,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAA;AAC/C,QAAA,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAA;AAE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AO,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,5 +1,5 @@
1
1
  import require$$0$1 from 'postcss';
2
- import { z as commonjsGlobal } from './dep-5cb728cb.js';
2
+ import { z as commonjsGlobal } from './dep-74663fff.js';
3
3
  import require$$0 from 'path';
4
4
  import require$$5 from 'crypto';
5
5
  import require$$0__default from 'fs';
@@ -7,7 +7,7 @@ import require$$0$3 from 'tty';
7
7
  import { transform as transform$2, build as build$3, formatMessages } from 'esbuild';
8
8
  import require$$0$4, { sep, resolve as resolve$4, posix as posix$1, relative as relative$1, basename as basename$1, extname, dirname as dirname$1, join as join$1, win32 as win32$1, isAbsolute as isAbsolute$1, normalize } from 'path';
9
9
  import * as require$$0$2 from 'fs';
10
- import require$$0__default, { statSync as statSync$1, existsSync, readFileSync, promises as promises$1, readdirSync } from 'fs';
10
+ import require$$0__default, { existsSync, readFileSync, statSync as statSync$1, promises as promises$1, readdirSync } from 'fs';
11
11
  import require$$0$5 from 'events';
12
12
  import assert$1 from 'assert';
13
13
  import require$$0$6, { format as format$2, inspect } from 'util';
@@ -22,7 +22,7 @@ import { createHash as createHash$2 } from 'node:crypto';
22
22
  import { promisify as promisify$4 } from 'node:util';
23
23
  import { promises } from 'node:dns';
24
24
  import resolve$5 from 'resolve';
25
- import { CLIENT_ENTRY, DEFAULT_EXTENSIONS as DEFAULT_EXTENSIONS$1, OPTIMIZABLE_ENTRY_RE, VALID_ID_PREFIX, FS_PREFIX, wildcardHosts, loopbackHosts, CLIENT_PUBLIC_PATH, ENV_PUBLIC_PATH, DEFAULT_MAIN_FIELDS, DEP_VERSION_RE, SPECIAL_QUERY_RE, KNOWN_ASSET_TYPES, JS_TYPES_RE, ESBUILD_MODULES_TARGET, CLIENT_DIR, NULL_BYTE_PLACEHOLDER, VERSION, VITE_PACKAGE_DIR, ENV_ENTRY, DEFAULT_ASSETS_RE, DEFAULT_CONFIG_FILES } from '../constants.js';
25
+ import { CLIENT_ENTRY, OPTIMIZABLE_ENTRY_RE, DEFAULT_EXTENSIONS as DEFAULT_EXTENSIONS$1, wildcardHosts, loopbackHosts, VALID_ID_PREFIX, FS_PREFIX, CLIENT_PUBLIC_PATH, ENV_PUBLIC_PATH, DEFAULT_MAIN_FIELDS, DEP_VERSION_RE, SPECIAL_QUERY_RE, KNOWN_ASSET_TYPES, JS_TYPES_RE, ESBUILD_MODULES_TARGET, CLIENT_DIR, NULL_BYTE_PLACEHOLDER, VERSION, VITE_PACKAGE_DIR, ENV_ENTRY, DEFAULT_ASSETS_RE, DEFAULT_CONFIG_FILES } from '../constants.js';
26
26
  import require$$5 from 'crypto';
27
27
  import require$$0$a from 'buffer';
28
28
  import require$$0$8, { createRequire as createRequire$2 } from 'module';
@@ -33308,7 +33308,7 @@ function assetPlugin(config) {
33308
33308
  const url = await fileToUrl(id, config, this);
33309
33309
  return `export default ${JSON.stringify(url)}`;
33310
33310
  },
33311
- renderChunk(code, chunk) {
33311
+ renderChunk(code, chunk, outputOptions) {
33312
33312
  let match;
33313
33313
  let s;
33314
33314
  // Urls added with JS using e.g.
@@ -33324,7 +33324,7 @@ function assetPlugin(config) {
33324
33324
  const file = getAssetFilename(hash, config) || this.getFileName(hash);
33325
33325
  chunk.viteMetadata.importedAssets.add(cleanUrl(file));
33326
33326
  const filename = file + postfix;
33327
- const replacement = toOutputFilePathInString(filename, 'asset', chunk.fileName, 'js', config);
33327
+ const replacement = toOutputFilePathInString(filename, 'asset', chunk.fileName, 'js', config, outputOptions.format);
33328
33328
  const replacementString = typeof replacement === 'string'
33329
33329
  ? JSON.stringify(replacement).slice(1, -1)
33330
33330
  : `"+${replacement.runtime}+"`;
@@ -33338,7 +33338,7 @@ function assetPlugin(config) {
33338
33338
  s = s || (s = new MagicString(code));
33339
33339
  const [full, hash] = match;
33340
33340
  const publicUrl = publicAssetUrlMap.get(hash).slice(1);
33341
- const replacement = toOutputFilePathInString(publicUrl, 'public', chunk.fileName, 'js', config);
33341
+ const replacement = toOutputFilePathInString(publicUrl, 'public', chunk.fileName, 'js', config, outputOptions.format);
33342
33342
  const replacementString = typeof replacement === 'string'
33343
33343
  ? JSON.stringify(replacement).slice(1, -1)
33344
33344
  : `"+${replacement.runtime}+"`;
@@ -33690,6 +33690,251 @@ function resolve(pkg, entry='.', options={}) {
33690
33690
  }
33691
33691
  }
33692
33692
 
33693
+ /*---------------------------------------------------------------------------------------------
33694
+ * Copyright (c) Microsoft Corporation. All rights reserved.
33695
+ * Licensed under the MIT License. See License.txt in the project root for license information.
33696
+ *--------------------------------------------------------------------------------------------*/
33697
+ var ParseOptions;
33698
+ (function (ParseOptions) {
33699
+ ParseOptions.DEFAULT = {
33700
+ allowTrailingComma: false
33701
+ };
33702
+ })(ParseOptions || (ParseOptions = {}));
33703
+
33704
+ function matchAll(regex, string, addition) {
33705
+ const matches = [];
33706
+ for (const match of string.matchAll(regex)) {
33707
+ matches.push({
33708
+ ...addition,
33709
+ ...match.groups,
33710
+ code: match[0],
33711
+ start: match.index,
33712
+ end: match.index + match[0].length
33713
+ });
33714
+ }
33715
+ return matches;
33716
+ }
33717
+
33718
+ const isWindows$3 = process.platform === "win32";
33719
+ const own$1 = {}.hasOwnProperty;
33720
+ const messages = /* @__PURE__ */ new Map();
33721
+ const nodeInternalPrefix = "__node_internal_";
33722
+ let userStackTraceLimit;
33723
+ createError(
33724
+ "ERR_INVALID_MODULE_SPECIFIER",
33725
+ (request, reason, base = void 0) => {
33726
+ return `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ""}`;
33727
+ },
33728
+ TypeError
33729
+ );
33730
+ createError(
33731
+ "ERR_INVALID_PACKAGE_CONFIG",
33732
+ (path, base, message) => {
33733
+ return `Invalid package config ${path}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;
33734
+ },
33735
+ Error
33736
+ );
33737
+ createError(
33738
+ "ERR_INVALID_PACKAGE_TARGET",
33739
+ (pkgPath, key, target, isImport = false, base = void 0) => {
33740
+ const relError = typeof target === "string" && !isImport && target.length > 0 && !target.startsWith("./");
33741
+ if (key === ".") {
33742
+ assert$1(isImport === false);
33743
+ return `Invalid "exports" main target ${JSON.stringify(target)} defined in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ""}${relError ? '; targets must start with "./"' : ""}`;
33744
+ }
33745
+ return `Invalid "${isImport ? "imports" : "exports"}" target ${JSON.stringify(
33746
+ target
33747
+ )} defined for '${key}' in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ""}${relError ? '; targets must start with "./"' : ""}`;
33748
+ },
33749
+ Error
33750
+ );
33751
+ createError(
33752
+ "ERR_MODULE_NOT_FOUND",
33753
+ (path, base, type = "package") => {
33754
+ return `Cannot find ${type} '${path}' imported from ${base}`;
33755
+ },
33756
+ Error
33757
+ );
33758
+ createError(
33759
+ "ERR_PACKAGE_IMPORT_NOT_DEFINED",
33760
+ (specifier, packagePath, base) => {
33761
+ return `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath}package.json` : ""} imported from ${base}`;
33762
+ },
33763
+ TypeError
33764
+ );
33765
+ createError(
33766
+ "ERR_PACKAGE_PATH_NOT_EXPORTED",
33767
+ (pkgPath, subpath, base = void 0) => {
33768
+ if (subpath === ".") {
33769
+ return `No "exports" main defined in ${pkgPath}package.json${base ? ` imported from ${base}` : ""}`;
33770
+ }
33771
+ return `Package subpath '${subpath}' is not defined by "exports" in ${pkgPath}package.json${base ? ` imported from ${base}` : ""}`;
33772
+ },
33773
+ Error
33774
+ );
33775
+ createError(
33776
+ "ERR_UNSUPPORTED_DIR_IMPORT",
33777
+ "Directory import '%s' is not supported resolving ES modules imported from %s",
33778
+ Error
33779
+ );
33780
+ createError(
33781
+ "ERR_UNKNOWN_FILE_EXTENSION",
33782
+ 'Unknown file extension "%s" for %s',
33783
+ TypeError
33784
+ );
33785
+ createError(
33786
+ "ERR_INVALID_ARG_VALUE",
33787
+ (name, value, reason = "is invalid") => {
33788
+ let inspected = inspect(value);
33789
+ if (inspected.length > 128) {
33790
+ inspected = `${inspected.slice(0, 128)}...`;
33791
+ }
33792
+ const type = name.includes(".") ? "property" : "argument";
33793
+ return `The ${type} '${name}' ${reason}. Received ${inspected}`;
33794
+ },
33795
+ TypeError
33796
+ );
33797
+ createError(
33798
+ "ERR_UNSUPPORTED_ESM_URL_SCHEME",
33799
+ (url) => {
33800
+ let message = "Only file and data URLs are supported by the default ESM loader";
33801
+ if (isWindows$3 && url.protocol.length === 2) {
33802
+ message += ". On Windows, absolute paths must be valid file:// URLs";
33803
+ }
33804
+ message += `. Received protocol '${url.protocol}'`;
33805
+ return message;
33806
+ },
33807
+ Error
33808
+ );
33809
+ function createError(sym, value, def) {
33810
+ messages.set(sym, value);
33811
+ return makeNodeErrorWithCode(def, sym);
33812
+ }
33813
+ function makeNodeErrorWithCode(Base, key) {
33814
+ return NodeError;
33815
+ function NodeError(...args) {
33816
+ const limit = Error.stackTraceLimit;
33817
+ if (isErrorStackTraceLimitWritable()) {
33818
+ Error.stackTraceLimit = 0;
33819
+ }
33820
+ const error = new Base();
33821
+ if (isErrorStackTraceLimitWritable()) {
33822
+ Error.stackTraceLimit = limit;
33823
+ }
33824
+ const message = getMessage(key, args, error);
33825
+ Object.defineProperty(error, "message", {
33826
+ value: message,
33827
+ enumerable: false,
33828
+ writable: true,
33829
+ configurable: true
33830
+ });
33831
+ Object.defineProperty(error, "toString", {
33832
+ value() {
33833
+ return `${this.name} [${key}]: ${this.message}`;
33834
+ },
33835
+ enumerable: false,
33836
+ writable: true,
33837
+ configurable: true
33838
+ });
33839
+ addCodeToName(error, Base.name, key);
33840
+ error.code = key;
33841
+ return error;
33842
+ }
33843
+ }
33844
+ const addCodeToName = hideStackFrames(
33845
+ function(error, name, code) {
33846
+ error = captureLargerStackTrace(error);
33847
+ error.name = `${name} [${code}]`;
33848
+ if (name === "SystemError") {
33849
+ Object.defineProperty(error, "name", {
33850
+ value: name,
33851
+ enumerable: false,
33852
+ writable: true,
33853
+ configurable: true
33854
+ });
33855
+ } else {
33856
+ delete error.name;
33857
+ }
33858
+ }
33859
+ );
33860
+ function isErrorStackTraceLimitWritable() {
33861
+ const desc = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit");
33862
+ if (desc === void 0) {
33863
+ return Object.isExtensible(Error);
33864
+ }
33865
+ return own$1.call(desc, "writable") ? desc.writable : desc.set !== void 0;
33866
+ }
33867
+ function hideStackFrames(fn) {
33868
+ const hidden = nodeInternalPrefix + fn.name;
33869
+ Object.defineProperty(fn, "name", { value: hidden });
33870
+ return fn;
33871
+ }
33872
+ const captureLargerStackTrace = hideStackFrames(
33873
+ function(error) {
33874
+ const stackTraceLimitIsWritable = isErrorStackTraceLimitWritable();
33875
+ if (stackTraceLimitIsWritable) {
33876
+ userStackTraceLimit = Error.stackTraceLimit;
33877
+ Error.stackTraceLimit = Number.POSITIVE_INFINITY;
33878
+ }
33879
+ Error.captureStackTrace(error);
33880
+ if (stackTraceLimitIsWritable) {
33881
+ Error.stackTraceLimit = userStackTraceLimit;
33882
+ }
33883
+ return error;
33884
+ }
33885
+ );
33886
+ function getMessage(key, args, self) {
33887
+ const message = messages.get(key);
33888
+ if (typeof message === "function") {
33889
+ assert$1(
33890
+ message.length <= args.length,
33891
+ `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${message.length}).`
33892
+ );
33893
+ return Reflect.apply(message, self, args);
33894
+ }
33895
+ const expectedLength = (message.match(/%[dfijoOs]/g) || []).length;
33896
+ assert$1(
33897
+ expectedLength === args.length,
33898
+ `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${expectedLength}).`
33899
+ );
33900
+ if (args.length === 0) {
33901
+ return message;
33902
+ }
33903
+ args.unshift(message);
33904
+ return Reflect.apply(format$2, null, args);
33905
+ }
33906
+ Object.freeze(["node", "import"]);
33907
+ pathToFileURL$1(process.cwd());
33908
+
33909
+ const ESM_STATIC_IMPORT_RE = /(?<=\s|^|;)import\s*(["'\s]*(?<imports>[\w*${}\n\r\t, /]+)from\s*)?["']\s*(?<specifier>(?<="\s*)[^"]*[^"\s](?=\s*")|(?<='\s*)[^']*[^'\s](?=\s*'))\s*["'][\s;]*/gm;
33910
+ function findStaticImports(code) {
33911
+ return matchAll(ESM_STATIC_IMPORT_RE, code, { type: "static" });
33912
+ }
33913
+ function parseStaticImport(matched) {
33914
+ const cleanedImports = (matched.imports || "").replace(/(\/\/[^\n]*\n|\/\*.*\*\/)/g, "").replace(/\s+/g, " ");
33915
+ const namedImports = {};
33916
+ for (const namedImport of cleanedImports.match(/\{([^}]*)\}/)?.[1]?.split(",") || []) {
33917
+ const [, source = namedImport.trim(), importName = source] = namedImport.match(/^\s*([^\s]*) as ([^\s]*)\s*$/) || [];
33918
+ if (source) {
33919
+ namedImports[source] = importName;
33920
+ }
33921
+ }
33922
+ const topLevelImports = cleanedImports.replace(/\{([^}]*)\}/, "");
33923
+ const namespacedImport = topLevelImports.match(/\* as \s*([^\s]*)/)?.[1];
33924
+ const defaultImport = topLevelImports.split(",").find((i) => !i.match(/[*{}]/))?.trim() || void 0;
33925
+ return {
33926
+ ...matched,
33927
+ defaultImport,
33928
+ namespacedImport,
33929
+ namedImports
33930
+ };
33931
+ }
33932
+
33933
+ const ESM_RE = /([\s;]|^)(import[\w,{}\s*]*from|import\s*['"*{]|export\b\s*(?:[*{]|default|class|type|function|const|var|let|async function)|import\.meta\b)/m;
33934
+ function hasESMSyntax(code) {
33935
+ return ESM_RE.test(code);
33936
+ }
33937
+
33693
33938
  const isDebug$5 = process.env.DEBUG;
33694
33939
  const debug$d = createDebugger('vite:resolve-details', {
33695
33940
  onlyWhenFocused: true
@@ -34351,17 +34596,19 @@ function resolvePackageEntry(id, { dir, data, setResolvedCache, getResolvedCache
34351
34596
  data.module !== browserEntry) {
34352
34597
  // if both are present, we may have a problem: some package points both
34353
34598
  // to ESM, with "module" targeting Node.js, while some packages points
34354
- // "module" to browser ESM and "browser" to UMD.
34599
+ // "module" to browser ESM and "browser" to UMD/IIFE.
34355
34600
  // the heuristics here is to actually read the browser entry when
34356
- // possible and check for hints of UMD. If it is UMD, prefer "module"
34601
+ // possible and check for hints of ESM. If it is not ESM, prefer "module"
34357
34602
  // instead; Otherwise, assume it's ESM and use it.
34358
34603
  const resolvedBrowserEntry = tryFsResolve(path$n.join(dir, browserEntry), options);
34359
34604
  if (resolvedBrowserEntry) {
34360
34605
  const content = fs$l.readFileSync(resolvedBrowserEntry, 'utf-8');
34361
- if ((/typeof exports\s*==/.test(content) &&
34362
- /typeof module\s*==/.test(content)) ||
34363
- /module\.exports\s*=/.test(content)) {
34364
- // likely UMD or CJS(!!! e.g. firebase 7.x), prefer module
34606
+ if (hasESMSyntax(content)) {
34607
+ // likely ESM, prefer browser
34608
+ entryPoint = browserEntry;
34609
+ }
34610
+ else {
34611
+ // non-ESM, UMD or IIFE or CJS(!!! e.g. firebase 7.x), prefer module
34365
34612
  entryPoint = data.module;
34366
34613
  }
34367
34614
  }
@@ -35701,7 +35948,7 @@ async function toAbsoluteGlob(glob, root, importer, resolveId) {
35701
35948
  const resolved = normalizePath$3((await resolveId(glob, importer)) || glob);
35702
35949
  if (isAbsolute$2(resolved))
35703
35950
  return pre + resolved;
35704
- throw new Error(`Invalid glob: "${glob}" (resolved: "${resolved}"). It must starts with '/' or './'`);
35951
+ throw new Error(`Invalid glob: "${glob}" (resolved: "${resolved}"). It must start with '/' or './'`);
35705
35952
  }
35706
35953
  function getCommonBase(globsResolved) {
35707
35954
  const bases = globsResolved
@@ -35824,7 +36071,8 @@ function globEntries(pattern, config) {
35824
36071
  ? []
35825
36072
  : [`**/__tests__/**`, `**/coverage/**`])
35826
36073
  ],
35827
- absolute: true
36074
+ absolute: true,
36075
+ suppressErrors: true // suppress EACCES errors
35828
36076
  });
35829
36077
  }
35830
36078
  const scriptModuleRE = /(<script\b[^>]*type\s*=\s*(?:"module"|'module')[^>]*>)(.*?)<\/script>/gims;
@@ -37358,246 +37606,6 @@ var index$1 = {
37358
37606
  getDepsOptimizer: getDepsOptimizer
37359
37607
  };
37360
37608
 
37361
- /*---------------------------------------------------------------------------------------------
37362
- * Copyright (c) Microsoft Corporation. All rights reserved.
37363
- * Licensed under the MIT License. See License.txt in the project root for license information.
37364
- *--------------------------------------------------------------------------------------------*/
37365
- var ParseOptions;
37366
- (function (ParseOptions) {
37367
- ParseOptions.DEFAULT = {
37368
- allowTrailingComma: false
37369
- };
37370
- })(ParseOptions || (ParseOptions = {}));
37371
-
37372
- function matchAll(regex, string, addition) {
37373
- const matches = [];
37374
- for (const match of string.matchAll(regex)) {
37375
- matches.push({
37376
- ...addition,
37377
- ...match.groups,
37378
- code: match[0],
37379
- start: match.index,
37380
- end: match.index + match[0].length
37381
- });
37382
- }
37383
- return matches;
37384
- }
37385
-
37386
- const isWindows$3 = process.platform === "win32";
37387
- const own$1 = {}.hasOwnProperty;
37388
- const messages = /* @__PURE__ */ new Map();
37389
- const nodeInternalPrefix = "__node_internal_";
37390
- let userStackTraceLimit;
37391
- createError(
37392
- "ERR_INVALID_MODULE_SPECIFIER",
37393
- (request, reason, base = void 0) => {
37394
- return `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ""}`;
37395
- },
37396
- TypeError
37397
- );
37398
- createError(
37399
- "ERR_INVALID_PACKAGE_CONFIG",
37400
- (path, base, message) => {
37401
- return `Invalid package config ${path}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;
37402
- },
37403
- Error
37404
- );
37405
- createError(
37406
- "ERR_INVALID_PACKAGE_TARGET",
37407
- (pkgPath, key, target, isImport = false, base = void 0) => {
37408
- const relError = typeof target === "string" && !isImport && target.length > 0 && !target.startsWith("./");
37409
- if (key === ".") {
37410
- assert$1(isImport === false);
37411
- return `Invalid "exports" main target ${JSON.stringify(target)} defined in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ""}${relError ? '; targets must start with "./"' : ""}`;
37412
- }
37413
- return `Invalid "${isImport ? "imports" : "exports"}" target ${JSON.stringify(
37414
- target
37415
- )} defined for '${key}' in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ""}${relError ? '; targets must start with "./"' : ""}`;
37416
- },
37417
- Error
37418
- );
37419
- createError(
37420
- "ERR_MODULE_NOT_FOUND",
37421
- (path, base, type = "package") => {
37422
- return `Cannot find ${type} '${path}' imported from ${base}`;
37423
- },
37424
- Error
37425
- );
37426
- createError(
37427
- "ERR_PACKAGE_IMPORT_NOT_DEFINED",
37428
- (specifier, packagePath, base) => {
37429
- return `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath}package.json` : ""} imported from ${base}`;
37430
- },
37431
- TypeError
37432
- );
37433
- createError(
37434
- "ERR_PACKAGE_PATH_NOT_EXPORTED",
37435
- (pkgPath, subpath, base = void 0) => {
37436
- if (subpath === ".") {
37437
- return `No "exports" main defined in ${pkgPath}package.json${base ? ` imported from ${base}` : ""}`;
37438
- }
37439
- return `Package subpath '${subpath}' is not defined by "exports" in ${pkgPath}package.json${base ? ` imported from ${base}` : ""}`;
37440
- },
37441
- Error
37442
- );
37443
- createError(
37444
- "ERR_UNSUPPORTED_DIR_IMPORT",
37445
- "Directory import '%s' is not supported resolving ES modules imported from %s",
37446
- Error
37447
- );
37448
- createError(
37449
- "ERR_UNKNOWN_FILE_EXTENSION",
37450
- 'Unknown file extension "%s" for %s',
37451
- TypeError
37452
- );
37453
- createError(
37454
- "ERR_INVALID_ARG_VALUE",
37455
- (name, value, reason = "is invalid") => {
37456
- let inspected = inspect(value);
37457
- if (inspected.length > 128) {
37458
- inspected = `${inspected.slice(0, 128)}...`;
37459
- }
37460
- const type = name.includes(".") ? "property" : "argument";
37461
- return `The ${type} '${name}' ${reason}. Received ${inspected}`;
37462
- },
37463
- TypeError
37464
- );
37465
- createError(
37466
- "ERR_UNSUPPORTED_ESM_URL_SCHEME",
37467
- (url) => {
37468
- let message = "Only file and data URLs are supported by the default ESM loader";
37469
- if (isWindows$3 && url.protocol.length === 2) {
37470
- message += ". On Windows, absolute paths must be valid file:// URLs";
37471
- }
37472
- message += `. Received protocol '${url.protocol}'`;
37473
- return message;
37474
- },
37475
- Error
37476
- );
37477
- function createError(sym, value, def) {
37478
- messages.set(sym, value);
37479
- return makeNodeErrorWithCode(def, sym);
37480
- }
37481
- function makeNodeErrorWithCode(Base, key) {
37482
- return NodeError;
37483
- function NodeError(...args) {
37484
- const limit = Error.stackTraceLimit;
37485
- if (isErrorStackTraceLimitWritable()) {
37486
- Error.stackTraceLimit = 0;
37487
- }
37488
- const error = new Base();
37489
- if (isErrorStackTraceLimitWritable()) {
37490
- Error.stackTraceLimit = limit;
37491
- }
37492
- const message = getMessage(key, args, error);
37493
- Object.defineProperty(error, "message", {
37494
- value: message,
37495
- enumerable: false,
37496
- writable: true,
37497
- configurable: true
37498
- });
37499
- Object.defineProperty(error, "toString", {
37500
- value() {
37501
- return `${this.name} [${key}]: ${this.message}`;
37502
- },
37503
- enumerable: false,
37504
- writable: true,
37505
- configurable: true
37506
- });
37507
- addCodeToName(error, Base.name, key);
37508
- error.code = key;
37509
- return error;
37510
- }
37511
- }
37512
- const addCodeToName = hideStackFrames(
37513
- function(error, name, code) {
37514
- error = captureLargerStackTrace(error);
37515
- error.name = `${name} [${code}]`;
37516
- if (name === "SystemError") {
37517
- Object.defineProperty(error, "name", {
37518
- value: name,
37519
- enumerable: false,
37520
- writable: true,
37521
- configurable: true
37522
- });
37523
- } else {
37524
- delete error.name;
37525
- }
37526
- }
37527
- );
37528
- function isErrorStackTraceLimitWritable() {
37529
- const desc = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit");
37530
- if (desc === void 0) {
37531
- return Object.isExtensible(Error);
37532
- }
37533
- return own$1.call(desc, "writable") ? desc.writable : desc.set !== void 0;
37534
- }
37535
- function hideStackFrames(fn) {
37536
- const hidden = nodeInternalPrefix + fn.name;
37537
- Object.defineProperty(fn, "name", { value: hidden });
37538
- return fn;
37539
- }
37540
- const captureLargerStackTrace = hideStackFrames(
37541
- function(error) {
37542
- const stackTraceLimitIsWritable = isErrorStackTraceLimitWritable();
37543
- if (stackTraceLimitIsWritable) {
37544
- userStackTraceLimit = Error.stackTraceLimit;
37545
- Error.stackTraceLimit = Number.POSITIVE_INFINITY;
37546
- }
37547
- Error.captureStackTrace(error);
37548
- if (stackTraceLimitIsWritable) {
37549
- Error.stackTraceLimit = userStackTraceLimit;
37550
- }
37551
- return error;
37552
- }
37553
- );
37554
- function getMessage(key, args, self) {
37555
- const message = messages.get(key);
37556
- if (typeof message === "function") {
37557
- assert$1(
37558
- message.length <= args.length,
37559
- `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${message.length}).`
37560
- );
37561
- return Reflect.apply(message, self, args);
37562
- }
37563
- const expectedLength = (message.match(/%[dfijoOs]/g) || []).length;
37564
- assert$1(
37565
- expectedLength === args.length,
37566
- `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${expectedLength}).`
37567
- );
37568
- if (args.length === 0) {
37569
- return message;
37570
- }
37571
- args.unshift(message);
37572
- return Reflect.apply(format$2, null, args);
37573
- }
37574
- Object.freeze(["node", "import"]);
37575
- pathToFileURL$1(process.cwd());
37576
-
37577
- const ESM_STATIC_IMPORT_RE = /(?<=\s|^|;)import\s*(["'\s]*(?<imports>[\w*${}\n\r\t, /]+)from\s*)?["']\s*(?<specifier>(?<="\s*)[^"]*[^"\s](?=\s*")|(?<='\s*)[^']*[^'\s](?=\s*'))\s*["'][\s;]*/gm;
37578
- function findStaticImports(code) {
37579
- return matchAll(ESM_STATIC_IMPORT_RE, code, { type: "static" });
37580
- }
37581
- function parseStaticImport(matched) {
37582
- const cleanedImports = (matched.imports || "").replace(/(\/\/[^\n]*\n|\/\*.*\*\/)/g, "").replace(/\s+/g, " ");
37583
- const namedImports = {};
37584
- for (const namedImport of cleanedImports.match(/\{([^}]*)\}/)?.[1]?.split(",") || []) {
37585
- const [, source = namedImport.trim(), importName = source] = namedImport.match(/^\s*([^\s]*) as ([^\s]*)\s*$/) || [];
37586
- if (source) {
37587
- namedImports[source] = importName;
37588
- }
37589
- }
37590
- const topLevelImports = cleanedImports.replace(/\{([^}]*)\}/, "");
37591
- const namespacedImport = topLevelImports.match(/\* as \s*([^\s]*)/)?.[1];
37592
- const defaultImport = topLevelImports.split(",").find((i) => !i.match(/[*{}]/))?.trim() || void 0;
37593
- return {
37594
- ...matched,
37595
- defaultImport,
37596
- namespacedImport,
37597
- namedImports
37598
- };
37599
- }
37600
-
37601
37609
  const debugHmr = createDebugger('vite:hmr');
37602
37610
  const normalizedClientDir = normalizePath$3(CLIENT_DIR);
37603
37611
  function getShortName(file, root) {
@@ -37736,6 +37744,7 @@ function propagateUpdate(node, boundaries, currentChain = [node]) {
37736
37744
  // if the imports of `node` have not been analyzed, then `node` has not
37737
37745
  // been loaded in the browser and we should stop propagation.
37738
37746
  if (node.id && node.isSelfAccepting === undefined) {
37747
+ debugHmr(`[propagate update] stop propagation because not analyzed: ${picocolors.exports.dim(node.id)}`);
37739
37748
  return false;
37740
37749
  }
37741
37750
  if (node.isSelfAccepting) {
@@ -39056,7 +39065,7 @@ async function ssrTransformScript(code, inMap, url, originalCode) {
39056
39065
  // let binding used in a property shorthand
39057
39066
  // { foo } -> { foo: __import_x__.foo }
39058
39067
  // skip for destructuring patterns
39059
- if (!isNodeInPatternWeakMap.get(parent) ||
39068
+ if (!isNodeInPattern(parent) ||
39060
39069
  isInDestructuringAssignment(parent, parentStack)) {
39061
39070
  s.appendLeft(id.end, `: ${binding}`);
39062
39071
  }
@@ -39111,7 +39120,9 @@ async function ssrTransformScript(code, inMap, url, originalCode) {
39111
39120
  dynamicDeps: [...dynamicDeps]
39112
39121
  };
39113
39122
  }
39114
- const isNodeInPatternWeakMap = new WeakMap();
39123
+ const isNodeInPatternWeakSet = new WeakSet();
39124
+ const setIsNodeInPattern = (node) => isNodeInPatternWeakSet.add(node);
39125
+ const isNodeInPattern = (node) => isNodeInPatternWeakSet.has(node);
39115
39126
  /**
39116
39127
  * Same logic from \@vue/compiler-core & \@vue/compiler-sfc
39117
39128
  * Except this is using acorn AST
@@ -39226,7 +39237,7 @@ function walk(root, { onIdentifier, onImportMeta, onDynamicImport }) {
39226
39237
  }
39227
39238
  else if (node.type === 'Property' && parent.type === 'ObjectPattern') {
39228
39239
  // mark property in destructuring pattern
39229
- isNodeInPatternWeakMap.set(node, true);
39240
+ setIsNodeInPattern(node);
39230
39241
  }
39231
39242
  else if (node.type === 'VariableDeclarator') {
39232
39243
  const parentFunction = findParentFunction(parentStack);
@@ -39269,8 +39280,11 @@ function isRefIdentifier(id, parent, parentStack) {
39269
39280
  return false;
39270
39281
  }
39271
39282
  // property key
39272
- // this also covers object destructuring pattern
39273
- if (isStaticPropertyKey(id, parent) || isNodeInPatternWeakMap.get(parent)) {
39283
+ if (isStaticPropertyKey(id, parent)) {
39284
+ return false;
39285
+ }
39286
+ // object destructuring pattern
39287
+ if (isNodeInPattern(parent) && parent.value === id) {
39274
39288
  return false;
39275
39289
  }
39276
39290
  // non-assignment array destructuring pattern
@@ -40056,7 +40070,7 @@ function throwOutdatedRequest(id) {
40056
40070
  const isDebug$1 = !!process.env.DEBUG;
40057
40071
  const debug$7 = createDebugger('vite:import-analysis');
40058
40072
  const clientDir = normalizePath$3(CLIENT_DIR);
40059
- const skipRE = /\.(map|json)$/;
40073
+ const skipRE = /\.(map|json)($|\?)/;
40060
40074
  const canSkipImportAnalysis = (id) => skipRE.test(id) || isDirectCSSRequest(id);
40061
40075
  const optimizedDepChunkRE$1 = /\/chunk-[A-Z0-9]{8}\.js/;
40062
40076
  const optimizedDepDynamicRE$1 = /-[A-Z0-9]{8}\.js/;
@@ -41155,7 +41169,7 @@ const assetAttrsConfig = {
41155
41169
  const isAsyncScriptMap = new WeakMap();
41156
41170
  async function traverseHtml(html, filePath, visitor) {
41157
41171
  // lazy load compiler
41158
- const { parse, transform } = await import('./dep-b58adab6.js').then(function (n) { return n.c; });
41172
+ const { parse, transform } = await import('./dep-aabb0c58.js').then(function (n) { return n.c; });
41159
41173
  // @vue/compiler-core doesn't like lowercase doctypes
41160
41174
  html = html.replace(/<!doctype\s/i, '<!DOCTYPE ');
41161
41175
  try {
@@ -41839,7 +41853,7 @@ function cssPlugin(config) {
41839
41853
  }
41840
41854
  return url;
41841
41855
  };
41842
- const { code: css, modules, deps, map } = await compileCSS(id, raw, config, urlReplacer, atImportResolvers, server);
41856
+ const { code: css, modules, deps, map } = await compileCSS(id, raw, config, urlReplacer, atImportResolvers);
41843
41857
  if (modules) {
41844
41858
  moduleCache.set(id, modules);
41845
41859
  }
@@ -42293,7 +42307,7 @@ async function compileCSS(id, code, config, urlReplacer, atImportResolvers, serv
42293
42307
  logger: config.logger
42294
42308
  }));
42295
42309
  if (isModule) {
42296
- postcssPlugins.unshift((await import('./dep-0f192b10.js').then(function (n) { return n.i; })).default({
42310
+ postcssPlugins.unshift((await import('./dep-399ffe4b.js').then(function (n) { return n.i; })).default({
42297
42311
  ...modulesOptions,
42298
42312
  getJSON(cssFileName, _modules, outputFileName) {
42299
42313
  modules = _modules;
@@ -43143,7 +43157,7 @@ function ssrManifestPlugin(config) {
43143
43157
  const code = chunk.code;
43144
43158
  let imports;
43145
43159
  try {
43146
- imports = parse$b(code)[0].filter((i) => i.d > -1);
43160
+ imports = parse$b(code)[0].filter((i) => i.n && i.d > -1);
43147
43161
  }
43148
43162
  catch (e) {
43149
43163
  this.error(e, e.idx);
@@ -43304,6 +43318,22 @@ function ensureWatchPlugin() {
43304
43318
  };
43305
43319
  }
43306
43320
 
43321
+ function resolveChokidarOptions(options) {
43322
+ const { ignored = [], ...otherOptions } = options ?? {};
43323
+ const resolvedWatchOptions = {
43324
+ ignored: [
43325
+ '**/.git/**',
43326
+ '**/node_modules/**',
43327
+ '**/test-results/**',
43328
+ ...(Array.isArray(ignored) ? ignored : [ignored])
43329
+ ],
43330
+ ignoreInitial: true,
43331
+ ignorePermissionErrors: true,
43332
+ ...otherOptions
43333
+ };
43334
+ return resolvedWatchOptions;
43335
+ }
43336
+
43307
43337
  function resolveBuildOptions(raw, isBuild, logger) {
43308
43338
  const resolved = {
43309
43339
  target: 'modules',
@@ -43523,23 +43553,14 @@ async function doBuild(inlineConfig = {}) {
43523
43553
  else {
43524
43554
  output.push(buildOutputOptions(outputs));
43525
43555
  }
43526
- const watcherOptions = config.build.watch;
43556
+ const resolvedChokidarOptions = resolveChokidarOptions(config.build.watch.chokidar);
43527
43557
  const { watch } = await import('rollup');
43528
43558
  const watcher = watch({
43529
43559
  ...rollupOptions,
43530
43560
  output,
43531
43561
  watch: {
43532
- ...watcherOptions,
43533
- chokidar: {
43534
- ignoreInitial: true,
43535
- ignorePermissionErrors: true,
43536
- ...watcherOptions.chokidar,
43537
- ignored: [
43538
- '**/node_modules/**',
43539
- '**/.git/**',
43540
- ...(watcherOptions?.chokidar?.ignored || [])
43541
- ]
43542
- }
43562
+ ...config.build.watch,
43563
+ chokidar: resolvedChokidarOptions
43543
43564
  }
43544
43565
  });
43545
43566
  watcher.on('event', (event) => {
@@ -43763,7 +43784,32 @@ function wrapSsrTransform(fn) {
43763
43784
  function injectSsrFlag(options) {
43764
43785
  return { ...(options ?? {}), ssr: true };
43765
43786
  }
43766
- function toOutputFilePathInString(filename, type, hostId, hostType, config, toRelative = toImportMetaURLBasedRelativePath) {
43787
+ /*
43788
+ The following functions are copied from rollup
43789
+ https://github.com/rollup/rollup/blob/c5269747cd3dd14c4b306e8cea36f248d9c1aa01/src/ast/nodes/MetaProperty.ts#L189-L232
43790
+
43791
+ https://github.com/rollup/rollup
43792
+ The MIT License (MIT)
43793
+ Copyright (c) 2017 [these people](https://github.com/rollup/rollup/graphs/contributors)
43794
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
43795
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
43796
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
43797
+ */
43798
+ const getResolveUrl = (path, URL = 'URL') => `new ${URL}(${path}).href`;
43799
+ const getRelativeUrlFromDocument = (relativePath, umd = false) => getResolveUrl(`'${relativePath}', ${umd ? `typeof document === 'undefined' ? location.href : ` : ''}document.currentScript && document.currentScript.src || document.baseURI`);
43800
+ const relativeUrlMechanisms = {
43801
+ amd: (relativePath) => {
43802
+ if (relativePath[0] !== '.')
43803
+ relativePath = './' + relativePath;
43804
+ return getResolveUrl(`require.toUrl('${relativePath}'), document.baseURI`);
43805
+ },
43806
+ cjs: (relativePath) => `(typeof document === 'undefined' ? ${getResolveUrl(`'file:' + __dirname + '/${relativePath}'`, `(require('u' + 'rl').URL)`)} : ${getRelativeUrlFromDocument(relativePath)})`,
43807
+ es: (relativePath) => getResolveUrl(`'${relativePath}', import.meta.url`),
43808
+ iife: (relativePath) => getRelativeUrlFromDocument(relativePath),
43809
+ system: (relativePath) => getResolveUrl(`'${relativePath}', module.meta.url`),
43810
+ umd: (relativePath) => `(typeof document === 'undefined' && typeof location === 'undefined' ? ${getResolveUrl(`'file:' + __dirname + '/${relativePath}'`, `(require('u' + 'rl').URL)`)} : ${getRelativeUrlFromDocument(relativePath, true)})`
43811
+ };
43812
+ function toOutputFilePathInString(filename, type, hostId, hostType, config, format, toRelative = getToImportMetaURLBasedRelativePath(format)) {
43767
43813
  const { renderBuiltUrl } = config.experimental;
43768
43814
  let relative = config.base === '' || config.base === './';
43769
43815
  if (renderBuiltUrl) {
@@ -43790,10 +43836,11 @@ function toOutputFilePathInString(filename, type, hostId, hostType, config, toRe
43790
43836
  }
43791
43837
  return config.base + filename;
43792
43838
  }
43793
- function toImportMetaURLBasedRelativePath(filename, importer) {
43794
- return {
43795
- runtime: `new URL(${JSON.stringify(path$n.posix.relative(path$n.dirname(importer), filename))},import.meta.url).href`
43796
- };
43839
+ function getToImportMetaURLBasedRelativePath(format) {
43840
+ const toRelativePath = relativeUrlMechanisms[format];
43841
+ return (filename, importer) => ({
43842
+ runtime: toRelativePath(path$n.posix.relative(path$n.dirname(importer), filename))
43843
+ });
43797
43844
  }
43798
43845
  function toOutputFilePathWithoutRuntime(filename, type, hostId, hostType, config, toRelative) {
43799
43846
  const { renderBuiltUrl } = config.experimental;
@@ -50217,6 +50264,14 @@ async function httpServerStart(httpServer, serverOptions) {
50217
50264
  });
50218
50265
  });
50219
50266
  }
50267
+ function setClientErrorHandler(server, logger) {
50268
+ server.on('clientError', (err, socket) => {
50269
+ if (err.code === 'HPE_HEADER_OVERFLOW') {
50270
+ logger.warn(picocolors.exports.yellow('Server responded with status code 431. ' +
50271
+ 'See https://vitejs.dev/guide/troubleshooting.html#_431-request-header-fields-too-large.'));
50272
+ }
50273
+ });
50274
+ }
50220
50275
 
50221
50276
  /**
50222
50277
  * This plugin hooks into Node's module resolution algorithm at runtime,
@@ -59090,24 +59145,19 @@ async function createServer(inlineConfig = {}) {
59090
59145
  const { root, server: serverConfig } = config;
59091
59146
  const httpsOptions = await resolveHttpsConfig(config.server.https);
59092
59147
  const { middlewareMode } = serverConfig;
59148
+ const resolvedWatchOptions = resolveChokidarOptions({
59149
+ disableGlobbing: true,
59150
+ ...serverConfig.watch
59151
+ });
59093
59152
  const middlewares = connect();
59094
59153
  const httpServer = middlewareMode
59095
59154
  ? null
59096
59155
  : await resolveHttpServer(serverConfig, middlewares, httpsOptions);
59097
59156
  const ws = createWebSocketServer(httpServer, config, httpsOptions);
59098
- const { ignored = [], ...watchOptions } = serverConfig.watch || {};
59099
- const watcher = chokidar.watch(path$n.resolve(root), {
59100
- ignored: [
59101
- '**/.git/**',
59102
- '**/node_modules/**',
59103
- '**/test-results/**',
59104
- ...(Array.isArray(ignored) ? ignored : [ignored])
59105
- ],
59106
- ignoreInitial: true,
59107
- ignorePermissionErrors: true,
59108
- disableGlobbing: true,
59109
- ...watchOptions
59110
- });
59157
+ if (httpServer) {
59158
+ setClientErrorHandler(httpServer, config.logger);
59159
+ }
59160
+ const watcher = chokidar.watch(path$n.resolve(root), resolvedWatchOptions);
59111
59161
  const moduleGraph = new ModuleGraph((url, ssr) => container.resolveId(url, undefined, { ssr }));
59112
59162
  const container = await createPluginContainer(config, moduleGraph, watcher);
59113
59163
  const closeHttpServer = createServerCloseFn(httpServer);
@@ -59653,6 +59703,7 @@ async function preview(inlineConfig = {}) {
59653
59703
  const config = await resolveConfig(inlineConfig, 'serve', 'production');
59654
59704
  const app = connect();
59655
59705
  const httpServer = await resolveHttpServer(config.preview, app, await resolveHttpsConfig(config.preview?.https));
59706
+ setClientErrorHandler(httpServer, config.logger);
59656
59707
  // apply server hooks from plugins
59657
59708
  const postHooks = [];
59658
59709
  for (const plugin of config.plugins) {
@@ -60096,7 +60147,7 @@ function webWorkerPlugin(config) {
60096
60147
  map: { mappings: '' } // Empty sourcemap to suppress Rollup warning
60097
60148
  };
60098
60149
  },
60099
- renderChunk(code, chunk) {
60150
+ renderChunk(code, chunk, outputOptions) {
60100
60151
  let s;
60101
60152
  const result = () => {
60102
60153
  return (s && {
@@ -60113,7 +60164,7 @@ function webWorkerPlugin(config) {
60113
60164
  while ((match = workerAssetUrlRE.exec(code))) {
60114
60165
  const [full, hash] = match;
60115
60166
  const filename = fileNameHash.get(hash);
60116
- const replacement = toOutputFilePathInString(filename, 'asset', chunk.fileName, 'js', config);
60167
+ const replacement = toOutputFilePathInString(filename, 'asset', chunk.fileName, 'js', config, outputOptions.format);
60117
60168
  const replacementString = typeof replacement === 'string'
60118
60169
  ? JSON.stringify(replacement).slice(1, -1)
60119
60170
  : `"+${replacement.runtime}+"`;
@@ -60121,20 +60172,19 @@ function webWorkerPlugin(config) {
60121
60172
  contentOnly: true
60122
60173
  });
60123
60174
  }
60124
- // TODO: check if this should be removed
60125
- if (config.isWorker) {
60126
- s = s.replace('import.meta.url', 'self.location.href');
60127
- return result();
60128
- }
60129
- }
60130
- if (!isWorker) {
60131
- const workerMap = workerCache.get(config);
60132
- workerMap.assets.forEach((asset) => {
60133
- this.emitFile(asset);
60134
- workerMap.assets.delete(asset.fileName);
60135
- });
60136
60175
  }
60137
60176
  return result();
60177
+ },
60178
+ generateBundle(opts) {
60179
+ // @ts-ignore asset emits are skipped in legacy bundle
60180
+ if (opts.__vite_skip_asset_emit__ || isWorker) {
60181
+ return;
60182
+ }
60183
+ const workerMap = workerCache.get(config);
60184
+ workerMap.assets.forEach((asset) => {
60185
+ this.emitFile(asset);
60186
+ workerMap.assets.delete(asset.fileName);
60187
+ });
60138
60188
  }
60139
60189
  };
60140
60190
  }
@@ -62941,7 +62991,7 @@ async function bundleConfigFile(fileName, isESM) {
62941
62991
  if (path$n.relative(idPkgDir, fileName).startsWith('..')) {
62942
62992
  return {
62943
62993
  // normalize actual import after bundled as a single vite config
62944
- path: pathToFileURL(idFsPath).href,
62994
+ path: isESM ? pathToFileURL(idFsPath).href : idFsPath,
62945
62995
  external: true
62946
62996
  };
62947
62997
  }
@@ -1,4 +1,4 @@
1
- import { A as getAugmentedNamespace, B as getDefaultExportFromCjs } from './dep-5cb728cb.js';
1
+ import { A as getAugmentedNamespace, B as getDefaultExportFromCjs } from './dep-74663fff.js';
2
2
 
3
3
  import { fileURLToPath as __cjs_fileURLToPath } from 'node:url';
4
4
  import { dirname as __cjs_dirname } from 'node:path';
package/dist/node/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { performance } from 'node:perf_hooks';
2
2
  import { EventEmitter } from 'events';
3
- import { y as picocolors, u as createLogger, e as resolveConfig } from './chunks/dep-5cb728cb.js';
3
+ import { y as picocolors, u as createLogger, e as resolveConfig } from './chunks/dep-74663fff.js';
4
4
  import { VERSION } from './constants.js';
5
5
  import 'node:fs';
6
6
  import 'node:path';
@@ -694,7 +694,7 @@ cli
694
694
  .action(async (root, options) => {
695
695
  // output structure is preserved even after bundling so require()
696
696
  // is ok here
697
- const { createServer } = await import('./chunks/dep-5cb728cb.js').then(function (n) { return n.E; });
697
+ const { createServer } = await import('./chunks/dep-74663fff.js').then(function (n) { return n.E; });
698
698
  try {
699
699
  const server = await createServer({
700
700
  root,
@@ -741,7 +741,7 @@ cli
741
741
  .option('--emptyOutDir', `[boolean] force empty outDir when it's outside of root`)
742
742
  .option('-w, --watch', `[boolean] rebuilds when modules have changed on disk`)
743
743
  .action(async (root, options) => {
744
- const { build } = await import('./chunks/dep-5cb728cb.js').then(function (n) { return n.D; });
744
+ const { build } = await import('./chunks/dep-74663fff.js').then(function (n) { return n.D; });
745
745
  const buildOptions = cleanOptions(options);
746
746
  try {
747
747
  await build({
@@ -765,7 +765,7 @@ cli
765
765
  .command('optimize [root]', 'pre-bundle dependencies')
766
766
  .option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
767
767
  .action(async (root, options) => {
768
- const { optimizeDeps } = await import('./chunks/dep-5cb728cb.js').then(function (n) { return n.C; });
768
+ const { optimizeDeps } = await import('./chunks/dep-74663fff.js').then(function (n) { return n.C; });
769
769
  try {
770
770
  const config = await resolveConfig({
771
771
  root,
@@ -788,7 +788,7 @@ cli
788
788
  .option('--https', `[boolean] use TLS + HTTP/2`)
789
789
  .option('--open [path]', `[boolean | string] open browser on startup`)
790
790
  .action(async (root, options) => {
791
- const { preview } = await import('./chunks/dep-5cb728cb.js').then(function (n) { return n.F; });
791
+ const { preview } = await import('./chunks/dep-74663fff.js').then(function (n) { return n.F; });
792
792
  try {
793
793
  const server = await preview({
794
794
  root,
@@ -1,7 +1,7 @@
1
1
  import path, { resolve } from 'node:path';
2
2
  import { fileURLToPath } from 'node:url';
3
3
 
4
- var version = "3.0.5";
4
+ var version = "3.0.8";
5
5
 
6
6
  const VERSION = version;
7
7
  const DEFAULT_MAIN_FIELDS = [
@@ -1,4 +1,4 @@
1
- export { b as build, k as createFilter, u as createLogger, c as createServer, d as defineConfig, f as formatPostcssSourceMap, h as getDepOptimizationConfig, i as isDepsOptimizerEnabled, l as loadConfigFromFile, w as loadEnv, j as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, p as preview, g as resolveBaseUrl, e as resolveConfig, x as resolveEnvPrefix, a as resolvePackageData, r as resolvePackageEntry, v as searchForWorkspaceRoot, q as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-5cb728cb.js';
1
+ export { b as build, k as createFilter, u as createLogger, c as createServer, d as defineConfig, f as formatPostcssSourceMap, h as getDepOptimizationConfig, i as isDepsOptimizerEnabled, l as loadConfigFromFile, w as loadEnv, j as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, p as preview, g as resolveBaseUrl, e as resolveConfig, x as resolveEnvPrefix, a as resolvePackageData, r as resolvePackageEntry, v as searchForWorkspaceRoot, q as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-74663fff.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';
@@ -31,7 +31,7 @@ var require$$1__default$1 = /*#__PURE__*/_interopDefaultLegacy(require$$1$1);
31
31
  var readline__default = /*#__PURE__*/_interopDefaultLegacy(readline);
32
32
  var require$$2__default = /*#__PURE__*/_interopDefaultLegacy(require$$2);
33
33
 
34
- var version = "3.0.5";
34
+ var version = "3.0.8";
35
35
 
36
36
  const VERSION = version;
37
37
  const VITE_PACKAGE_DIR = path$3.resolve(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite",
3
- "version": "3.0.5",
3
+ "version": "3.0.8",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Evan You",
@@ -61,7 +61,7 @@
61
61
  "esbuild": "^0.14.47",
62
62
  "postcss": "^8.4.16",
63
63
  "resolve": "^1.22.1",
64
- "rollup": "^2.75.6"
64
+ "rollup": ">=2.75.6 <2.77.0 || ~2.77.0"
65
65
  },
66
66
  "optionalDependencies": {
67
67
  "fsevents": "~2.3.2"
@@ -101,7 +101,7 @@ function setupWebSocket(
101
101
  }
102
102
 
103
103
  console.log(`[vite] server connection lost. polling for restart...`)
104
- await waitForSuccessfulPing(hostAndPath)
104
+ await waitForSuccessfulPing(protocol, hostAndPath)
105
105
  location.reload()
106
106
  })
107
107
 
@@ -292,14 +292,22 @@ async function queueUpdate(p: Promise<(() => void) | undefined>) {
292
292
  }
293
293
  }
294
294
 
295
- async function waitForSuccessfulPing(hostAndPath: string, ms = 1000) {
295
+ async function waitForSuccessfulPing(
296
+ socketProtocol: string,
297
+ hostAndPath: string,
298
+ ms = 1000
299
+ ) {
300
+ const pingHostProtocol = socketProtocol === 'wss' ? 'https' : 'http'
301
+
296
302
  // eslint-disable-next-line no-constant-condition
297
303
  while (true) {
298
304
  try {
299
305
  // A fetch on a websocket URL will return a successful promise with status 400,
300
306
  // but will reject a networking error.
301
307
  // When running on middleware mode, it returns status 426, and an cors error happens if mode is not no-cors
302
- await fetch(`${location.protocol}//${hostAndPath}`, { mode: 'no-cors' })
308
+ await fetch(`${pingHostProtocol}://${hostAndPath}`, {
309
+ mode: 'no-cors'
310
+ })
303
311
  break
304
312
  } catch (e) {
305
313
  // wait ms before attempting to ping again