vite 8.2.0 → 8.2.2

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.
@@ -65,19 +65,22 @@ function normalizeString(path, allowAboveRoot) {
65
65
  else if (char === "/") break;
66
66
  else char = "/";
67
67
  if (char === "/") {
68
- if (lastSlash !== index - 1 && dots !== 1) if (dots === 2) {
69
- if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
70
- if (res.length > 2) {
71
- let lastSlashIndex = res.lastIndexOf("/");
72
- lastSlashIndex === -1 ? (res = "", lastSegmentLength = 0) : (res = res.slice(0, lastSlashIndex), lastSegmentLength = res.length - 1 - res.lastIndexOf("/")), lastSlash = index, dots = 0;
73
- continue;
74
- } else if (res.length > 0) {
75
- res = "", lastSegmentLength = 0, lastSlash = index, dots = 0;
76
- continue;
68
+ if (lastSlash !== index - 1 && dots !== 1) {
69
+ if (dots === 2) {
70
+ if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
71
+ if (res.length > 2) {
72
+ let lastSlashIndex = res.lastIndexOf("/");
73
+ lastSlashIndex === -1 ? (res = "", lastSegmentLength = 0) : (res = res.slice(0, lastSlashIndex), lastSegmentLength = res.length - 1 - res.lastIndexOf("/")), lastSlash = index, dots = 0;
74
+ continue;
75
+ }
76
+ if (res.length > 0) {
77
+ res = "", lastSegmentLength = 0, lastSlash = index, dots = 0;
78
+ continue;
79
+ }
77
80
  }
78
- }
79
- allowAboveRoot && (res += res.length > 0 ? "/.." : "..", lastSegmentLength = 2);
80
- } else res.length > 0 ? res += `/${path.slice(lastSlash + 1, index)}` : res = path.slice(lastSlash + 1, index), lastSegmentLength = index - lastSlash - 1;
81
+ allowAboveRoot && (res += res.length > 0 ? "/.." : "..", lastSegmentLength = 2);
82
+ } else res.length > 0 ? res += `/${path.slice(lastSlash + 1, index)}` : res = path.slice(lastSlash + 1, index), lastSegmentLength = index - lastSlash - 1;
83
+ }
81
84
  lastSlash = index, dots = 0;
82
85
  } else char === "." && dots !== -1 ? ++dots : dots = -1;
83
86
  }
@@ -651,14 +654,18 @@ const createInvokeableTransport = (transport) => {
651
654
  } } : {},
652
655
  async send(data) {
653
656
  if (invokeableTransport.send) {
654
- if (!isConnected) if (connectingPromise) await connectingPromise;
655
- else throw new SendBeforeConnectError("send was called before connect");
657
+ if (!isConnected) {
658
+ if (connectingPromise) await connectingPromise;
659
+ else throw new SendBeforeConnectError("send was called before connect");
660
+ }
656
661
  await invokeableTransport.send(data);
657
662
  }
658
663
  },
659
664
  async invoke(name, data) {
660
- if (!isConnected) if (connectingPromise) await connectingPromise;
661
- else throw new SendBeforeConnectError("invoke was called before connect");
665
+ if (!isConnected) {
666
+ if (connectingPromise) await connectingPromise;
667
+ else throw new SendBeforeConnectError("invoke was called before connect");
668
+ }
662
669
  return invokeableTransport.invoke(name, data);
663
670
  }
664
671
  };
