vite 5.2.0-beta.0 → 5.2.0

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.
@@ -465,6 +465,7 @@ if (customElements && !customElements.get(overlayId)) {
465
465
  customElements.define(overlayId, ErrorOverlay);
466
466
  }
467
467
 
468
+ var _a;
468
469
  console.debug('[vite] connecting...');
469
470
  const importMetaUrl = new URL(import.meta.url);
470
471
  // use server configuration, then fallback to inference
@@ -529,7 +530,7 @@ function setupWebSocket(protocol, hostAndPath, onCloseWithoutOpen) {
529
530
  return socket;
530
531
  }
531
532
  function cleanUrl(pathname) {
532
- const url = new URL(pathname, location.toString());
533
+ const url = new URL(pathname, 'http://vitejs.dev');
533
534
  url.searchParams.delete('direct');
534
535
  return url.pathname + url.search;
535
536
  }
@@ -749,6 +750,9 @@ if ('document' in globalThis) {
749
750
  sheetsMap.set(el.getAttribute('data-vite-dev-id'), el);
750
751
  });
751
752
  }
753
+ const cspNonce = 'document' in globalThis
754
+ ? (_a = document.querySelector('meta[property=csp-nonce]')) === null || _a === void 0 ? void 0 : _a.nonce
755
+ : undefined;
752
756
  // all css imports should be inserted at the same position
753
757
  // because after build it will be a single css file
754
758
  let lastInsertedStyle;
