vite 7.1.5 → 7.1.7

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.
package/LICENSE.md CHANGED
@@ -28,10 +28,10 @@ The published Vite artifact additionally contains code with the following licens
28
28
  BSD-2-Clause, CC0-1.0, ISC, MIT
29
29
 
30
30
  # Bundled dependencies:
31
- ## @jridgewell/gen-mapping, @jridgewell/remapping, @jridgewell/trace-mapping
31
+ ## @jridgewell/gen-mapping, @jridgewell/remapping, @jridgewell/sourcemap-codec, @jridgewell/trace-mapping
32
32
  License: MIT
33
33
  By: Justin Ridgewell
34
- Repositories: git+https://github.com/jridgewell/sourcemaps.git, git+https://github.com/jridgewell/sourcemaps.git, git+https://github.com/jridgewell/sourcemaps.git
34
+ Repositories: git+https://github.com/jridgewell/sourcemaps.git, git+https://github.com/jridgewell/sourcemaps.git, git+https://github.com/jridgewell/sourcemaps.git, git+https://github.com/jridgewell/sourcemaps.git
35
35
 
36
36
  > Copyright 2024 Justin Ridgewell <justin@ridgewell.name>
37
37
  >
@@ -82,35 +82,6 @@ Repository: https://github.com/jridgewell/resolve-uri
82
82
 
83
83
  ---------------------------------------
84
84
 
85
- ## @jridgewell/sourcemap-codec
86
- License: MIT
87
- By: Rich Harris
88
- Repository: git+https://github.com/jridgewell/sourcemap-codec.git
89
-
90
- > The MIT License
91
- >
92
- > Copyright (c) 2015 Rich Harris
93
- >
94
- > Permission is hereby granted, free of charge, to any person obtaining a copy
95
- > of this software and associated documentation files (the "Software"), to deal
96
- > in the Software without restriction, including without limitation the rights
97
- > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
98
- > copies of the Software, and to permit persons to whom the Software is
99
- > furnished to do so, subject to the following conditions:
100
- >
101
- > The above copyright notice and this permission notice shall be included in
102
- > all copies or substantial portions of the Software.
103
- >
104
- > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
105
- > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
106
- > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
107
- > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
108
- > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
109
- > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
110
- > THE SOFTWARE.
111
-
112
- ---------------------------------------
113
-
114
85
  ## @polka/compression
115
86
  License: MIT
116
87
  Repository: lukeed/polka
@@ -1,6 +1,6 @@
1
1
  import "@vite/env";
2
2
 
3
- //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.81.0/node_modules/@oxc-project/runtime/src/helpers/esm/typeof.js
3
+ //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.87.0/node_modules/@oxc-project/runtime/src/helpers/esm/typeof.js
4
4
  function _typeof(o) {
5
5
  "@babel/helpers - typeof";
6
6
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
@@ -11,7 +11,7 @@ function _typeof(o) {
11
11
  }
12
12
 
13
13
  //#endregion
14
- //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.81.0/node_modules/@oxc-project/runtime/src/helpers/esm/toPrimitive.js
14
+ //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.87.0/node_modules/@oxc-project/runtime/src/helpers/esm/toPrimitive.js
15
15
  function toPrimitive(t, r) {
16
16
  if ("object" != _typeof(t) || !t) return t;
17
17
  var e = t[Symbol.toPrimitive];
@@ -24,14 +24,14 @@ function toPrimitive(t, r) {
24
24
  }
25
25
 
26
26
  //#endregion
27
- //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.81.0/node_modules/@oxc-project/runtime/src/helpers/esm/toPropertyKey.js
27
+ //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.87.0/node_modules/@oxc-project/runtime/src/helpers/esm/toPropertyKey.js
28
28
  function toPropertyKey(t) {
29
29
  var i = toPrimitive(t, "string");
30
30
  return "symbol" == _typeof(i) ? i : i + "";
31
31
  }
32
32
 
33
33
  //#endregion
34
- //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.81.0/node_modules/@oxc-project/runtime/src/helpers/esm/defineProperty.js
34
+ //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.87.0/node_modules/@oxc-project/runtime/src/helpers/esm/defineProperty.js
35
35
  function _defineProperty(e, r, t) {
36
36
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
37
37
  value: t,
@@ -171,10 +171,10 @@ var HMRClient = class {
171
171
  const disposer = this.disposeMap.get(path);
172
172
  if (disposer) return disposer(this.dataMap.get(path));
173
173
  }));
174
- paths.forEach((path) => {
174
+ await Promise.all(paths.map((path) => {
175
175
  const fn = this.pruneMap.get(path);
176
- if (fn) fn(this.dataMap.get(path));
177
- });
176
+ if (fn) return fn(this.dataMap.get(path));
177
+ }));
178
178
  }