@@ -871,7 +878,11 @@ function retrieveSourceMap(source) {
871
878
  let sourceMappingURL = retrieveSourceMapURL(source);
872
879
  if (!sourceMappingURL) return null;
873
880
  let sourceMapData;
874
- return reSourceMap.test(sourceMappingURL) ? (sourceMapData = decodeBase64(sourceMappingURL.slice(sourceMappingURL.indexOf(",") + 1)), sourceMappingURL = source) : (sourceMappingURL = supportRelativeURL(source, sourceMappingURL), sourceMapData = retrieveFile(sourceMappingURL)), sourceMapData ? {
881
+ if (reSourceMap.test(sourceMappingURL)) {
882
+ let rawData = sourceMappingURL.slice(sourceMappingURL.indexOf(",") + 1);
883
+ sourceMapData = decodeBase64(rawData), sourceMappingURL = source;
884
+ } else sourceMappingURL = supportRelativeURL(source, sourceMappingURL), sourceMapData = retrieveFile(sourceMappingURL);
885
+ return sourceMapData ? {
875
886
  url: sourceMappingURL,
876
887
  map: sourceMapData
877
888
  } : null;
@@ -923,7 +934,7 @@ function CallSiteToString() {
923
934
  let fileName, fileLocation = "";
924
935
  if (this.isNative()) fileLocation = "native";
925
936
  else {
926
- fileName = this.getScriptNameOrSourceURL(), !fileName && this.isEval() && (fileLocation = this.getEvalOrigin(), fileLocation += ", "), fileName ? fileLocation += fileName : fileLocation += "<anonymous>";
937
+ fileName = this.getScriptNameOrSourceURL(), !fileName && this.isEval() && (fileLocation = this.getEvalOrigin(), fileLocation += ", "), fileLocation += fileName || "<anonymous>";
927
938
  let lineNumber = this.getLineNumber();
928
939
  if (lineNumber != null) {
929
940
  fileLocation += `:${lineNumber}`;
@@ -1151,9 +1162,8 @@ var ModuleRunner = class {
1151
1162
  if (visited.has(mod.id)) return !1;
1152
1163
  visited.add(mod.id);
1153
1164
  for (let importedModuleId of mod.imports) {
1154
- if (callstack.includes(importedModuleId)) return !0;
1155
1165
  let importedModule = this.evaluatedModules.getModuleById(importedModuleId);
1156
- if (importedModule?.promise && !importedModule.evaluated && this.isCircularRequest(importedModule, callstack, visited)) return !0;
1166
+ if (!(!importedModule?.promise || importedModule.evaluated) && (callstack.includes(importedModuleId) || this.isCircularRequest(importedModule, callstack, visited))) return !0;
1157
1167
  }
1158
1168
  return !1;
1159
1169
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite",
3
- "version": "8.2.0",
3
+ "version": "8.2.2",
4
4
  "description": "Native-ESM powered web dev build tool",
5
5
  "keywords": [
6
6
  "build-tool",
@@ -58,12 +58,12 @@
58
58
  "dependencies": {
59
59
  "lightningcss": "^1.33.0",
60
60
  "picomatch": "^4.0.5",
61
- "postcss": "^8.5.23",
62
- "rolldown": "~1.2.0",
61
+ "postcss": "^8.5.26",
62
+ "rolldown": "~1.2.4",
63
63
  "tinyglobby": "^0.2.17"
64
64
  },
65
65
  "devDependencies": {
66
- "@babel/parser": "^7.29.7",
66
+ "@babel/parser": "^7.29.8",
67
67
  "@jridgewell/remapping": "^2.3.5",
68
68
  "@jridgewell/trace-mapping": "^0.3.31",
69
69
  "@polka/compression": "^1.0.0-next.25",
@@ -72,12 +72,12 @@
72
72
  "@rollup/pluginutils": "^5.4.0",
73
73
  "@types/escape-html": "^1.0.4",
74
74
  "@types/pnpapi": "^0.0.5",
75
- "@vercel/detect-agent": "^1.2.3",
76
- "@vitejs/devtools": "^0.4.8",
75
+ "@vercel/detect-agent": "^1.2.5",
76
+ "@vitejs/devtools": "^0.4.12",
77
77
  "@vitest/utils": "4.1.10",
78
78
  "@voidzero-dev/vite-task-client": "^0.2.0",
79
79
  "artichokie": "^0.4.4",
80
- "baseline-browser-mapping": "^2.11.3",
80
+ "baseline-browser-mapping": "^2.11.14",
81
81
  "cac": "^7.0.0",
82
82
  "chokidar": "^3.6.0",
83
83
  "connect": "^3.7.0",
@@ -86,7 +86,7 @@
86
86
  "cross-spawn": "^7.0.6",
87
87
  "dotenv-expand": "^13.0.0",
88
88
  "es-module-lexer": "^2.3.1",
89
- "esbuild": "^0.28.1",
89
+ "esbuild": "^0.28.2",
90
90
  "escape-html": "^1.0.3",
91
91
  "estree-walker": "^3.0.3",
92
92
  "etag": "^1.8.1",
@@ -94,7 +94,7 @@
94
94
  "host-validation-middleware": "^0.1.4",
95
95
  "http-proxy-3": "^1.23.3",
96
96
  "launch-editor-middleware": "^2.14.1",
97
- "magic-string": "^1.1.0",
97
+ "magic-string": "^1.2.0",
98
98
  "mlly": "^1.8.2",
99
99
  "mrmime": "^2.0.1",
100
100
  "nanoid": "^5.1.16",
@@ -104,25 +104,25 @@
104
104
  "pathe": "^2.0.3",
105
105
  "periscopic": "^4.0.3",
106
106
  "picocolors": "^1.1.1",
107
- "postcss-import": "^16.1.1",
107
+ "postcss-import": "^16.2.0",
108
108
  "postcss-load-config": "^6.0.1",
109
109
  "postcss-modules": "^9.0.1",
110
110
  "premove": "^4.0.0",
111
111
  "resolve.exports": "^2.0.3",
112
- "rolldown-plugin-dts": "^0.27.9",
112
+ "rolldown-plugin-dts": "^0.28.2",
113
113
  "rollup": "^4.59.0",
114
114
  "rollup-plugin-license": "^3.7.1",
115
115
  "sass": "^1.102.0",
116
- "sass-embedded": "^1.100.0",
116
+ "sass-embedded": "^1.102.0",
117
117
  "sirv": "^3.0.2",
118
- "strip-literal": "^3.1.0",
119
- "terser": "^5.49.0",
118
+ "strip-literal": "^4.0.0",
119
+ "terser": "^5.50.0",
120
120
  "ufo": "^1.6.4",
121
- "ws": "^8.21.1"
121
+ "ws": "^8.21.3"
122
122
  },
123
123
  "peerDependencies": {
124
124
  "@types/node": "^20.19.0 || >=22.12.0",
125
- "@vitejs/devtools": "^0.4.0",
125
+ "@vitejs/devtools": "^0.4.0 || ^0.5.0",
126
126
  "esbuild": "^0.27.0 || ^0.28.0",
127
127
  "jiti": ">=1.21.0",
128
128
  "less": "^4.0.0",