@@ -759,6 +763,9 @@ function updateStyle(id, content) {
759
763
  style.setAttribute('type', 'text/css');
760
764
  style.setAttribute('data-vite-dev-id', id);
761
765
  style.textContent = content;
766
+ if (cspNonce) {
767
+ style.setAttribute('nonce', cspNonce);
768
+ }
762
769
  if (!lastInsertedStyle) {
763
770
  document.head.appendChild(style);
764
771
  // reset lastInsertedStyle after async
@@ -1 +1 @@
1
- {"version":3,"file":"client.mjs","sources":["hmr.ts","overlay.ts","client.ts"],"sourcesContent":["import type { Update } from 'types/hmrPayload'\nimport type { ModuleNamespace, ViteHotContext } from 'types/hot'\nimport type { InferCustomEventPayload } from 'types/customEvent'\n\ntype CustomListenersMap = Map<string, ((data: any) => void)[]>\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\nexport interface HMRLogger {\n error(msg: string | Error): void\n debug(...msg: unknown[]): void\n}\n\nexport interface HMRConnection {\n /**\n * Checked before sending messages to the client.\n */\n isReady(): boolean\n /**\n * Send message to the client.\n */\n send(messages: string): void\n}\n\nexport class HMRContext implements ViteHotContext {\n private newListeners: CustomListenersMap\n\n constructor(\n private hmrClient: HMRClient,\n private ownerPath: string,\n ) {\n if (!hmrClient.dataMap.has(ownerPath)) {\n hmrClient.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 = hmrClient.hotModulesMap.get(ownerPath)\n if (mod) {\n mod.callbacks = []\n }\n\n // clear stale custom event listeners\n const staleListeners = hmrClient.ctxToListenersMap.get(ownerPath)\n if (staleListeners) {\n for (const [event, staleFns] of staleListeners) {\n const listeners = hmrClient.customListenersMap.get(event)\n if (listeners) {\n hmrClient.customListenersMap.set(\n event,\n listeners.filter((l) => !staleFns.includes(l)),\n )\n }\n }\n }\n\n this.newListeners = new Map()\n hmrClient.ctxToListenersMap.set(ownerPath, this.newListeners)\n }\n\n get data(): any {\n return this.hmrClient.dataMap.get(this.ownerPath)\n }\n\n accept(deps?: any, callback?: any): void {\n if (typeof deps === 'function' || !deps) {\n // self-accept: hot.accept(() => {})\n this.acceptDeps([this.ownerPath], ([mod]) => deps?.(mod))\n } else if (typeof deps === 'string') {\n // explicit deps\n this.acceptDeps([deps], ([mod]) => callback?.(mod))\n } else if (Array.isArray(deps)) {\n this.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(\n _: string | readonly string[],\n callback: (data: any) => void,\n ): void {\n this.acceptDeps([this.ownerPath], ([mod]) => callback?.(mod))\n }\n\n dispose(cb: (data: any) => void): void {\n this.hmrClient.disposeMap.set(this.ownerPath, cb)\n }\n\n prune(cb: (data: any) => void): void {\n this.hmrClient.pruneMap.set(this.ownerPath, cb)\n }\n\n // Kept for backward compatibility (#11036)\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n decline(): void {}\n\n invalidate(message: string): void {\n this.hmrClient.notifyListeners('vite:invalidate', {\n path: this.ownerPath,\n message,\n })\n this.send('vite:invalidate', { path: this.ownerPath, message })\n this.hmrClient.logger.debug(\n `[vite] invalidate ${this.ownerPath}${message ? `: ${message}` : ''}`,\n )\n }\n\n on<T extends string>(\n event: T,\n cb: (payload: InferCustomEventPayload<T>) => void,\n ): void {\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(this.hmrClient.customListenersMap)\n addToMap(this.newListeners)\n }\n\n off<T extends string>(\n event: T,\n cb: (payload: InferCustomEventPayload<T>) => void,\n ): void {\n const removeFromMap = (map: Map<string, any[]>) => {\n const existing = map.get(event)\n if (existing === undefined) {\n return\n }\n const pruned = existing.filter((l) => l !== cb)\n if (pruned.length === 0) {\n map.delete(event)\n return\n }\n map.set(event, pruned)\n }\n removeFromMap(this.hmrClient.customListenersMap)\n removeFromMap(this.newListeners)\n }\n\n send<T extends string>(event: T, data?: InferCustomEventPayload<T>): void {\n this.hmrClient.messenger.send(\n JSON.stringify({ type: 'custom', event, data }),\n )\n }\n\n private acceptDeps(\n deps: string[],\n callback: HotCallback['fn'] = () => {},\n ): void {\n const mod: HotModule = this.hmrClient.hotModulesMap.get(this.ownerPath) || {\n id: this.ownerPath,\n callbacks: [],\n }\n mod.callbacks.push({\n deps,\n fn: callback,\n })\n this.hmrClient.hotModulesMap.set(this.ownerPath, mod)\n }\n}\n\nclass HMRMessenger {\n constructor(private connection: HMRConnection) {}\n\n private queue: string[] = []\n\n public send(message: string): void {\n this.queue.push(message)\n this.flush()\n }\n\n public flush(): void {\n if (this.connection.isReady()) {\n this.queue.forEach((msg) => this.connection.send(msg))\n this.queue = []\n }\n }\n}\n\nexport class HMRClient {\n public hotModulesMap = new Map<string, HotModule>()\n public disposeMap = new Map<string, (data: any) => void | Promise<void>>()\n public pruneMap = new Map<string, (data: any) => void | Promise<void>>()\n public dataMap = new Map<string, any>()\n public customListenersMap: CustomListenersMap = new Map()\n public ctxToListenersMap = new Map<string, CustomListenersMap>()\n\n public messenger: HMRMessenger\n\n constructor(\n public logger: HMRLogger,\n connection: HMRConnection,\n // This allows implementing reloading via different methods depending on the environment\n private importUpdatedModule: (update: Update) => Promise<ModuleNamespace>,\n ) {\n this.messenger = new HMRMessenger(connection)\n }\n\n public async notifyListeners<T extends string>(\n event: T,\n data: InferCustomEventPayload<T>,\n ): Promise<void>\n public async notifyListeners(event: string, data: any): Promise<void> {\n const cbs = this.customListenersMap.get(event)\n if (cbs) {\n await Promise.allSettled(cbs.map((cb) => cb(data)))\n }\n }\n\n public clear(): void {\n this.hotModulesMap.clear()\n this.disposeMap.clear()\n this.pruneMap.clear()\n this.dataMap.clear()\n this.customListenersMap.clear()\n this.ctxToListenersMap.clear()\n }\n\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 public async prunePaths(paths: string[]): Promise<void> {\n await Promise.all(\n paths.map((path) => {\n const disposer = this.disposeMap.get(path)\n if (disposer) return disposer(this.dataMap.get(path))\n }),\n )\n paths.forEach((path) => {\n const fn = this.pruneMap.get(path)\n if (fn) {\n fn(this.dataMap.get(path))\n }\n })\n }\n\n protected warnFailedUpdate(err: Error, path: string | string[]): void {\n if (!err.message.includes('fetch')) {\n this.logger.error(err)\n }\n this.logger.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\n private updateQueue: Promise<(() => void) | undefined>[] = []\n private pendingUpdateQueue = false\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 */\n public async queueUpdate(payload: Update): Promise<void> {\n this.updateQueue.push(this.fetchUpdate(payload))\n if (!this.pendingUpdateQueue) {\n this.pendingUpdateQueue = true\n await Promise.resolve()\n this.pendingUpdateQueue = false\n const loading = [...this.updateQueue]\n this.updateQueue = []\n ;(await Promise.all(loading)).forEach((fn) => fn && fn())\n }\n }\n\n private async fetchUpdate(update: Update): Promise<(() => void) | undefined> {\n const { path, acceptedPath } = update\n const mod = this.hotModulesMap.get(path)\n if (!mod) {\n // In a code-splitting project,\n // it is common that the hot-updating module is not loaded yet.\n // https://github.com/vitejs/vite/issues/721\n return\n }\n\n let fetchedModule: ModuleNamespace | undefined\n const isSelfUpdate = path === acceptedPath\n\n // determine the qualified callbacks before we re-import the modules\n const qualifiedCallbacks = mod.callbacks.filter(({ deps }) =>\n deps.includes(acceptedPath),\n )\n\n if (isSelfUpdate || qualifiedCallbacks.length > 0) {\n const disposer = this.disposeMap.get(acceptedPath)\n if (disposer) await disposer(this.dataMap.get(acceptedPath))\n try {\n fetchedModule = await this.importUpdatedModule(update)\n } catch (e) {\n this.warnFailedUpdate(e, acceptedPath)\n }\n }\n\n return () => {\n for (const { deps, fn } of qualifiedCallbacks) {\n fn(\n deps.map((dep) => (dep === acceptedPath ? fetchedModule : undefined)),\n )\n }\n const loggedPath = isSelfUpdate ? path : `${acceptedPath} via ${path}`\n this.logger.debug(`[vite] hot updated: ${loggedPath}`)\n }\n }\n}\n","import type { ErrorPayload } from 'types/hmrPayload'\n\n// injected by the hmr plugin when served\ndeclare const __BASE__: string\ndeclare const __HMR_CONFIG_NAME__: string\n\nconst hmrConfigName = __HMR_CONFIG_NAME__\nconst base = __BASE__ || '/'\n\n// Create an element with provided attributes and optional children\nfunction h(\n e: string,\n attrs: Record<string, string> = {},\n ...children: (string | Node)[]\n) {\n const elem = document.createElement(e)\n for (const [k, v] of Object.entries(attrs)) {\n elem.setAttribute(k, v)\n }\n elem.append(...children)\n return elem\n}\n\n// set :host styles to make playwright detect the element as visible\nconst templateStyle = /*css*/ `\n:host {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 99999;\n --monospace: 'SFMono-Regular', Consolas,\n 'Liberation Mono', Menlo, Courier, monospace;\n --red: #ff5555;\n --yellow: #e2aa53;\n --purple: #cfa4ff;\n --cyan: #2dd9da;\n --dim: #c9c9c9;\n\n --window-background: #181818;\n --window-color: #d8d8d8;\n}\n\n.backdrop {\n position: fixed;\n z-index: 99999;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n overflow-y: scroll;\n margin: 0;\n background: rgba(0, 0, 0, 0.66);\n}\n\n.window {\n font-family: var(--monospace);\n line-height: 1.5;\n max-width: 80vw;\n color: var(--window-color);\n box-sizing: border-box;\n margin: 30px auto;\n padding: 2.5vh 4vw;\n position: relative;\n background: var(--window-background);\n border-radius: 6px 6px 8px 8px;\n box-shadow: 0 19px 38px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22);\n overflow: hidden;\n border-top: 8px solid var(--red);\n direction: ltr;\n text-align: left;\n}\n\npre {\n font-family: var(--monospace);\n font-size: 16px;\n margin-top: 0;\n margin-bottom: 1em;\n overflow-x: scroll;\n scrollbar-width: none;\n}\n\npre::-webkit-scrollbar {\n display: none;\n}\n\npre.frame::-webkit-scrollbar {\n display: block;\n height: 5px;\n}\n\npre.frame::-webkit-scrollbar-thumb {\n background: #999;\n border-radius: 5px;\n}\n\npre.frame {\n scrollbar-width: thin;\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 line-height: 1.8;\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\nkbd {\n line-height: 1.5;\n font-family: ui-monospace, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;\n font-size: 0.75rem;\n font-weight: 700;\n background-color: rgb(38, 40, 44);\n color: rgb(166, 167, 171);\n padding: 0.15rem 0.3rem;\n border-radius: 0.25rem;\n border-width: 0.0625rem 0.0625rem 0.1875rem;\n border-style: solid;\n border-color: rgb(54, 57, 64);\n border-image: initial;\n}\n`\n\n// Error Template\nconst template = h(\n 'div',\n { class: 'backdrop', part: 'backdrop' },\n h(\n 'div',\n { class: 'window', part: 'window' },\n h(\n 'pre',\n { class: 'message', part: 'message' },\n h('span', { class: 'plugin', part: 'plugin' }),\n h('span', { class: 'message-body', part: 'message-body' }),\n ),\n h('pre', { class: 'file', part: 'file' }),\n h('pre', { class: 'frame', part: 'frame' }),\n h('pre', { class: 'stack', part: 'stack' }),\n h(\n 'div',\n { class: 'tip', part: 'tip' },\n 'Click outside, press ',\n h('kbd', {}, 'Esc'),\n ' key, or fix the code to dismiss.',\n h('br'),\n 'You can also disable this overlay by setting ',\n h('code', { part: 'config-option-name' }, 'server.hmr.overlay'),\n ' to ',\n h('code', { part: 'config-option-value' }, 'false'),\n ' in ',\n h('code', { part: 'config-file-name' }, hmrConfigName),\n '.',\n ),\n ),\n h('style', {}, templateStyle),\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 closeOnEsc: (e: KeyboardEvent) => void\n\n constructor(err: ErrorPayload['err'], links = true) {\n super()\n this.root = this.attachShadow({ mode: 'open' })\n\n this.root.appendChild(template)\n\n codeframeRE.lastIndex = 0\n const hasFrame = err.frame && codeframeRE.test(err.frame)\n const message = hasFrame\n ? err.message.replace(codeframeRE, '')\n : err.message\n if (err.plugin) {\n this.text('.plugin', `[plugin:${err.plugin}] `)\n }\n this.text('.message-body', message.trim())\n\n const [file] = (err.loc?.file || err.id || 'unknown file').split(`?`)\n if (err.loc) {\n this.text('.file', `${file}:${err.loc.line}:${err.loc.column}`, links)\n } else if (err.id) {\n this.text('.file', file)\n }\n\n if (hasFrame) {\n this.text('.frame', err.frame!.trim())\n }\n this.text('.stack', err.stack, links)\n\n this.root.querySelector('.window')!.addEventListener('click', (e) => {\n e.stopPropagation()\n })\n\n this.addEventListener('click', () => {\n this.close()\n })\n\n this.closeOnEsc = (e: KeyboardEvent) => {\n if (e.key === 'Escape' || e.code === 'Escape') {\n this.close()\n }\n }\n\n document.addEventListener('keydown', this.closeOnEsc)\n }\n\n text(selector: string, text: string, linkFiles = false): void {\n const el = this.root.querySelector(selector)!\n if (!linkFiles) {\n el.textContent = text\n } else {\n let curIndex = 0\n let match: RegExpExecArray | null\n fileRE.lastIndex = 0\n while ((match = fileRE.exec(text))) {\n const { 0: file, index } = match\n if (index != null) {\n const frag = text.slice(curIndex, index)\n el.appendChild(document.createTextNode(frag))\n const link = document.createElement('a')\n link.textContent = file\n link.className = 'file-link'\n link.onclick = () => {\n fetch(\n new URL(\n `${base}__open-in-editor?file=${encodeURIComponent(file)}`,\n import.meta.url,\n ),\n )\n }\n el.appendChild(link)\n curIndex += frag.length + file.length\n }\n }\n }\n }\n close(): void {\n this.parentNode?.removeChild(this)\n document.removeEventListener('keydown', this.closeOnEsc)\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 } from 'types/hmrPayload'\nimport type { ViteHotContext } from 'types/hot'\nimport type { InferCustomEventPayload } from 'types/customEvent'\nimport { HMRClient, HMRContext } from '../shared/hmr'\nimport { ErrorOverlay, overlayId } from './overlay'\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__ || (importMetaUrl.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__ || '/'\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 notifyListeners('vite:ws:connect', { webSocket: socket })\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 notifyListeners('vite:ws:disconnect', { webSocket: socket })\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 cleanUrl(pathname: string): string {\n const url = new URL(pathname, location.toString())\n url.searchParams.delete('direct')\n return url.pathname + url.search\n}\n\nlet isFirstUpdate = true\nconst outdatedLinkTags = new WeakSet<HTMLLinkElement>()\n\nconst debounceReload = (time: number) => {\n let timer: ReturnType<typeof setTimeout> | null\n return () => {\n if (timer) {\n clearTimeout(timer)\n timer = null\n }\n timer = setTimeout(() => {\n location.reload()\n }, time)\n }\n}\nconst pageReload = debounceReload(50)\n\nconst hmrClient = new HMRClient(\n console,\n {\n isReady: () => socket && socket.readyState === 1,\n send: (message) => socket.send(message),\n },\n async function importUpdatedModule({\n acceptedPath,\n timestamp,\n explicitImportRequired,\n isWithinCircularImport,\n }) {\n const [acceptedPathWithoutQuery, query] = acceptedPath.split(`?`)\n const importPromise = import(\n /* @vite-ignore */\n base +\n acceptedPathWithoutQuery.slice(1) +\n `?${explicitImportRequired ? 'import&' : ''}t=${timestamp}${\n query ? `&${query}` : ''\n }`\n )\n if (isWithinCircularImport) {\n importPromise.catch(() => {\n console.info(\n `[hmr] ${acceptedPath} failed to apply HMR as it's within a circular import. Reloading page to reset the execution order. ` +\n `To debug and break the circular import, you can run \\`vite --debug hmr\\` to log the circular dependency path if a file change triggered it.`,\n )\n pageReload()\n })\n }\n return await importPromise\n },\n)\n\nasync function handleMessage(payload: HMRPayload) {\n switch (payload.type) {\n case 'connected':\n console.debug(`[vite] connected.`)\n hmrClient.messenger.flush()\n // proxy(nginx, docker) hmr ws maybe caused timeout,\n // so send ping package let ws keep alive.\n setInterval(() => {\n if (socket.readyState === socket.OPEN) {\n socket.send('{\"type\":\"ping\"}')\n }\n }, __HMR_TIMEOUT__)\n break\n case 'update':\n notifyListeners('vite:beforeUpdate', payload)\n // if this is the first update and there's already an error overlay, it\n // means the page opened with existing server compile error and the whole\n // module script failed to load (since one of the nested imports is 500).\n // in this case a normal update won't work and a full reload is needed.\n if (isFirstUpdate && hasErrorOverlay()) {\n window.location.reload()\n return\n } else {\n clearErrorOverlay()\n isFirstUpdate = false\n }\n await Promise.all(\n payload.updates.map(async (update): Promise<void> => {\n if (update.type === 'js-update') {\n return hmrClient.queueUpdate(update)\n }\n\n // css-update\n // this is only sent when a css file referenced with <link> is updated\n const { path, timestamp } = update\n const searchUrl = cleanUrl(path)\n // can't use querySelector with `[href*=]` here since the link may be\n // using relative paths so we need to use link.href to grab the full\n // URL for the include check.\n const el = Array.from(\n document.querySelectorAll<HTMLLinkElement>('link'),\n ).find(\n (e) =>\n !outdatedLinkTags.has(e) && cleanUrl(e.href).includes(searchUrl),\n )\n\n if (!el) {\n return\n }\n\n const newPath = `${base}${searchUrl.slice(1)}${\n searchUrl.includes('?') ? '&' : '?'\n }t=${timestamp}`\n\n // rather than swapping the href on the existing tag, we will\n // create a new link tag. Once the new stylesheet has loaded we\n // will remove the existing link tag. This removes a Flash Of\n // Unstyled Content that can occur when swapping out the tag href\n // directly, as the new stylesheet has not yet been loaded.\n return new Promise((resolve) => {\n const newLinkTag = el.cloneNode() as HTMLLinkElement\n newLinkTag.href = new URL(newPath, el.href).href\n const removeOldEl = () => {\n el.remove()\n console.debug(`[vite] css hot updated: ${searchUrl}`)\n resolve()\n }\n newLinkTag.addEventListener('load', removeOldEl)\n newLinkTag.addEventListener('error', removeOldEl)\n outdatedLinkTags.add(el)\n el.after(newLinkTag)\n })\n }),\n )\n notifyListeners('vite:afterUpdate', payload)\n break\n case 'custom': {\n notifyListeners(payload.event, payload.data)\n break\n }\n case 'full-reload':\n notifyListeners('vite:beforeFullReload', payload)\n if (payload.path && payload.path.endsWith('.html')) {\n // if html file is edited, only reload the page if the browser is\n // currently on that page.\n const pagePath = decodeURI(location.pathname)\n const payloadPath = base + payload.path.slice(1)\n if (\n pagePath === payloadPath ||\n payload.path === '/index.html' ||\n (pagePath.endsWith('/') && pagePath + 'index.html' === payloadPath)\n ) {\n pageReload()\n }\n return\n } else {\n pageReload()\n }\n break\n case 'prune':\n notifyListeners('vite:beforePrune', payload)\n await hmrClient.prunePaths(payload.paths)\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 hmrClient.notifyListeners(event, data)\n}\n\nconst enableOverlay = __HMR_ENABLE_OVERLAY__\n\nfunction createErrorOverlay(err: ErrorPayload['err']) {\n clearErrorOverlay()\n document.body.appendChild(new ErrorOverlay(err))\n}\n\nfunction clearErrorOverlay() {\n document.querySelectorAll<ErrorOverlay>(overlayId).forEach((n) => n.close())\n}\n\nfunction hasErrorOverlay() {\n return document.querySelectorAll(overlayId).length\n}\n\nasync function waitForSuccessfulPing(\n socketProtocol: string,\n hostAndPath: string,\n ms = 1000,\n) {\n const pingHostProtocol = socketProtocol === 'wss' ? 'https' : 'http'\n\n const ping = async () => {\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 try {\n await fetch(`${pingHostProtocol}://${hostAndPath}`, {\n mode: 'no-cors',\n headers: {\n // Custom headers won't be included in a request with no-cors so (ab)use one of the\n // safelisted headers to identify the ping request\n Accept: 'text/x-vite-ping',\n },\n })\n return true\n } catch {}\n return false\n }\n\n if (await ping()) {\n return\n }\n await wait(ms)\n\n // eslint-disable-next-line no-constant-condition\n while (true) {\n if (document.visibilityState === 'visible') {\n if (await ping()) {\n break\n }\n await wait(ms)\n } else {\n await waitForWindowShow()\n }\n }\n}\n\nfunction wait(ms: number) {\n return new Promise((resolve) => setTimeout(resolve, ms))\n}\n\nfunction waitForWindowShow() {\n return new Promise<void>((resolve) => {\n const onChange = async () => {\n if (document.visibilityState === 'visible') {\n resolve()\n document.removeEventListener('visibilitychange', onChange)\n }\n }\n document.addEventListener('visibilitychange', onChange)\n })\n}\n\nconst sheetsMap = new Map<string, HTMLStyleElement>()\n\n// collect existing style elements that may have been inserted during SSR\n// to avoid FOUC or duplicate styles\nif ('document' in globalThis) {\n document\n .querySelectorAll<HTMLStyleElement>('style[data-vite-dev-id]')\n .forEach((el) => {\n sheetsMap.set(el.getAttribute('data-vite-dev-id')!, el)\n })\n}\n\n// all css imports should be inserted at the same position\n// because after build it will be a single css file\nlet lastInsertedStyle: HTMLStyleElement | undefined\n\nexport function updateStyle(id: string, content: string): void {\n let style = sheetsMap.get(id)\n if (!style) {\n style = document.createElement('style')\n style.setAttribute('type', 'text/css')\n style.setAttribute('data-vite-dev-id', id)\n style.textContent = content\n\n if (!lastInsertedStyle) {\n document.head.appendChild(style)\n\n // reset lastInsertedStyle after async\n // because dynamically imported css will be splitted into a different file\n setTimeout(() => {\n lastInsertedStyle = undefined\n }, 0)\n } else {\n lastInsertedStyle.insertAdjacentElement('afterend', style)\n }\n lastInsertedStyle = style\n } else {\n style.textContent = content\n }\n sheetsMap.set(id, style)\n}\n\nexport function removeStyle(id: string): void {\n const style = sheetsMap.get(id)\n if (style) {\n document.head.removeChild(style)\n sheetsMap.delete(id)\n }\n}\n\nexport function createHotContext(ownerPath: string): ViteHotContext {\n return new HMRContext(hmrClient, ownerPath)\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[0] !== '.' && url[0] !== '/') {\n return url\n }\n\n // can't use pathname from URL since it may be relative like ../\n const pathname = url.replace(/[?#].*$/, '')\n const { search, hash } = new URL(url, 'http://vitejs.dev')\n\n return `${pathname}?${queryToInject}${search ? `&` + search.slice(1) : ''}${\n hash || ''\n }`\n}\n\nexport { ErrorOverlay }\n"],"names":["base"],"mappings":";;MAiCa,UAAU,CAAA;IAGrB,WACU,CAAA,SAAoB,EACpB,SAAiB,EAAA;QADjB,IAAS,CAAA,SAAA,GAAT,SAAS,CAAW;QACpB,IAAS,CAAA,SAAA,GAAT,SAAS,CAAQ;QAEzB,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE;YACrC,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,EAAE,CAAC,CAAA;AACrC,SAAA;;;QAID,MAAM,GAAG,GAAG,SAAS,CAAC,aAAa,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;AAClD,QAAA,IAAI,GAAG,EAAE;AACP,YAAA,GAAG,CAAC,SAAS,GAAG,EAAE,CAAA;AACnB,SAAA;;QAGD,MAAM,cAAc,GAAG,SAAS,CAAC,iBAAiB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;AACjE,QAAA,IAAI,cAAc,EAAE;YAClB,KA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A;AACD,IAAA,SAAS,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC,CAAA;AAC1B,CAAC;AAEK,SAAU,WAAW,CAAC,EAAU,EAAA;IACpC,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;AAC/B,IAAA,IAAI,KAAK,EAAE;AACT,QAAA,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAA;AAChC,QAAA,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;AACrB,KAAA;AACH,CAAC;AAEK,SAAU,gBAAgB,CAAC,SAAiB,EAAA;AAChD,IAAA,OAAO,IAAI,UAAU,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;AAC7C,CAAC;AAED;;AAEG;AACa,SAAA,WAAW,CAAC,GAAW,EAAE,aAAqB,EAAA;;AAE5D,IAAA,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;AACpC,QAAA,OAAO,GAAG,CAAA;AACX,KAAA;;IAGD,MAAM,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAA;AAC3C,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;;;;","x_google_ignoreList":[0,1,2]}
1
+ {"version":3,"file":"client.mjs","sources":["hmr.ts","overlay.ts","client.ts"],"sourcesContent":["import type { Update } from 'types/hmrPayload'\nimport type { ModuleNamespace, ViteHotContext } from 'types/hot'\nimport type { InferCustomEventPayload } from 'types/customEvent'\n\ntype CustomListenersMap = Map<string, ((data: any) => void)[]>\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\nexport interface HMRLogger {\n error(msg: string | Error): void\n debug(...msg: unknown[]): void\n}\n\nexport interface HMRConnection {\n /**\n * Checked before sending messages to the client.\n */\n isReady(): boolean\n /**\n * Send message to the client.\n */\n send(messages: string): void\n}\n\nexport class HMRContext implements ViteHotContext {\n private newListeners: CustomListenersMap\n\n constructor(\n private hmrClient: HMRClient,\n private ownerPath: string,\n ) {\n if (!hmrClient.dataMap.has(ownerPath)) {\n hmrClient.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 = hmrClient.hotModulesMap.get(ownerPath)\n if (mod) {\n mod.callbacks = []\n }\n\n // clear stale custom event listeners\n const staleListeners = hmrClient.ctxToListenersMap.get(ownerPath)\n if (staleListeners) {\n for (const [event, staleFns] of staleListeners) {\n const listeners = hmrClient.customListenersMap.get(event)\n if (listeners) {\n hmrClient.customListenersMap.set(\n event,\n listeners.filter((l) => !staleFns.includes(l)),\n )\n }\n }\n }\n\n this.newListeners = new Map()\n hmrClient.ctxToListenersMap.set(ownerPath, this.newListeners)\n }\n\n get data(): any {\n return this.hmrClient.dataMap.get(this.ownerPath)\n }\n\n accept(deps?: any, callback?: any): void {\n if (typeof deps === 'function' || !deps) {\n // self-accept: hot.accept(() => {})\n this.acceptDeps([this.ownerPath], ([mod]) => deps?.(mod))\n } else if (typeof deps === 'string') {\n // explicit deps\n this.acceptDeps([deps], ([mod]) => callback?.(mod))\n } else if (Array.isArray(deps)) {\n this.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(\n _: string | readonly string[],\n callback: (data: any) => void,\n ): void {\n this.acceptDeps([this.ownerPath], ([mod]) => callback?.(mod))\n }\n\n dispose(cb: (data: any) => void): void {\n this.hmrClient.disposeMap.set(this.ownerPath, cb)\n }\n\n prune(cb: (data: any) => void): void {\n this.hmrClient.pruneMap.set(this.ownerPath, cb)\n }\n\n // Kept for backward compatibility (#11036)\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n decline(): void {}\n\n invalidate(message: string): void {\n this.hmrClient.notifyListeners('vite:invalidate', {\n path: this.ownerPath,\n message,\n })\n this.send('vite:invalidate', { path: this.ownerPath, message })\n this.hmrClient.logger.debug(\n `[vite] invalidate ${this.ownerPath}${message ? `: ${message}` : ''}`,\n )\n }\n\n on<T extends string>(\n event: T,\n cb: (payload: InferCustomEventPayload<T>) => void,\n ): void {\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(this.hmrClient.customListenersMap)\n addToMap(this.newListeners)\n }\n\n off<T extends string>(\n event: T,\n cb: (payload: InferCustomEventPayload<T>) => void,\n ): void {\n const removeFromMap = (map: Map<string, any[]>) => {\n const existing = map.get(event)\n if (existing === undefined) {\n return\n }\n const pruned = existing.filter((l) => l !== cb)\n if (pruned.length === 0) {\n map.delete(event)\n return\n }\n map.set(event, pruned)\n }\n removeFromMap(this.hmrClient.customListenersMap)\n removeFromMap(this.newListeners)\n }\n\n send<T extends string>(event: T, data?: InferCustomEventPayload<T>): void {\n this.hmrClient.messenger.send(\n JSON.stringify({ type: 'custom', event, data }),\n )\n }\n\n private acceptDeps(\n deps: string[],\n callback: HotCallback['fn'] = () => {},\n ): void {\n const mod: HotModule = this.hmrClient.hotModulesMap.get(this.ownerPath) || {\n id: this.ownerPath,\n callbacks: [],\n }\n mod.callbacks.push({\n deps,\n fn: callback,\n })\n this.hmrClient.hotModulesMap.set(this.ownerPath, mod)\n }\n}\n\nclass HMRMessenger {\n constructor(private connection: HMRConnection) {}\n\n private queue: string[] = []\n\n public send(message: string): void {\n this.queue.push(message)\n this.flush()\n }\n\n public flush(): void {\n if (this.connection.isReady()) {\n this.queue.forEach((msg) => this.connection.send(msg))\n this.queue = []\n }\n }\n}\n\nexport class HMRClient {\n public hotModulesMap = new Map<string, HotModule>()\n public disposeMap = new Map<string, (data: any) => void | Promise<void>>()\n public pruneMap = new Map<string, (data: any) => void | Promise<void>>()\n public dataMap = new Map<string, any>()\n public customListenersMap: CustomListenersMap = new Map()\n public ctxToListenersMap = new Map<string, CustomListenersMap>()\n\n public messenger: HMRMessenger\n\n constructor(\n public logger: HMRLogger,\n connection: HMRConnection,\n // This allows implementing reloading via different methods depending on the environment\n private importUpdatedModule: (update: Update) => Promise<ModuleNamespace>,\n ) {\n this.messenger = new HMRMessenger(connection)\n }\n\n public async notifyListeners<T extends string>(\n event: T,\n data: InferCustomEventPayload<T>,\n ): Promise<void>\n public async notifyListeners(event: string, data: any): Promise<void> {\n const cbs = this.customListenersMap.get(event)\n if (cbs) {\n await Promise.allSettled(cbs.map((cb) => cb(data)))\n }\n }\n\n public clear(): void {\n this.hotModulesMap.clear()\n this.disposeMap.clear()\n this.pruneMap.clear()\n this.dataMap.clear()\n this.customListenersMap.clear()\n this.ctxToListenersMap.clear()\n }\n\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 public async prunePaths(paths: string[]): Promise<void> {\n await Promise.all(\n paths.map((path) => {\n const disposer = this.disposeMap.get(path)\n if (disposer) return disposer(this.dataMap.get(path))\n }),\n )\n paths.forEach((path) => {\n const fn = this.pruneMap.get(path)\n if (fn) {\n fn(this.dataMap.get(path))\n }\n })\n }\n\n protected warnFailedUpdate(err: Error, path: string | string[]): void {\n if (!err.message.includes('fetch')) {\n this.logger.error(err)\n }\n this.logger.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\n private updateQueue: Promise<(() => void) | undefined>[] = []\n private pendingUpdateQueue = false\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 */\n public async queueUpdate(payload: Update): Promise<void> {\n this.updateQueue.push(this.fetchUpdate(payload))\n if (!this.pendingUpdateQueue) {\n this.pendingUpdateQueue = true\n await Promise.resolve()\n this.pendingUpdateQueue = false\n const loading = [...this.updateQueue]\n this.updateQueue = []\n ;(await Promise.all(loading)).forEach((fn) => fn && fn())\n }\n }\n\n private async fetchUpdate(update: Update): Promise<(() => void) | undefined> {\n const { path, acceptedPath } = update\n const mod = this.hotModulesMap.get(path)\n if (!mod) {\n // In a code-splitting project,\n // it is common that the hot-updating module is not loaded yet.\n // https://github.com/vitejs/vite/issues/721\n return\n }\n\n let fetchedModule: ModuleNamespace | undefined\n const isSelfUpdate = path === acceptedPath\n\n // determine the qualified callbacks before we re-import the modules\n const qualifiedCallbacks = mod.callbacks.filter(({ deps }) =>\n deps.includes(acceptedPath),\n )\n\n if (isSelfUpdate || qualifiedCallbacks.length > 0) {\n const disposer = this.disposeMap.get(acceptedPath)\n if (disposer) await disposer(this.dataMap.get(acceptedPath))\n try {\n fetchedModule = await this.importUpdatedModule(update)\n } catch (e) {\n this.warnFailedUpdate(e, acceptedPath)\n }\n }\n\n return () => {\n for (const { deps, fn } of qualifiedCallbacks) {\n fn(\n deps.map((dep) => (dep === acceptedPath ? fetchedModule : undefined)),\n )\n }\n const loggedPath = isSelfUpdate ? path : `${acceptedPath} via ${path}`\n this.logger.debug(`[vite] hot updated: ${loggedPath}`)\n }\n }\n}\n","import type { ErrorPayload } from 'types/hmrPayload'\n\n// injected by the hmr plugin when served\ndeclare const __BASE__: string\ndeclare const __HMR_CONFIG_NAME__: string\n\nconst hmrConfigName = __HMR_CONFIG_NAME__\nconst base = __BASE__ || '/'\n\n// Create an element with provided attributes and optional children\nfunction h(\n e: string,\n attrs: Record<string, string> = {},\n ...children: (string | Node)[]\n) {\n const elem = document.createElement(e)\n for (const [k, v] of Object.entries(attrs)) {\n elem.setAttribute(k, v)\n }\n elem.append(...children)\n return elem\n}\n\n// set :host styles to make playwright detect the element as visible\nconst templateStyle = /*css*/ `\n:host {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 99999;\n --monospace: 'SFMono-Regular', Consolas,\n 'Liberation Mono', Menlo, Courier, monospace;\n --red: #ff5555;\n --yellow: #e2aa53;\n --purple: #cfa4ff;\n --cyan: #2dd9da;\n --dim: #c9c9c9;\n\n --window-background: #181818;\n --window-color: #d8d8d8;\n}\n\n.backdrop {\n position: fixed;\n z-index: 99999;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n overflow-y: scroll;\n margin: 0;\n background: rgba(0, 0, 0, 0.66);\n}\n\n.window {\n font-family: var(--monospace);\n line-height: 1.5;\n max-width: 80vw;\n color: var(--window-color);\n box-sizing: border-box;\n margin: 30px auto;\n padding: 2.5vh 4vw;\n position: relative;\n background: var(--window-background);\n border-radius: 6px 6px 8px 8px;\n box-shadow: 0 19px 38px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22);\n overflow: hidden;\n border-top: 8px solid var(--red);\n direction: ltr;\n text-align: left;\n}\n\npre {\n font-family: var(--monospace);\n font-size: 16px;\n margin-top: 0;\n margin-bottom: 1em;\n overflow-x: scroll;\n scrollbar-width: none;\n}\n\npre::-webkit-scrollbar {\n display: none;\n}\n\npre.frame::-webkit-scrollbar {\n display: block;\n height: 5px;\n}\n\npre.frame::-webkit-scrollbar-thumb {\n background: #999;\n border-radius: 5px;\n}\n\npre.frame {\n scrollbar-width: thin;\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 line-height: 1.8;\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\nkbd {\n line-height: 1.5;\n font-family: ui-monospace, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;\n font-size: 0.75rem;\n font-weight: 700;\n background-color: rgb(38, 40, 44);\n color: rgb(166, 167, 171);\n padding: 0.15rem 0.3rem;\n border-radius: 0.25rem;\n border-width: 0.0625rem 0.0625rem 0.1875rem;\n border-style: solid;\n border-color: rgb(54, 57, 64);\n border-image: initial;\n}\n`\n\n// Error Template\nconst template = h(\n 'div',\n { class: 'backdrop', part: 'backdrop' },\n h(\n 'div',\n { class: 'window', part: 'window' },\n h(\n 'pre',\n { class: 'message', part: 'message' },\n h('span', { class: 'plugin', part: 'plugin' }),\n h('span', { class: 'message-body', part: 'message-body' }),\n ),\n h('pre', { class: 'file', part: 'file' }),\n h('pre', { class: 'frame', part: 'frame' }),\n h('pre', { class: 'stack', part: 'stack' }),\n h(\n 'div',\n { class: 'tip', part: 'tip' },\n 'Click outside, press ',\n h('kbd', {}, 'Esc'),\n ' key, or fix the code to dismiss.',\n h('br'),\n 'You can also disable this overlay by setting ',\n h('code', { part: 'config-option-name' }, 'server.hmr.overlay'),\n ' to ',\n h('code', { part: 'config-option-value' }, 'false'),\n ' in ',\n h('code', { part: 'config-file-name' }, hmrConfigName),\n '.',\n ),\n ),\n h('style', {}, templateStyle),\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 closeOnEsc: (e: KeyboardEvent) => void\n\n constructor(err: ErrorPayload['err'], links = true) {\n super()\n this.root = this.attachShadow({ mode: 'open' })\n\n this.root.appendChild(template)\n\n codeframeRE.lastIndex = 0\n const hasFrame = err.frame && codeframeRE.test(err.frame)\n const message = hasFrame\n ? err.message.replace(codeframeRE, '')\n : err.message\n if (err.plugin) {\n this.text('.plugin', `[plugin:${err.plugin}] `)\n }\n this.text('.message-body', message.trim())\n\n const [file] = (err.loc?.file || err.id || 'unknown file').split(`?`)\n if (err.loc) {\n this.text('.file', `${file}:${err.loc.line}:${err.loc.column}`, links)\n } else if (err.id) {\n this.text('.file', file)\n }\n\n if (hasFrame) {\n this.text('.frame', err.frame!.trim())\n }\n this.text('.stack', err.stack, links)\n\n this.root.querySelector('.window')!.addEventListener('click', (e) => {\n e.stopPropagation()\n })\n\n this.addEventListener('click', () => {\n this.close()\n })\n\n this.closeOnEsc = (e: KeyboardEvent) => {\n if (e.key === 'Escape' || e.code === 'Escape') {\n this.close()\n }\n }\n\n document.addEventListener('keydown', this.closeOnEsc)\n }\n\n text(selector: string, text: string, linkFiles = false): void {\n const el = this.root.querySelector(selector)!\n if (!linkFiles) {\n el.textContent = text\n } else {\n let curIndex = 0\n let match: RegExpExecArray | null\n fileRE.lastIndex = 0\n while ((match = fileRE.exec(text))) {\n const { 0: file, index } = match\n if (index != null) {\n const frag = text.slice(curIndex, index)\n el.appendChild(document.createTextNode(frag))\n const link = document.createElement('a')\n link.textContent = file\n link.className = 'file-link'\n link.onclick = () => {\n fetch(\n new URL(\n `${base}__open-in-editor?file=${encodeURIComponent(file)}`,\n import.meta.url,\n ),\n )\n }\n el.appendChild(link)\n curIndex += frag.length + file.length\n }\n }\n }\n }\n close(): void {\n this.parentNode?.removeChild(this)\n document.removeEventListener('keydown', this.closeOnEsc)\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 } from 'types/hmrPayload'\nimport type { ViteHotContext } from 'types/hot'\nimport type { InferCustomEventPayload } from 'types/customEvent'\nimport { HMRClient, HMRContext } from '../shared/hmr'\nimport { ErrorOverlay, overlayId } from './overlay'\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__ || (importMetaUrl.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__ || '/'\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 notifyListeners('vite:ws:connect', { webSocket: socket })\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 notifyListeners('vite:ws:disconnect', { webSocket: socket })\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 cleanUrl(pathname: string): string {\n const url = new URL(pathname, 'http://vitejs.dev')\n url.searchParams.delete('direct')\n return url.pathname + url.search\n}\n\nlet isFirstUpdate = true\nconst outdatedLinkTags = new WeakSet<HTMLLinkElement>()\n\nconst debounceReload = (time: number) => {\n let timer: ReturnType<typeof setTimeout> | null\n return () => {\n if (timer) {\n clearTimeout(timer)\n timer = null\n }\n timer = setTimeout(() => {\n location.reload()\n }, time)\n }\n}\nconst pageReload = debounceReload(50)\n\nconst hmrClient = new HMRClient(\n console,\n {\n isReady: () => socket && socket.readyState === 1,\n send: (message) => socket.send(message),\n },\n async function importUpdatedModule({\n acceptedPath,\n timestamp,\n explicitImportRequired,\n isWithinCircularImport,\n }) {\n const [acceptedPathWithoutQuery, query] = acceptedPath.split(`?`)\n const importPromise = import(\n /* @vite-ignore */\n base +\n acceptedPathWithoutQuery.slice(1) +\n `?${explicitImportRequired ? 'import&' : ''}t=${timestamp}${\n query ? `&${query}` : ''\n }`\n )\n if (isWithinCircularImport) {\n importPromise.catch(() => {\n console.info(\n `[hmr] ${acceptedPath} failed to apply HMR as it's within a circular import. Reloading page to reset the execution order. ` +\n `To debug and break the circular import, you can run \\`vite --debug hmr\\` to log the circular dependency path if a file change triggered it.`,\n )\n pageReload()\n })\n }\n return await importPromise\n },\n)\n\nasync function handleMessage(payload: HMRPayload) {\n switch (payload.type) {\n case 'connected':\n console.debug(`[vite] connected.`)\n hmrClient.messenger.flush()\n // proxy(nginx, docker) hmr ws maybe caused timeout,\n // so send ping package let ws keep alive.\n setInterval(() => {\n if (socket.readyState === socket.OPEN) {\n socket.send('{\"type\":\"ping\"}')\n }\n }, __HMR_TIMEOUT__)\n break\n case 'update':\n notifyListeners('vite:beforeUpdate', payload)\n // if this is the first update and there's already an error overlay, it\n // means the page opened with existing server compile error and the whole\n // module script failed to load (since one of the nested imports is 500).\n // in this case a normal update won't work and a full reload is needed.\n if (isFirstUpdate && hasErrorOverlay()) {\n window.location.reload()\n return\n } else {\n clearErrorOverlay()\n isFirstUpdate = false\n }\n await Promise.all(\n payload.updates.map(async (update): Promise<void> => {\n if (update.type === 'js-update') {\n return hmrClient.queueUpdate(update)\n }\n\n // css-update\n // this is only sent when a css file referenced with <link> is updated\n const { path, timestamp } = update\n const searchUrl = cleanUrl(path)\n // can't use querySelector with `[href*=]` here since the link may be\n // using relative paths so we need to use link.href to grab the full\n // URL for the include check.\n const el = Array.from(\n document.querySelectorAll<HTMLLinkElement>('link'),\n ).find(\n (e) =>\n !outdatedLinkTags.has(e) && cleanUrl(e.href).includes(searchUrl),\n )\n\n if (!el) {\n return\n }\n\n const newPath = `${base}${searchUrl.slice(1)}${\n searchUrl.includes('?') ? '&' : '?'\n }t=${timestamp}`\n\n // rather than swapping the href on the existing tag, we will\n // create a new link tag. Once the new stylesheet has loaded we\n // will remove the existing link tag. This removes a Flash Of\n // Unstyled Content that can occur when swapping out the tag href\n // directly, as the new stylesheet has not yet been loaded.\n return new Promise((resolve) => {\n const newLinkTag = el.cloneNode() as HTMLLinkElement\n newLinkTag.href = new URL(newPath, el.href).href\n const removeOldEl = () => {\n el.remove()\n console.debug(`[vite] css hot updated: ${searchUrl}`)\n resolve()\n }\n newLinkTag.addEventListener('load', removeOldEl)\n newLinkTag.addEventListener('error', removeOldEl)\n outdatedLinkTags.add(el)\n el.after(newLinkTag)\n })\n }),\n )\n notifyListeners('vite:afterUpdate', payload)\n break\n case 'custom': {\n notifyListeners(payload.event, payload.data)\n break\n }\n case 'full-reload':\n notifyListeners('vite:beforeFullReload', payload)\n if (payload.path && payload.path.endsWith('.html')) {\n // if html file is edited, only reload the page if the browser is\n // currently on that page.\n const pagePath = decodeURI(location.pathname)\n const payloadPath = base + payload.path.slice(1)\n if (\n pagePath === payloadPath ||\n payload.path === '/index.html' ||\n (pagePath.endsWith('/') && pagePath + 'index.html' === payloadPath)\n ) {\n pageReload()\n }\n return\n } else {\n pageReload()\n }\n break\n case 'prune':\n notifyListeners('vite:beforePrune', payload)\n await hmrClient.prunePaths(payload.paths)\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 hmrClient.notifyListeners(event, data)\n}\n\nconst enableOverlay = __HMR_ENABLE_OVERLAY__\n\nfunction createErrorOverlay(err: ErrorPayload['err']) {\n clearErrorOverlay()\n document.body.appendChild(new ErrorOverlay(err))\n}\n\nfunction clearErrorOverlay() {\n document.querySelectorAll<ErrorOverlay>(overlayId).forEach((n) => n.close())\n}\n\nfunction hasErrorOverlay() {\n return document.querySelectorAll(overlayId).length\n}\n\nasync function waitForSuccessfulPing(\n socketProtocol: string,\n hostAndPath: string,\n ms = 1000,\n) {\n const pingHostProtocol = socketProtocol === 'wss' ? 'https' : 'http'\n\n const ping = async () => {\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 try {\n await fetch(`${pingHostProtocol}://${hostAndPath}`, {\n mode: 'no-cors',\n headers: {\n // Custom headers won't be included in a request with no-cors so (ab)use one of the\n // safelisted headers to identify the ping request\n Accept: 'text/x-vite-ping',\n },\n })\n return true\n } catch {}\n return false\n }\n\n if (await ping()) {\n return\n }\n await wait(ms)\n\n // eslint-disable-next-line no-constant-condition\n while (true) {\n if (document.visibilityState === 'visible') {\n if (await ping()) {\n break\n }\n await wait(ms)\n } else {\n await waitForWindowShow()\n }\n }\n}\n\nfunction wait(ms: number) {\n return new Promise((resolve) => setTimeout(resolve, ms))\n}\n\nfunction waitForWindowShow() {\n return new Promise<void>((resolve) => {\n const onChange = async () => {\n if (document.visibilityState === 'visible') {\n resolve()\n document.removeEventListener('visibilitychange', onChange)\n }\n }\n document.addEventListener('visibilitychange', onChange)\n })\n}\n\nconst sheetsMap = new Map<string, HTMLStyleElement>()\n\n// collect existing style elements that may have been inserted during SSR\n// to avoid FOUC or duplicate styles\nif ('document' in globalThis) {\n document\n .querySelectorAll<HTMLStyleElement>('style[data-vite-dev-id]')\n .forEach((el) => {\n sheetsMap.set(el.getAttribute('data-vite-dev-id')!, el)\n })\n}\n\nconst cspNonce =\n 'document' in globalThis\n ? document.querySelector<HTMLMetaElement>('meta[property=csp-nonce]')?.nonce\n : undefined\n\n// all css imports should be inserted at the same position\n// because after build it will be a single css file\nlet lastInsertedStyle: HTMLStyleElement | undefined\n\nexport function updateStyle(id: string, content: string): void {\n let style = sheetsMap.get(id)\n if (!style) {\n style = document.createElement('style')\n style.setAttribute('type', 'text/css')\n style.setAttribute('data-vite-dev-id', id)\n style.textContent = content\n if (cspNonce) {\n style.setAttribute('nonce', cspNonce)\n }\n\n if (!lastInsertedStyle) {\n document.head.appendChild(style)\n\n // reset lastInsertedStyle after async\n // because dynamically imported css will be splitted into a different file\n setTimeout(() => {\n lastInsertedStyle = undefined\n }, 0)\n } else {\n lastInsertedStyle.insertAdjacentElement('afterend', style)\n }\n lastInsertedStyle = style\n } else {\n style.textContent = content\n }\n sheetsMap.set(id, style)\n}\n\nexport function removeStyle(id: string): void {\n const style = sheetsMap.get(id)\n if (style) {\n document.head.removeChild(style)\n sheetsMap.delete(id)\n }\n}\n\nexport function createHotContext(ownerPath: string): ViteHotContext {\n return new HMRContext(hmrClient, ownerPath)\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[0] !== '.' && url[0] !== '/') {\n return url\n }\n\n // can't use pathname from URL since it may be relative like ../\n const pathname = url.replace(/[?#].*$/, '')\n const { search, hash } = new URL(url, 'http://vitejs.dev')\n\n return `${pathname}?${queryToInject}${search ? `&` + search.slice(1) : ''}${\n hash || ''\n }`\n}\n\nexport { ErrorOverlay }\n"],"names":["base"],"mappings":";;MAiCa,UAAU,CAAA;IAGrB,WACU,CAAA,SAAoB,EACpB,SAAiB,EAAA;QADjB,IAAS,CAAA,SAAA,GAAT,SAAS,CAAW;QACpB,IAAS,CAAA,SAAA,GAAT,SAAS,CAAQ;QAEzB,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE;YACrC,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,EAAE,CAAC,CAAA;AACrC,SAAA;;;QAID,MAAM,GAAG,GAAG,SAAS,CAAC,aAAa,CAAC,GAAG,CAAC,SAA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AAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAA;AAC3C,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;;;;","x_google_ignoreList":[0,1,2]}
@@ -11953,20 +11953,27 @@ function loadPackageData(pkgPath) {
11953
11953
  hasSideEffects = () => sideEffects;
11954
11954
  }
11955
11955
  else if (Array.isArray(sideEffects)) {
11956
- const finalPackageSideEffects = sideEffects.map((sideEffect) => {
11957
- /*
11958
- * The array accepts simple glob patterns to the relevant files... Patterns like *.css, which do not include a /, will be treated like **\/*.css.
11959
- * https://webpack.js.org/guides/tree-shaking/
11960
- * https://github.com/vitejs/vite/pull/11807
11961
- */
11962
- if (sideEffect.includes('/')) {
11963
- return sideEffect;
11964
- }
11965
- return `**/${sideEffect}`;
11966
- });
11967
- hasSideEffects = createFilter(finalPackageSideEffects, null, {
11968
- resolve: pkgDir,
11969
- });
11956
+ if (sideEffects.length <= 0) {
11957
+ // createFilter always returns true if `includes` is an empty array
11958
+ // but here we want it to always return false
11959
+ hasSideEffects = () => false;
11960
+ }
11961
+ else {
11962
+ const finalPackageSideEffects = sideEffects.map((sideEffect) => {
11963
+ /*
11964
+ * The array accepts simple glob patterns to the relevant files... Patterns like *.css, which do not include a /, will be treated like **\/*.css.
11965
+ * https://webpack.js.org/guides/tree-shaking/
11966
+ * https://github.com/vitejs/vite/pull/11807
11967
+ */
11968
+ if (sideEffect.includes('/')) {
11969
+ return sideEffect;
11970
+ }
11971
+ return `**/${sideEffect}`;
11972
+ });
11973
+ hasSideEffects = createFilter(finalPackageSideEffects, null, {
11974
+ resolve: pkgDir,
11975
+ });
11976
+ }
11970
11977
  }
11971
11978
  else {
11972
11979
  hasSideEffects = () => null;
@@ -12664,10 +12671,17 @@ function processSrcSetSync(srcs, replacer) {
12664
12671
  descriptor,
12665
12672
  })));