179
179
  warnFailedUpdate(err, path) {
180
180
  if (!(err instanceof Error) || !err.message.includes("fetch")) this.logger.error(err);
@@ -247,12 +247,11 @@ const AsyncFunction = async function() {}.constructor;
247
247
  function promiseWithResolvers() {
248
248
  let resolve;
249
249
  let reject;
250
- const promise = new Promise((_resolve, _reject) => {
251
- resolve = _resolve;
252
- reject = _reject;
253
- });
254
250
  return {
255
- promise,
251
+ promise: new Promise((_resolve, _reject) => {
252
+ resolve = _resolve;
253
+ reject = _reject;
254
+ }),
256
255
  resolve,
257
256
  reject
258
257
  };
@@ -490,9 +489,10 @@ var Queue = class {
490
489
  //#region src/client/overlay.ts
491
490
  const hmrConfigName = __HMR_CONFIG_NAME__;
492
491
  const base$1 = __BASE__ || "/";
492
+ const cspNonce = "document" in globalThis ? document.querySelector("meta[property=csp-nonce]")?.nonce : void 0;
493
493
  function h(e, attrs = {}, ...children) {
494
494
  const elem = document.createElement(e);
495
- for (const [k, v] of Object.entries(attrs)) elem.setAttribute(k, v);
495
+ for (const [k, v] of Object.entries(attrs)) if (v !== void 0) elem.setAttribute(k, v);
496
496
  elem.append(...children);
497
497
  return elem;
498
498
  }
@@ -664,7 +664,7 @@ const createTemplate = () => h("div", {
664
664
  }), h("div", {
665
665
  class: "tip",
666
666
  part: "tip"
667
- }, "Click outside, press ", h("kbd", {}, "Esc"), " key, or fix the code to dismiss.", h("br"), "You can also disable this overlay by setting ", h("code", { part: "config-option-name" }, "server.hmr.overlay"), " to ", h("code", { part: "config-option-value" }, "false"), " in ", h("code", { part: "config-file-name" }, hmrConfigName), ".")), h("style", {}, templateStyle));
667
+ }, "Click outside, press ", h("kbd", {}, "Esc"), " key, or fix the code to dismiss.", h("br"), "You can also disable this overlay by setting ", h("code", { part: "config-option-name" }, "server.hmr.overlay"), " to ", h("code", { part: "config-option-value" }, "false"), " in ", h("code", { part: "config-file-name" }, hmrConfigName), ".")), h("style", { nonce: cspNonce }, templateStyle));
668
668
  const fileRE = /(?:file:\/\/)?(?:[a-zA-Z]:\\|\/).*?:\d+:\d+/g;
669
669
  const codeframeRE = /^(?:>?\s*\d+\s+\|.*|\s+\|\s*\^.*)\r?\n/gm;
670
670
  const { HTMLElement = class {} } = globalThis;
@@ -893,10 +893,7 @@ async function handleMessage(payload) {
893
893
  }
894
894
  break;
895
895
  case "ping": break;
896
- default: {
897
- const check = payload;
898
- return check;
899
- }
896
+ default: return payload;
900
897
  }
901
898
  }
902
899
  const enableOverlay = __HMR_ENABLE_OVERLAY__;
@@ -957,8 +954,7 @@ function waitForSuccessfulPing(socketUrl) {
957
954
  }
