vite 7.1.8 → 7.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of vite might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  import "@vite/env";
2
2
 
3
- //#region \0@oxc-project+runtime@0.93.0/helpers/typeof.js
3
+ //#region \0@oxc-project+runtime@0.94.0/helpers/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 \0@oxc-project+runtime@0.93.0/helpers/toPrimitive.js
14
+ //#region \0@oxc-project+runtime@0.94.0/helpers/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 \0@oxc-project+runtime@0.93.0/helpers/toPropertyKey.js
27
+ //#region \0@oxc-project+runtime@0.94.0/helpers/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 \0@oxc-project+runtime@0.93.0/helpers/defineProperty.js
34
+ //#region \0@oxc-project+runtime@0.94.0/helpers/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,
@@ -1047,11 +1047,18 @@ async function waitForSuccessfulPingInternal(socketUrl, visibilityManager, ms =
1047
1047
  } else await waitForWindowShow(visibilityManager);
1048
1048
  }
1049
1049
  const sheetsMap = /* @__PURE__ */ new Map();
1050
- if ("document" in globalThis) document.querySelectorAll("style[data-vite-dev-id]").forEach((el) => {
1051
- sheetsMap.set(el.getAttribute("data-vite-dev-id"), el);
1052
- });
1050
+ const linkSheetsMap = /* @__PURE__ */ new Map();
1051
+ if ("document" in globalThis) {
1052
+ document.querySelectorAll("style[data-vite-dev-id]").forEach((el) => {
1053
+ sheetsMap.set(el.getAttribute("data-vite-dev-id"), el);
1054
+ });
1055
+ document.querySelectorAll("link[rel=\"stylesheet\"][data-vite-dev-id]").forEach((el) => {
1056
+ linkSheetsMap.set(el.getAttribute("data-vite-dev-id"), el);
1057
+ });
1058
+ }
1053
1059
  let lastInsertedStyle;
1054
1060
  function updateStyle(id, content) {
1061
+ if (linkSheetsMap.has(id)) return;
1055
1062
  let style = sheetsMap.get(id);
1056
1063
  if (!style) {
1057
1064
  style = document.createElement("style");
@@ -1070,6 +1077,12 @@ function updateStyle(id, content) {
1070
1077
  sheetsMap.set(id, style);
1071
1078
  }
1072
1079
  function removeStyle(id) {
1080
+ if (linkSheetsMap.has(id)) {
1081
+ document.querySelectorAll(`link[rel="stylesheet"][data-vite-dev-id]`).forEach((el) => {
1082
+ if (el.getAttribute("data-vite-dev-id") === id) el.remove();
1083
+ });
1084
+ linkSheetsMap.delete(id);
1085
+ }
1073
1086
  const style = sheetsMap.get(id);
1074
1087
  if (style) {
1075
1088
  document.head.removeChild(style);