12666
12673
  }
12667
- const cleanSrcSetRE = /(?:url|image|gradient|cross-fade)\([^)]*\)|"([^"]|(?<=\\)")*"|'([^']|(?<=\\)')*'|data:\w+\/[\w.+\-]+;base64,[\w+/=]+/g;
12674
+ const cleanSrcSetRE = /(?:url|image|gradient|cross-fade)\([^)]*\)|"([^"]|(?<=\\)")*"|'([^']|(?<=\\)')*'|data:\w+\/[\w.+\-]+;base64,[\w+/=]+|\?\S+,/g;
12668
12675
  function splitSrcSet(srcs) {
12669
12676
  const parts = [];
12670
- // There could be a ',' inside of url(data:...), linear-gradient(...), "data:..." or data:...
12677
+ /**
12678
+ * There could be a ',' inside of:
12679
+ * - url(data:...)
12680
+ * - linear-gradient(...)
12681
+ * - "data:..."
12682
+ * - data:...
12683
+ * - query parameter ?...
12684
+ */
12671
12685
  const cleanedSrcs = srcs.replace(cleanSrcSetRE, blankReplacer);
12672
12686
  let startIndex = 0;
12673
12687
  let splitIndex;
@@ -14616,6 +14630,13 @@ const debug$h = createDebugger('vite:esbuild');
14616
14630
  const IIFE_BEGIN_RE = /(const|var)\s+\S+\s*=\s*function\([^()]*\)\s*\{\s*"use strict";/;
14617
14631
  const validExtensionRE = /\.\w+$/;
14618
14632
  const jsxExtensionsRE = /\.(?:j|t)sx\b/;
14633
+ // the final build should always support dynamic import and import.meta.
14634
+ // if they need to be polyfilled, plugin-legacy should be used.
14635
+ // plugin-legacy detects these two features when checking for modern code.
14636
+ const defaultEsbuildSupported = {
14637
+ 'dynamic-import': true,
14638
+ 'import-meta': true,
14639
+ };
14619
14640
  let server;
14620
14641
  async function transformWithEsbuild(code, filename, options, inMap) {
14621
14642
  let loader = options?.loader;
@@ -14764,6 +14785,10 @@ function esbuildPlugin(config) {
14764
14785
  // Also transforming multiple times with keepNames enabled breaks
14765
14786
  // tree-shaking. (#9164)
14766
14787
  keepNames: false,
14788
+ supported: {
14789
+ ...defaultEsbuildSupported,
14790
+ ...esbuildTransformOptions.supported,
14791
+ },
14767
14792
  };
14768
14793
  return {
14769
14794
  name: 'vite:esbuild',
@@ -14869,12 +14894,8 @@ function resolveEsbuildTranspileOptions(config, format) {
14869
14894
  loader: 'js',
14870
14895
  target: target || undefined,
14871
14896
  format: rollupToEsbuildFormatMap[format],
14872
- // the final build should always support dynamic import and import.meta.
14873
- // if they need to be polyfilled, plugin-legacy should be used.
14874
- // plugin-legacy detects these two features when checking for modern code.
14875
14897
  supported: {
14876
- 'dynamic-import': true,
14877
- 'import-meta': true,
14898
+ ...defaultEsbuildSupported,
14878
14899
  ...esbuildOptions.supported,
14879
14900
  },
14880
14901
  };
@@ -16621,6 +16642,21 @@ function applySourcemapIgnoreList(map, sourcemapPath, sourcemapIgnoreList, logge
16621
16642
  map.x_google_ignoreList = x_google_ignoreList;
16622
16643
  }
16623
16644
  }
16645
+ async function extractSourcemapFromFile(code, filePath) {
16646
+ const map = (convertSourceMap.fromSource(code) ||
16647
+ (await convertSourceMap.fromMapFileSource(code, createConvertSourceMapReadMap(filePath))))?.toObject();
16648
+ if (map) {
16649
+ return {
16650
+ code: code.replace(convertSourceMap.mapFileCommentRegex, blankReplacer),
16651
+ map,
16652
+ };
16653
+ }
16654
+ }
16655
+ function createConvertSourceMapReadMap(originalFileName) {
16656
+ return (filename) => {
16657
+ return fsp.readFile(path$o.resolve(path$o.dirname(originalFileName), filename), 'utf-8');
16658
+ };
16659
+ }
16624
16660
 
16625
16661
  var tasks = {};
16626
16662
 
@@ -30545,8 +30581,10 @@ function handleParseError(parserError, html, filePath) {
30545
30581
  */
30546
30582
  function buildHtmlPlugin(config) {
30547
30583
  const [preHooks, normalHooks, postHooks] = resolveHtmlTransforms(config.plugins, config.logger);
30584
+ preHooks.unshift(injectCspNonceMetaTagHook(config));
30548
30585
  preHooks.unshift(preImportMapHook(config));
30549
30586
  preHooks.push(htmlEnvHook(config));
30587
+ postHooks.push(injectNonceAttributeTagHook(config));
30550
30588
  postHooks.push(postImportMapHook());
30551
30589
  const processedHtml = new Map();
30552
30590
  const isExcludedUrl = (url) => url[0] === '#' || isExternalUrl(url) || isDataUrl(url);
@@ -30723,9 +30761,7 @@ function buildHtmlPlugin(config) {
30723
30761
  // to `false` to force no inline. If `undefined`, it leaves to the default heuristics.
30724
30762
  const isNoInlineLink = node.nodeName === 'link' &&
30725
30763
  node.attrs.some((p) => p.name === 'rel' &&
30726
- p.value
30727
- .split(spaceRe)
30728
- .some((v) => noInlineLinkRels.has(v.toLowerCase())));
30764
+ parseRelAttr(p.value).some((v) => noInlineLinkRels.has(v)));
30729
30765
  const shouldInline = isNoInlineLink ? false : undefined;
30730
30766
  assetUrlsPromises.push((async () => {
30731
30767
  const processedUrl = await processAssetUrl(url, shouldInline);
@@ -30999,6 +31035,9 @@ function buildHtmlPlugin(config) {
30999
31035
  },
31000
31036
  };
31001
31037
  }
31038
+ function parseRelAttr(attr) {
31039
+ return attr.split(spaceRe).map((v) => v.toLowerCase());
31040
+ }
31002
31041
  // <tag style="... url(...) or image-set(...) ..."></tag>
31003
31042
  // extract inline styles as virtual css
31004
31043
  function findNeedTransformStyleAttribute(node) {
@@ -31061,6 +31100,21 @@ function postImportMapHook() {
31061
31100
  return html;
31062
31101
  };
31063
31102
  }
31103
+ function injectCspNonceMetaTagHook(config) {
31104
+ return () => {
31105
+ if (!config.html?.cspNonce)
31106
+ return;
31107
+ return [
31108
+ {
31109
+ tag: 'meta',
31110
+ injectTo: 'head',
31111
+ // use nonce attribute so that it's hidden
31112
+ // https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/nonce#accessing_nonces_and_nonce_hiding
31113
+ attrs: { property: 'csp-nonce', nonce: config.html.cspNonce },
31114
+ },
31115
+ ];
31116
+ };
31117
+ }
31064
31118
  /**
31065
31119
  * Support `%ENV_NAME%` syntax in html files
31066
31120
  */
@@ -31102,6 +31156,27 @@ function htmlEnvHook(config) {
31102
31156
  });
31103
31157
  };
31104
31158
  }
31159
+ function injectNonceAttributeTagHook(config) {
31160
+ const processRelType = new Set(['stylesheet', 'modulepreload', 'preload']);
31161
+ return async (html, { filename }) => {
31162
+ const nonce = config.html?.cspNonce;
31163
+ if (!nonce)
31164
+ return;
31165
+ const s = new MagicString(html);
31166
+ await traverseHtml(html, filename, (node) => {
31167
+ if (!nodeIsElement(node)) {
31168
+ return;
31169
+ }
31170
+ if (node.nodeName === 'script' ||
31171
+ (node.nodeName === 'link' &&
31172
+ node.attrs.some((attr) => attr.name === 'rel' &&
31173
+ parseRelAttr(attr.value).some((a) => processRelType.has(a))))) {
31174
+ s.appendRight(node.sourceCodeLocation.startTag.endOffset - 1, ` nonce="${nonce}"`);
31175
+ }
31176
+ });
31177
+ return s.toString();
31178
+ };
31179
+ }
31105
31180
  function resolveHtmlTransforms(plugins, logger) {
31106
31181
  const preHooks = [];
31107
31182
  const normalHooks = [];
@@ -32204,8 +32279,8 @@ function createCachedImport(imp) {
32204
32279
  return cached;
32205
32280
  };
32206
32281
  }
32207
- const importPostcssImport = createCachedImport(() => import('./dep-DeEXZBZL.js').then(function (n) { return n.i; }));
32208
- const importPostcssModules = createCachedImport(() => import('./dep-6MdzGidO.js').then(function (n) { return n.i; }));
32282
+ const importPostcssImport = createCachedImport(() => import('./dep-xS77OgV2.js').then(function (n) { return n.i; }));
32283
+ const importPostcssModules = createCachedImport(() => import('./dep-t2lrdxcd.js').then(function (n) { return n.i; }));
32209
32284
  const importPostcss = createCachedImport(() => import('postcss'));
32210
32285
  const preprocessorWorkerControllerCache = new WeakMap();
32211
32286
  let alwaysFakeWorkerWorkerControllerCache;
@@ -48755,6 +48830,7 @@ function extractJsonErrorPosition(errorMessage, inputLength) {
48755
48830
 
48756
48831
  const ERR_OPTIMIZE_DEPS_PROCESSING_ERROR = 'ERR_OPTIMIZE_DEPS_PROCESSING_ERROR';
48757
48832
  const ERR_OUTDATED_OPTIMIZED_DEP = 'ERR_OUTDATED_OPTIMIZED_DEP';
48833
+ const ERR_FILE_NOT_FOUND_IN_OPTIMIZED_DEP_DIR = 'ERR_FILE_NOT_FOUND_IN_OPTIMIZED_DEP_DIR';
48758
48834
  const debug$a = createDebugger('vite:optimize-deps');
48759
48835
  function optimizedDepsPlugin(config) {
48760
48836
  return {
@@ -48809,8 +48885,12 @@ function optimizedDepsPlugin(config) {
48809
48885
  return await fsp.readFile(file, 'utf-8');
48810
48886
  }
48811
48887
  catch (e) {
48812
- // Outdated non-entry points (CHUNK), loaded after a rerun
48813
- throwOutdatedRequest(id);
48888
+ const newMetadata = depsOptimizer.metadata;
48889
+ if (optimizedDepInfoFromFile(newMetadata, file)) {
48890
+ // Outdated non-entry points (CHUNK), loaded after a rerun
48891
+ throwOutdatedRequest(id);
48892
+ }
48893
+ throwFileNotFoundInOptimizedDep(id);
48814
48894
  }
48815
48895
  }
48816
48896
  },
@@ -48832,6 +48912,15 @@ function throwOutdatedRequest(id) {
48832
48912
  // send a 504 status code request timeout
48833
48913
  throw err;
48834
48914
  }
48915
+ function throwFileNotFoundInOptimizedDep(id) {
48916
+ const err = new Error(`The file does not exist at "${id}" which is in the optimize deps directory. ` +
48917
+ `The dependency might be incompatible with the dep optimizer. ` +
48918
+ `Try adding it to \`optimizeDeps.exclude\`.`);
48919
+ err.code = ERR_FILE_NOT_FOUND_IN_OPTIMIZED_DEP_DIR;
48920
+ // This error will be caught by the transform middleware that will
48921
+ // send a 404 status code not found
48922
+ throw err;
48923
+ }
48835
48924
 
48836
48925
  const nonJsRe = /\.json(?:$|\?)/;
48837
48926
  const isNonJsRequest = (request) => nonJsRe.test(request);
@@ -51777,7 +51866,6 @@ async function createDepsOptimizer(config, server) {
51777
51866
  isOptimizedDepFile: createIsOptimizedDepFile(config),
51778
51867
  isOptimizedDepUrl: createIsOptimizedDepUrl(config),
51779
51868
  getOptimizedDepId: (depInfo) => `${depInfo.file}?v=${depInfo.browserHash}`,
51780
- delayDepsOptimizerUntil,
51781
51869
  close,
51782
51870
  options,
51783
51871
  };
@@ -51819,15 +51907,15 @@ async function createDepsOptimizer(config, server) {
51819
51907
  // from the first request before resolving to minimize full page reloads.
51820
51908
  // On warm start or after the first optimization is run, we use a simpler
51821
51909
  // debounce strategy each time a new dep is discovered.
51822
- let crawlEndFinder;
51910
+ let waitingForCrawlEnd = false;
51823
51911
  if (!cachedMetadata) {
51824
- crawlEndFinder = setupOnCrawlEnd(onCrawlEnd);
51912
+ server._onCrawlEnd(onCrawlEnd);
51913
+ waitingForCrawlEnd = true;
51825
51914
  }
51826
51915
  let optimizationResult;
51827
51916
  let discover;
51828
51917
  async function close() {
51829
51918
  closed = true;
51830
- crawlEndFinder?.cancel();
51831
51919
  await Promise.allSettled([
51832
51920
  discover?.cancel(),
51833
51921
  depsOptimizer.scanProcessing,
@@ -51889,7 +51977,7 @@ async function createDepsOptimizer(config, server) {
51889
51977
  optimizationResult.result.then((result) => {
51890
51978
  // Check if the crawling of static imports has already finished. In that
51891
51979
  // case, the result is handled by the onCrawlEnd callback
51892
- if (!crawlEndFinder)
51980
+ if (!waitingForCrawlEnd)
51893
51981
  return;
51894
51982
  optimizationResult = undefined; // signal that we'll be using the result
51895
51983
  runOptimizer(result);
@@ -52084,16 +52172,14 @@ async function createDepsOptimizer(config, server) {
52084
52172
  enqueuedRerun?.();
52085
52173
  }
52086
52174
  function fullReload() {
52087
- if (server) {
52088
- // Cached transform results have stale imports (resolved to
52089
- // old locations) so they need to be invalidated before the page is
52090
- // reloaded.
52091
- server.moduleGraph.invalidateAll();
52092
- server.hot.send({
52093
- type: 'full-reload',
52094
- path: '*',
52095
- });
52096
- }
52175
+ // Cached transform results have stale imports (resolved to
52176
+ // old locations) so they need to be invalidated before the page is
52177
+ // reloaded.
52178
+ server.moduleGraph.invalidateAll();
52179
+ server.hot.send({
52180
+ type: 'full-reload',
52181
+ path: '*',
52182
+ });
52097
52183
  }
52098
52184
  async function rerun() {
52099
52185
  // debounce time to wait for new missing deps finished, issue a new
@@ -52127,7 +52213,7 @@ async function createDepsOptimizer(config, server) {
52127
52213
  // We'll wait until the user codebase is eagerly processed by Vite so
52128
52214
  // we can get a list of every missing dependency before giving to the
52129
52215
  // browser a dependency that may be outdated, thus avoiding full page reloads
52130
- if (!crawlEndFinder) {
52216
+ if (!waitingForCrawlEnd) {
52131
52217
  // Debounced rerun, let other missing dependencies be discovered before
52132
52218
  // the running next optimizeDeps
52133
52219
  debouncedProcessing();
@@ -52175,7 +52261,7 @@ async function createDepsOptimizer(config, server) {
52175
52261
  // be crawled if the browser requests them right away).
52176
52262
  async function onCrawlEnd() {
52177
52263
  // switch after this point to a simple debounce strategy
52178
- crawlEndFinder = undefined;
52264
+ waitingForCrawlEnd = false;
52179
52265
  debug$8?.(colors$1.green(`✨ static imports crawl ended`));
52180
52266
  if (closed) {
52181
52267
  return;
@@ -52251,57 +52337,6 @@ async function createDepsOptimizer(config, server) {
52251
52337
  debouncedProcessing(0);
52252
52338
  }
52253
52339
  }
52254
- function delayDepsOptimizerUntil(id, done) {
52255
- if (crawlEndFinder && !depsOptimizer.isOptimizedDepFile(id)) {
52256
- crawlEndFinder.delayDepsOptimizerUntil(id, done);
52257
- }
52258
- }
52259
- }
52260
- const callCrawlEndIfIdleAfterMs = 50;
52261
- function setupOnCrawlEnd(onCrawlEnd) {
52262
- const registeredIds = new Set();
52263
- const seenIds = new Set();
52264
- let timeoutHandle;
52265
- let cancelled = false;
52266
- function cancel() {
52267
- cancelled = true;
52268
- }
52269
- let crawlEndCalled = false;
52270
- function callOnCrawlEnd() {
52271
- if (!cancelled && !crawlEndCalled) {
52272
- crawlEndCalled = true;
52273
- onCrawlEnd();
52274
- }
52275
- }
52276
- function delayDepsOptimizerUntil(id, done) {
52277
- if (!seenIds.has(id)) {
52278
- seenIds.add(id);
52279
- registeredIds.add(id);
52280
- done()
52281
- .catch(() => { })
52282
- .finally(() => markIdAsDone(id));
52283
- }
52284
- }
52285
- function markIdAsDone(id) {
52286
- registeredIds.delete(id);
52287
- checkIfCrawlEndAfterTimeout();
52288
- }
52289
- function checkIfCrawlEndAfterTimeout() {
52290
- if (cancelled || registeredIds.size > 0)
52291
- return;
52292
- if (timeoutHandle)
52293
- clearTimeout(timeoutHandle);
52294
- timeoutHandle = setTimeout(callOnCrawlEndWhenIdle, callCrawlEndIfIdleAfterMs);
52295
- }
52296
- async function callOnCrawlEndWhenIdle() {
52297
- if (cancelled || registeredIds.size > 0)
52298
- return;
52299
- callOnCrawlEnd();
52300
- }
52301
- return {
52302
- delayDepsOptimizerUntil,
52303
- cancel,
52304
- };
52305
52340
  }
52306
52341
  async function createDevSsrDepsOptimizer(config) {
52307
52342
  const metadata = await optimizeServerSsrDeps(config);
@@ -52316,7 +52351,6 @@ async function createDevSsrDepsOptimizer(config) {
52316
52351
  // noop, there is no scanning during dev SSR
52317
52352
  // the optimizer blocks the server start
52318
52353
  run: () => { },
52319
- delayDepsOptimizerUntil: (id, done) => { },
52320
52354
  close: async () => { },
52321
52355
  options: config.ssr.optimizeDeps,
52322
52356
  };
@@ -52726,8 +52760,7 @@ async function prepareEsbuildOptimizerRun(resolvedConfig, depsInfo, ssr, process
52726
52760
  charset: 'utf8',
52727
52761
  ...esbuildOptions,
52728
52762
  supported: {
52729
- 'dynamic-import': true,
52730
- 'import-meta': true,
52763
+ ...defaultEsbuildSupported,
52731
52764
  ...esbuildOptions.supported,
52732
52765
  },
52733
52766
  });
@@ -53683,7 +53716,10 @@ async function doTransform(url, server, options, timestamp) {
53683
53716
  return cached;
53684
53717
  }
53685
53718
  const result = loadAndTransform(id, url, server, options, timestamp, module, resolved);
53686
- getDepsOptimizer(config, ssr)?.delayDepsOptimizerUntil(id, () => result);
53719
+ const depsOptimizer = getDepsOptimizer(config, ssr);
53720
+ if (!depsOptimizer?.isOptimizedDepFile(id)) {
53721
+ server._registerRequestProcessing(id, () => result);
53722
+ }
53687
53723
  return result;
53688
53724
  }
53689
53725
  async function getCachedTransformResult(url, module, server, ssr, timestamp) {
@@ -53738,16 +53774,20 @@ async function loadAndTransform(id, url, server, options, timestamp, mod, resolv
53738
53774
  throw e;
53739
53775
  }
53740
53776
  }
53741
- ensureWatchedFile(server.watcher, file, config.root);
53777
+ if (code != null) {
53778
+ ensureWatchedFile(server.watcher, file, config.root);
53779
+ }
53742
53780
  }
53743
53781
  if (code) {
53744
53782
  try {
53745
- map = (convertSourceMap.fromSource(code) ||
53746
- (await convertSourceMap.fromMapFileSource(code, createConvertSourceMapReadMap(file))))?.toObject();
53747
- code = code.replace(convertSourceMap.mapFileCommentRegex, blankReplacer);
53783
+ const extracted = await extractSourcemapFromFile(code, file);
53784
+ if (extracted) {
53785
+ code = extracted.code;
53786
+ map = extracted.map;
53787
+ }
53748
53788
  }
53749
53789
  catch (e) {
53750
- logger.warn(`Failed to load source map for ${url}.`, {
53790
+ logger.warn(`Failed to load source map for ${file}.\n${e}`, {
53751
53791
  timestamp: true,
53752
53792
  });
53753
53793
  }
@@ -53851,11 +53891,6 @@ async function loadAndTransform(id, url, server, options, timestamp, mod, resolv
53851
53891
  moduleGraph.updateModuleTransformResult(mod, result, ssr);
53852
53892
  return result;
53853
53893
  }
53854
- function createConvertSourceMapReadMap(originalFileName) {
53855
- return (filename) => {
53856
- return fsp.readFile(path$o.resolve(path$o.dirname(originalFileName), filename), 'utf-8');
53857
- };
53858
- }
53859
53894
  /**
53860
53895
  * When a module is soft-invalidated, we can preserve its previous `transformResult` and
53861
53896
  * return similar code to before:
@@ -54306,7 +54341,7 @@ async function ssrTransformScript(code, inMap, url, originalCode) {
54306
54341
  const declaredConst = new Set();
54307
54342
  // hoist at the start of the file, after the hashbang
54308
54343
  const hoistIndex = code.match(hashbangRE)?.[0].length ?? 0;
54309
- function defineImport(source, metadata) {
54344
+ function defineImport(index, source, metadata) {
54310
54345
  deps.add(source);
54311
54346
  const importId = `__vite_ssr_import_${uid++}__`;
54312
54347
  // Reduce metadata to undefined if it's all default values
@@ -54317,7 +54352,7 @@ async function ssrTransformScript(code, inMap, url, originalCode) {
54317
54352
  const metadataStr = metadata ? `, ${JSON.stringify(metadata)}` : '';
54318
54353
  // There will be an error if the module is called before it is imported,
54319
54354
  // so the module import statement is hoisted to the top
54320
- s.appendLeft(hoistIndex, `const ${importId} = await ${ssrImportKey}(${JSON.stringify(source)}${metadataStr});\n`);
54355
+ s.appendLeft(index, `const ${importId} = await ${ssrImportKey}(${JSON.stringify(source)}${metadataStr});\n`);
54321
54356
  return importId;
54322
54357
  }
54323
54358
  function defineExport(position, name, local = name) {
@@ -54330,7 +54365,7 @@ async function ssrTransformScript(code, inMap, url, originalCode) {
54330
54365
  // import { baz } from 'foo' --> baz -> __import_foo__.baz
54331
54366
  // import * as ok from 'foo' --> ok -> __import_foo__
54332
54367
  if (node.type === 'ImportDeclaration') {
54333
- const importId = defineImport(node.source.value, {
54368
+ const importId = defineImport(hoistIndex, node.source.value, {
54334
54369
  importedNames: node.specifiers
54335
54370
  .map((s) => {
54336
54371
  if (s.type === 'ImportSpecifier')
@@ -54380,12 +54415,11 @@ async function ssrTransformScript(code, inMap, url, originalCode) {
54380
54415
  s.remove(node.start, node.end);
54381
54416
  if (node.source) {
54382
54417
  // export { foo, bar } from './foo'
54383
- const importId = defineImport(node.source.value, {
54418
+ const importId = defineImport(node.start, node.source.value, {
54384
54419
  importedNames: node.specifiers.map((s) => s.local.name),
54385
54420
  });
54386
- // hoist re-exports near the defined import so they are immediately exported
54387
54421
  for (const spec of node.specifiers) {
54388
- defineExport(hoistIndex, spec.exported.name, `${importId}.${spec.local.name}`);
54422
+ defineExport(node.start, spec.exported.name, `${importId}.${spec.local.name}`);
54389
54423
  }
54390
54424
  }
54391
54425
  else {
@@ -54420,13 +54454,12 @@ async function ssrTransformScript(code, inMap, url, originalCode) {
54420
54454
  // export * from './foo'
54421
54455
  if (node.type === 'ExportAllDeclaration') {
54422
54456
  s.remove(node.start, node.end);
54423
- const importId = defineImport(node.source.value);
54424
- // hoist re-exports near the defined import so they are immediately exported
54457
+ const importId = defineImport(node.start, node.source.value);
54425
54458
  if (node.exported) {
54426
- defineExport(hoistIndex, node.exported.name, `${importId}`);
54459
+ defineExport(node.start, node.exported.name, `${importId}`);
54427
54460
  }
54428
54461
  else {
54429
- s.appendLeft(hoistIndex, `${ssrExportAllKey}(${importId});\n`);
54462
+ s.appendLeft(node.start, `${ssrExportAllKey}(${importId});\n`);
54430
54463
  }
54431
54464
  }
54432
54465
  }
@@ -63628,6 +63661,15 @@ function transformMiddleware(server) {
63628
63661
  // error but a normal part of the missing deps discovery flow
63629
63662
  return;
63630
63663
  }
63664
+ if (e?.code === ERR_FILE_NOT_FOUND_IN_OPTIMIZED_DEP_DIR) {
63665
+ // Skip if response has already been sent
63666
+ if (!res.writableEnded) {
63667
+ res.statusCode = 404;
63668
+ res.end();
63669
+ }
63670
+ server.config.logger.warn(colors$1.yellow(e.message));
63671
+ return;
63672
+ }
63631
63673
  if (e?.code === ERR_LOAD_URL) {
63632
63674
  // Let other middleware handle if we can't load the url via transformRequest
63633
63675
  return next();
@@ -63665,11 +63707,13 @@ function createDevHtmlTransformFn(config) {
63665
63707
  const [preHooks, normalHooks, postHooks] = resolveHtmlTransforms(config.plugins, config.logger);
63666
63708
  const transformHooks = [
63667
63709
  preImportMapHook(config),
63710
+ injectCspNonceMetaTagHook(config),
63668
63711
  ...preHooks,
63669
63712
  htmlEnvHook(config),
63670
63713
  devHtmlHook,
63671
63714
  ...normalHooks,
63672
63715
  ...postHooks,
63716
+ injectNonceAttributeTagHook(config),
63673
63717
  postImportMapHook(),
63674
63718
  ];
63675
63719
  return (server, url, html, originalUrl) => {
@@ -64456,6 +64500,19 @@ async function _createServer(inlineConfig = {}, options) {
64456
64500
  const closeHttpServer = createServerCloseFn(httpServer);
64457
64501
  let exitProcess;
64458
64502
  const devHtmlTransformFn = createDevHtmlTransformFn(config);
64503
+ const onCrawlEndCallbacks = [];
64504
+ const crawlEndFinder = setupOnCrawlEnd(() => {
64505
+ onCrawlEndCallbacks.forEach((cb) => cb());
64506
+ });
64507
+ function waitForRequestsIdle(ignoredId) {
64508
+ return crawlEndFinder.waitForRequestsIdle(ignoredId);
64509
+ }
64510
+ function _registerRequestProcessing(id, done) {
64511
+ crawlEndFinder.registerRequestProcessing(id, done);
64512
+ }
64513
+ function _onCrawlEnd(cb) {
64514
+ onCrawlEndCallbacks.push(cb);
64515
+ }
64459
64516
  let server = {
64460
64517
  config,
64461
64518
  middlewares,
@@ -64563,6 +64620,7 @@ async function _createServer(inlineConfig = {}, options) {
64563
64620
  watcher.close(),
64564
64621
  hot.close(),
64565
64622
  container.close(),
64623
+ crawlEndFinder?.cancel(),
64566
64624
  getDepsOptimizer(server.config)?.close(),
64567
64625
  getDepsOptimizer(server.config, true)?.close(),
64568
64626
  closeHttpServer(),
@@ -64602,6 +64660,9 @@ async function _createServer(inlineConfig = {}, options) {
64602
64660
  }
64603
64661
  return server._restartPromise;
64604
64662
  },
64663
+ waitForRequestsIdle,
64664
+ _registerRequestProcessing,
64665
+ _onCrawlEnd,
64605
64666
  _setInternalServer(_server) {
64606
64667
  // Rebind internal the server variable so functions reference the user
64607
64668
  // server instance after a restart
@@ -64998,6 +65059,64 @@ async function restartServerWithUrls(server) {
64998
65059
  server.printUrls();
64999
65060
  }
65000
65061
  }
65062
+ const callCrawlEndIfIdleAfterMs = 50;
65063
+ function setupOnCrawlEnd(onCrawlEnd) {
65064
+ const registeredIds = new Set();
65065
+ const seenIds = new Set();
65066
+ const onCrawlEndPromiseWithResolvers = promiseWithResolvers();
65067
+ let timeoutHandle;
65068
+ let cancelled = false;
65069
+ function cancel() {
65070
+ cancelled = true;
65071
+ }
65072
+ let crawlEndCalled = false;
65073
+ function callOnCrawlEnd() {
65074
+ if (!cancelled && !crawlEndCalled) {
65075
+ crawlEndCalled = true;
65076
+ onCrawlEnd();
65077
+ }
65078
+ onCrawlEndPromiseWithResolvers.resolve();
65079
+ }
65080
+ function registerRequestProcessing(id, done) {
65081
+ if (!seenIds.has(id)) {
65082
+ seenIds.add(id);
65083
+ registeredIds.add(id);
65084
+ done()
65085
+ .catch(() => { })
65086
+ .finally(() => markIdAsDone(id));
65087
+ }
65088
+ }
65089
+ function waitForRequestsIdle(ignoredId) {
65090
+ if (ignoredId) {
65091
+ seenIds.add(ignoredId);
65092
+ markIdAsDone(ignoredId);
65093
+ }
65094
+ return onCrawlEndPromiseWithResolvers.promise;
65095
+ }
65096
+ function markIdAsDone(id) {
65097
+ if (registeredIds.has(id)) {
65098
+ registeredIds.delete(id);
65099
+ checkIfCrawlEndAfterTimeout();
65100
+ }
65101
+ }
65102
+ function checkIfCrawlEndAfterTimeout() {
65103
+ if (cancelled || registeredIds.size > 0)
65104
+ return;
65105
+ if (timeoutHandle)
65106
+ clearTimeout(timeoutHandle);
65107
+ timeoutHandle = setTimeout(callOnCrawlEndWhenIdle, callCrawlEndIfIdleAfterMs);
65108
+ }
65109
+ async function callOnCrawlEndWhenIdle() {
65110
+ if (cancelled || registeredIds.size > 0)
65111
+ return;
65112
+ callOnCrawlEnd();
65113
+ }
65114
+ return {
65115
+ registerRequestProcessing,
65116
+ waitForRequestsIdle,
65117
+ cancel,
65118
+ };
65119
+ }
65001
65120
 
65002
65121
  var index = {
65003
65122
  __proto__: null,
@@ -66296,6 +66415,11 @@ function preload(baseModule, deps, importerUrl) {
66296
66415
  // @ts-expect-error __VITE_IS_MODERN__ will be replaced with boolean later
66297
66416
  if (__VITE_IS_MODERN__ && deps && deps.length > 0) {
66298
66417
  const links = document.getElementsByTagName('link');
66418
+ const cspNonceMeta = document.querySelector('meta[property=csp-nonce]');
66419
+ // `.nonce` should be used to get along with nonce hiding (https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/nonce#accessing_nonces_and_nonce_hiding)
66420
+ // Firefox 67-74 uses modern chunks and supports CSP nonce, but does not support `.nonce`
66421
+ // in that case fallback to getAttribute
66422
+ const cspNonce = cspNonceMeta?.nonce || cspNonceMeta?.getAttribute('nonce');
66299
66423
  promise = Promise.all(deps.map((dep) => {
66300
66424
  // @ts-expect-error assetsURL is declared before preload.toString()
66301
66425
  dep = assetsURL(dep, importerUrl);
@@ -66328,6 +66452,9 @@ function preload(baseModule, deps, importerUrl) {
66328
66452
  link.crossOrigin = '';
66329
66453
  }
66330
66454
  link.href = dep;
66455
+ if (cspNonce) {
66456
+ link.setAttribute('nonce', cspNonce);
66457
+ }
66331
66458
  document.head.appendChild(link);
66332
66459
  if (isCss) {
66333
66460
  return new Promise((res, rej) => {
@@ -1,4 +1,4 @@
1
- import { C as commonjsGlobal, B as getDefaultExportFromCjs } from './dep-BxRAmRCV.js';
1
+ import { C as commonjsGlobal, B as getDefaultExportFromCjs } from './dep-B8QpfTwU.js';
2
2
  import require$$0__default from 'fs';
3
3
  import require$$0 from 'postcss';
4
4
  import require$$0$1 from 'path';
@@ -1,4 +1,4 @@
1
- import { B as getDefaultExportFromCjs } from './dep-BxRAmRCV.js';
1
+ import { B as getDefaultExportFromCjs } from './dep-B8QpfTwU.js';
2
2
  import require$$0 from 'path';
3
3
  import require$$0__default from 'fs';
4
4
  import { l as lib } from './dep-IQS-Za7F.js';
package/dist/node/cli.js CHANGED
@@ -2,7 +2,7 @@ import path from 'node:path';
2
2
  import fs from 'node:fs';
3
3
  import { performance } from 'node:perf_hooks';
4
4
  import { EventEmitter } from 'events';
5
- import { A as colors, v as createLogger, r as resolveConfig } from './chunks/dep-BxRAmRCV.js';
5
+ import { A as colors, v as createLogger, r as resolveConfig } from './chunks/dep-B8QpfTwU.js';
6
6
  import { VERSION } from './constants.js';
7
7
  import 'node:fs/promises';
8
8
  import 'node:url';
@@ -757,7 +757,7 @@ cli
757
757
  filterDuplicateOptions(options);
758
758
  // output structure is preserved even after bundling so require()
759
759
  // is ok here
760
- const { createServer } = await import('./chunks/dep-BxRAmRCV.js').then(function (n) { return n.E; });
760
+ const { createServer } = await import('./chunks/dep-B8QpfTwU.js').then(function (n) { return n.E; });
761
761
  try {
762
762
  const server = await createServer({
763
763
  root,
@@ -836,7 +836,7 @@ cli
836
836
  .option('-w, --watch', `[boolean] rebuilds when modules have changed on disk`)
837
837
  .action(async (root, options) => {
838
838
  filterDuplicateOptions(options);
839
- const { build } = await import('./chunks/dep-BxRAmRCV.js').then(function (n) { return n.F; });
839
+ const { build } = await import('./chunks/dep-B8QpfTwU.js').then(function (n) { return n.F; });
840
840
  const buildOptions = cleanOptions(options);
841
841
  try {
842
842
  await build({
@@ -863,7 +863,7 @@ cli
863
863
  .option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
864
864
  .action(async (root, options) => {
865
865
  filterDuplicateOptions(options);
866
- const { optimizeDeps } = await import('./chunks/dep-BxRAmRCV.js').then(function (n) { return n.D; });
866
+ const { optimizeDeps } = await import('./chunks/dep-B8QpfTwU.js').then(function (n) { return n.D; });
867
867
  try {
868
868
  const config = await resolveConfig({
869
869
  root,
@@ -889,7 +889,7 @@ cli
889
889
  .option('--outDir <dir>', `[string] output directory (default: dist)`)
890
890
  .action(async (root, options) => {
891
891
  filterDuplicateOptions(options);
892
- const { preview } = await import('./chunks/dep-BxRAmRCV.js').then(function (n) { return n.G; });
892
+ const { preview } = await import('./chunks/dep-B8QpfTwU.js').then(function (n) { return n.G; });
893
893
  try {
894
894
  const server = await preview({
895
895
  root,
@@ -1776,6 +1776,14 @@ interface ViteDevServer {
1776
1776
  * Open browser
1777
1777
  */
1778
1778
  openBrowser(): void;
1779
+ /**
1780
+ * Calling `await server.waitForRequestsIdle(id)` will wait until all static imports
1781
+ * are processed. If called from a load or transform plugin hook, the id needs to be
1782
+ * passed as a parameter to avoid deadlocks. Calling this function after the first
1783
+ * static imports section of the module graph has been processed will resolve immediately.
1784
+ * @experimental
1785
+ */
1786
+ waitForRequestsIdle: (ignoredId?: string) => Promise<void>;
1779
1787
  }
1780
1788
  interface ResolvedServerUrls {
1781
1789
  local: string[];
@@ -2551,7 +2559,6 @@ interface DepsOptimizer {
2551
2559
  isOptimizedDepFile: (id: string) => boolean;
2552
2560
  isOptimizedDepUrl: (url: string) => boolean;
2553
2561
  getOptimizedDepId: (depInfo: OptimizedDepInfo) => string;
2554
- delayDepsOptimizerUntil: (id: string, done: () => Promise<any>) => void;
2555
2562
  close: () => Promise<void>;
2556
2563
  options: DepOptimizationOptions;
2557
2564
  }
@@ -3113,6 +3120,10 @@ interface JsonOptions {
3113
3120
  }
3114
3121
 
3115
3122
  interface ConfigEnv {
3123
+ /**
3124
+ * 'serve': during dev (`vite` command)
3125
+ * 'build': when building for production (`vite build` command)
3126
+ */
3116
3127
  command: 'build' | 'serve';
3117
3128
  mode: string;
3118
3129
  isSsrBuild?: boolean;
@@ -3133,8 +3144,7 @@ type UserConfigExport = UserConfig | Promise<UserConfig> | UserConfigFnObject |
3133
3144
  /**
3134
3145
  * Type helper to make it easier to use vite.config.ts
3135
3146
  * accepts a direct {@link UserConfig} object, or a function that returns it.
3136
- * The function receives a {@link ConfigEnv} object that exposes two properties:
3137
- * `command` (either `'build'` or `'serve'`), and `mode`.
3147
+ * The function receives a {@link ConfigEnv} object.
3138
3148
  */
3139
3149
  declare function defineConfig(config: UserConfig): UserConfig;
3140
3150
  declare function defineConfig(config: Promise<UserConfig>): Promise<UserConfig>;
@@ -3192,6 +3202,10 @@ interface UserConfig {
3192
3202
  resolve?: ResolveOptions & {
3193
3203
  alias?: AliasOptions;
3194
3204
  };
3205
+ /**
3206
+ * HTML related options
3207
+ */
3208
+ html?: HTMLOptions;
3195
3209
  /**
3196
3210
  * CSS related options (preprocessors and CSS modules)
3197
3211
  */
@@ -3296,6 +3310,14 @@ interface UserConfig {
3296
3310
  */
3297
3311
  appType?: AppType;
3298
3312
  }
3313
+ interface HTMLOptions {
3314
+ /**
3315
+ * A nonce value placeholder that will be used when generating script/style tags.
3316
+ *
3317
+ * Make sure that this placeholder will be replaced with a unique value for each request by the server.
3318
+ */
3319
+ cspNonce?: string;
3320
+ }
3299
3321
  interface ExperimentalOptions {
3300
3322
  /**
3301
3323
  * Append fake `&lang.(ext)` when queries are specified, to preserve the file extension for following plugins to process.
@@ -3502,4 +3524,4 @@ declare class ServerHMRConnector implements HMRRuntimeConnection {
3502
3524
  onUpdate(handler: (payload: HMRPayload) => void): void;
3503
3525
  }
3504
3526
 
3505
- export { type Alias, type AliasOptions, type AnymatchFn, type AnymatchPattern, type AppType, type AwaitWriteFinishOptions, type BindCLIShortcutsOptions, type BuildOptions, type CLIShortcut, type CSSModulesOptions, type CSSOptions, type CommonServerOptions, type ConfigEnv, Connect, type CorsOptions, type CorsOrigin, type DepOptimizationConfig, type DepOptimizationMetadata, type DepOptimizationOptions, type ESBuildOptions, type ESBuildTransformResult, type ExperimentalOptions, type ExportsData, FSWatcher, type FetchModuleOptions, type FileSystemServeOptions, type FilterPattern, type HMRBroadcaster, type HMRBroadcasterClient, type HMRChannel, type HmrContext, type HmrOptions, type HookHandler, type HtmlTagDescriptor, HttpProxy, type IndexHtmlTransform, type IndexHtmlTransformContext, type IndexHtmlTransformHook, type IndexHtmlTransformResult, type InlineConfig, type InternalResolveOptions, type JsonOptions, type LegacyOptions, type LibraryFormats, type LibraryOptions, type LightningCSSOptions, type LogErrorOptions, type LogLevel, type LogOptions, type LogType, type Logger, type LoggerOptions, type MainThreadRuntimeOptions, type Manifest, type ManifestChunk, type MapToFunction, type AnymatchMatcher as Matcher, ModuleGraph, ModuleNode, type ModulePreloadOptions, type OptimizedDepInfo, type Plugin, type PluginContainer, type PluginHookUtils, type PluginOption, type PreprocessCSSResult, type PreviewOptions, type PreviewServer, type PreviewServerHook, type ProxyOptions, type RenderBuiltAssetUrl, type ResolveFn, type ResolveModulePreloadDependenciesFn, type ResolveOptions, type ResolvedBuildOptions, type ResolvedCSSOptions, type ResolvedConfig, type ResolvedModulePreloadOptions, type ResolvedPreviewOptions, type ResolvedSSROptions, type ResolvedServerOptions, type ResolvedServerUrls, type ResolvedUrl, type ResolvedWorkerOptions, type ResolverFunction, type ResolverObject, type RollupCommonJSOptions, type RollupDynamicImportVarsOptions, type SSROptions, type SSRTarget, type SendOptions, type ServerHMRChannel, ServerHMRConnector, type ServerHook, type ServerOptions, SplitVendorChunkCache, type SsrDepOptimizationOptions, Terser, type TerserOptions, type TransformOptions, type TransformResult, type UserConfig, type UserConfigExport, type UserConfigFn, type UserConfigFnObject, type UserConfigFnPromise, type ViteDevServer, type WatchOptions, WebSocket, WebSocketAlias, type WebSocketClient, type WebSocketCustomListener, WebSocketServer, build, buildErrorMessage, createFilter, createLogger, createServer, createViteRuntime, defineConfig, fetchModule, formatPostcssSourceMap, isCSSRequest, isFileServingAllowed, loadConfigFromFile, loadEnv, mergeAlias, mergeConfig, normalizePath, optimizeDeps, preprocessCSS, preview, resolveConfig, resolveEnvPrefix, rollupVersion, searchForWorkspaceRoot, send, sortUserPlugins, splitVendorChunk, splitVendorChunkPlugin, transformWithEsbuild, VERSION as version };
3527
+ export { type Alias, type AliasOptions, type AnymatchFn, type AnymatchPattern, type AppType, type AwaitWriteFinishOptions, type BindCLIShortcutsOptions, type BuildOptions, type CLIShortcut, type CSSModulesOptions, type CSSOptions, type CommonServerOptions, type ConfigEnv, Connect, type CorsOptions, type CorsOrigin, type DepOptimizationConfig, type DepOptimizationMetadata, type DepOptimizationOptions, type ESBuildOptions, type ESBuildTransformResult, type ExperimentalOptions, type ExportsData, FSWatcher, type FetchModuleOptions, type FileSystemServeOptions, type FilterPattern, type HMRBroadcaster, type HMRBroadcasterClient, type HMRChannel, type HTMLOptions, type HmrContext, type HmrOptions, type HookHandler, type HtmlTagDescriptor, HttpProxy, type IndexHtmlTransform, type IndexHtmlTransformContext, type IndexHtmlTransformHook, type IndexHtmlTransformResult, type InlineConfig, type InternalResolveOptions, type JsonOptions, type LegacyOptions, type LibraryFormats, type LibraryOptions, type LightningCSSOptions, type LogErrorOptions, type LogLevel, type LogOptions, type LogType, type Logger, type LoggerOptions, type MainThreadRuntimeOptions, type Manifest, type ManifestChunk, type MapToFunction, type AnymatchMatcher as Matcher, ModuleGraph, ModuleNode, type ModulePreloadOptions, type OptimizedDepInfo, type Plugin, type PluginContainer, type PluginHookUtils, type PluginOption, type PreprocessCSSResult, type PreviewOptions, type PreviewServer, type PreviewServerHook, type ProxyOptions, type RenderBuiltAssetUrl, type ResolveFn, type ResolveModulePreloadDependenciesFn, type ResolveOptions, type ResolvedBuildOptions, type ResolvedCSSOptions, type ResolvedConfig, type ResolvedModulePreloadOptions, type ResolvedPreviewOptions, type ResolvedSSROptions, type ResolvedServerOptions, type ResolvedServerUrls, type ResolvedUrl, type ResolvedWorkerOptions, type ResolverFunction, type ResolverObject, type RollupCommonJSOptions, type RollupDynamicImportVarsOptions, type SSROptions, type SSRTarget, type SendOptions, type ServerHMRChannel, ServerHMRConnector, type ServerHook, type ServerOptions, SplitVendorChunkCache, type SsrDepOptimizationOptions, Terser, type TerserOptions, type TransformOptions, type TransformResult, type UserConfig, type UserConfigExport, type UserConfigFn, type UserConfigFnObject, type UserConfigFnPromise, type ViteDevServer, type WatchOptions, WebSocket, WebSocketAlias, type WebSocketClient, type WebSocketCustomListener, WebSocketServer, build, buildErrorMessage, createFilter, createLogger, createServer, createViteRuntime, defineConfig, fetchModule, formatPostcssSourceMap, isCSSRequest, isFileServingAllowed, loadConfigFromFile, loadEnv, mergeAlias, mergeConfig, normalizePath, optimizeDeps, preprocessCSS, preview, resolveConfig, resolveEnvPrefix, rollupVersion, searchForWorkspaceRoot, send, sortUserPlugins, splitVendorChunk, splitVendorChunkPlugin, transformWithEsbuild, VERSION as version };
@@ -1,6 +1,6 @@
1
1
  export { parseAst, parseAstAsync } from 'rollup/parseAst';
2
- import { i as isInNodeModules, a as arraify } from './chunks/dep-BxRAmRCV.js';
3
- export { b as build, g as buildErrorMessage, k as createFilter, v as createLogger, c as createServer, d as defineConfig, h as fetchModule, f as formatPostcssSourceMap, x as isFileServingAllowed, l as loadConfigFromFile, y as loadEnv, j as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, e as preprocessCSS, p as preview, r as resolveConfig, z as resolveEnvPrefix, q as rollupVersion, w as searchForWorkspaceRoot, u as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-BxRAmRCV.js';
2
+ import { i as isInNodeModules, a as arraify } from './chunks/dep-B8QpfTwU.js';
3
+ export { b as build, g as buildErrorMessage, k as createFilter, v as createLogger, c as createServer, d as defineConfig, h as fetchModule, f as formatPostcssSourceMap, x as isFileServingAllowed, l as loadConfigFromFile, y as loadEnv, j as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, e as preprocessCSS, p as preview, r as resolveConfig, z as resolveEnvPrefix, q as rollupVersion, w as searchForWorkspaceRoot, u as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-B8QpfTwU.js';
4
4
  export { VERSION as version } from './constants.js';
5
5
  export { version as esbuildVersion } from 'esbuild';
6
6
  import { existsSync, readFileSync } from 'node:fs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite",
3
- "version": "5.2.0-beta.0",
3
+ "version": "5.2.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Evan You",
@@ -73,7 +73,7 @@
73
73
  "//": "READ CONTRIBUTING.md to understand what to put under deps vs. devDeps!",
74
74
  "dependencies": {
75
75
  "esbuild": "^0.20.1",
76
- "postcss": "^8.4.35",
76
+ "postcss": "^8.4.36",
77
77
  "rollup": "^4.13.0"
78
78
  },
79
79
  "optionalDependencies": {
@@ -113,7 +113,7 @@
113
113
  "fast-glob": "^3.3.2",
114
114
  "http-proxy": "^1.18.1",
115
115
  "launch-editor-middleware": "^2.6.1",
116
- "lightningcss": "^1.24.0",
116
+ "lightningcss": "^1.24.1",
117
117
  "magic-string": "^0.30.8",
118
118
  "micromatch": "^4.0.5",
119
119
  "mlly": "^1.6.1",
@@ -138,7 +138,7 @@
138
138
  "tsconfck": "^3.0.3",
139
139
  "tslib": "^2.6.2",
140
140
  "types": "link:./types",
141
- "ufo": "^1.4.0",
141
+ "ufo": "^1.5.1",
142
142
  "ws": "^8.16.0"
143
143
  },
144
144
  "peerDependencies": {
@@ -31,5 +31,8 @@ export interface InvalidatePayload {
31
31
  message: string | undefined
32
32
  }
33
33
 
34
+ /**
35
+ * provides types for built-in Vite events
36
+ */
34
37
  export type InferCustomEventPayload<T extends string> =
35
38
  T extends keyof CustomEventMap ? CustomEventMap[T] : any