958
955
  function pingWorkerContentMain(socketUrl) {
959
956
  self.addEventListener("connect", (_event) => {
960
- const event = _event;
961
- const port = event.ports[0];
957
+ const port = _event.ports[0];
962
958
  if (!socketUrl) {
963
959
  port.postMessage({
964
960
  type: "error",
@@ -970,8 +966,8 @@ function pingWorkerContentMain(socketUrl) {
970
966
  currentState: "visible",
971
967
  listeners: /* @__PURE__ */ new Set()
972
968
  };
973
- port.addEventListener("message", (event$1) => {
974
- const { visibility } = event$1.data;
969
+ port.addEventListener("message", (event) => {
970
+ const { visibility } = event.data;
975
971
  visibilityManager.currentState = visibility;
976
972
  console.debug("[vite] new window visibility", visibility);
977
973
  for (const listener of visibilityManager.listeners) listener(visibility);
@@ -1054,7 +1050,6 @@ const sheetsMap = /* @__PURE__ */ new Map();
1054
1050
  if ("document" in globalThis) document.querySelectorAll("style[data-vite-dev-id]").forEach((el) => {
1055
1051
  sheetsMap.set(el.getAttribute("data-vite-dev-id"), el);
1056
1052
  });
1057
- const cspNonce = "document" in globalThis ? document.querySelector("meta[property=csp-nonce]")?.nonce : void 0;
1058
1053
  let lastInsertedStyle;
1059
1054
  function updateStyle(id, content) {
1060
1055
  let style = sheetsMap.get(id);
@@ -0,0 +1,4 @@
1
+ import "./dep-SmwnYDP9.js";
2
+ import { preview, resolvePreviewOptions } from "./dep-Bm2ujbhY.js";
3
+
4
+ export { preview };
@@ -1,4 +1,4 @@
1
1
  import "./dep-SmwnYDP9.js";
2
- import { addManuallyIncludedOptimizeDeps, addOptimizedDepInfo, cleanupDepsCacheStaleDirs, createIsOptimizedDepFile, createIsOptimizedDepUrl, depsFromOptimizedDepInfo, depsLogString, discoverProjectDependencies, extractExportsData, getDepsCacheDir, getOptimizedDepPath, initDepsOptimizerMetadata, isDepOptimizationDisabled, loadCachedDepOptimizationMetadata, optimizeDeps, optimizeExplicitEnvironmentDeps, optimizedDepInfoFromFile, optimizedDepInfoFromId, optimizedDepNeedsInterop, runOptimizeDeps, toDiscoveredDependencies } from "./dep-M_KD0XSK.js";
2
+ import { addManuallyIncludedOptimizeDeps, addOptimizedDepInfo, cleanupDepsCacheStaleDirs, createIsOptimizedDepFile, createIsOptimizedDepUrl, depsFromOptimizedDepInfo, depsLogString, discoverProjectDependencies, extractExportsData, getDepsCacheDir, getOptimizedDepPath, initDepsOptimizerMetadata, isDepOptimizationDisabled, loadCachedDepOptimizationMetadata, optimizeDeps, optimizeExplicitEnvironmentDeps, optimizedDepInfoFromFile, optimizedDepInfoFromId, optimizedDepNeedsInterop, runOptimizeDeps, toDiscoveredDependencies } from "./dep-Bm2ujbhY.js";
3
3
 
4
4
  export { optimizeDeps };
@@ -1,4 +1,4 @@
1
1
  import "./dep-SmwnYDP9.js";
2
- import { configDefaults, defineConfig, getDefaultEnvironmentOptions, isResolvedConfig, loadConfigFromFile, resolveBaseUrl, resolveConfig, resolveDevEnvironmentOptions, sortUserPlugins } from "./dep-M_KD0XSK.js";
2
+ import { configDefaults, defineConfig, getDefaultEnvironmentOptions, isResolvedConfig, loadConfigFromFile, resolveBaseUrl, resolveConfig, resolveDevEnvironmentOptions, sortUserPlugins } from "./dep-Bm2ujbhY.js";
3
3
 
4
4
  export { resolveConfig };