@cloudflare/vite-plugin 0.0.0-91d0c408c → 0.0.0-92874fef2
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/dist/index.js +2 -14
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -13029,19 +13029,6 @@ function toMiniflareRequest(request) {
|
|
|
13029
13029
|
duplex: "half"
|
|
13030
13030
|
});
|
|
13031
13031
|
}
|
|
13032
|
-
function nodeHeadersToWebHeaders(nodeHeaders) {
|
|
13033
|
-
const headers = new Headers();
|
|
13034
|
-
for (const [key, value] of Object.entries(nodeHeaders)) {
|
|
13035
|
-
if (typeof value === "string") {
|
|
13036
|
-
headers.append(key, value);
|
|
13037
|
-
} else if (Array.isArray(value)) {
|
|
13038
|
-
for (const item of value) {
|
|
13039
|
-
headers.append(key, item);
|
|
13040
|
-
}
|
|
13041
|
-
}
|
|
13042
|
-
}
|
|
13043
|
-
return headers;
|
|
13044
|
-
}
|
|
13045
13032
|
var postfixRE = /[?#].*$/;
|
|
13046
13033
|
function cleanUrl(url) {
|
|
13047
13034
|
return url.replace(postfixRE, "");
|
|
@@ -14182,6 +14169,7 @@ function resolvePluginConfig(pluginConfig, userConfig, viteEnv) {
|
|
|
14182
14169
|
}
|
|
14183
14170
|
|
|
14184
14171
|
// src/websockets.ts
|
|
14172
|
+
import { createHeaders } from "@mjackson/node-fetch-server";
|
|
14185
14173
|
import { coupleWebSocket } from "miniflare";
|
|
14186
14174
|
import { WebSocketServer } from "ws";
|
|
14187
14175
|
function handleWebSocket(httpServer, getFetcher) {
|
|
@@ -14193,7 +14181,7 @@ function handleWebSocket(httpServer, getFetcher) {
|
|
|
14193
14181
|
if (request.headers["sec-websocket-protocol"]?.startsWith("vite")) {
|
|
14194
14182
|
return;
|
|
14195
14183
|
}
|
|
14196
|
-
const headers =
|
|
14184
|
+
const headers = createHeaders(request);
|
|
14197
14185
|
const fetcher = await getFetcher();
|
|
14198
14186
|
const response = await fetcher(url, {
|
|
14199
14187
|
headers,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudflare/vite-plugin",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-92874fef2",
|
|
4
4
|
"description": "Cloudflare plugin for Vite",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -38,11 +38,11 @@
|
|
|
38
38
|
"get-port": "^7.1.0",
|
|
39
39
|
"picocolors": "^1.1.1",
|
|
40
40
|
"tinyglobby": "^0.2.12",
|
|
41
|
-
"unenv": "2.0.0-rc.
|
|
41
|
+
"unenv": "2.0.0-rc.17",
|
|
42
42
|
"ws": "8.18.0",
|
|
43
|
-
"@cloudflare/unenv-preset": "0.0.0-
|
|
44
|
-
"
|
|
45
|
-
"
|
|
43
|
+
"@cloudflare/unenv-preset": "0.0.0-92874fef2",
|
|
44
|
+
"wrangler": "0.0.0-92874fef2",
|
|
45
|
+
"miniflare": "0.0.0-92874fef2"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@cloudflare/workers-types": "^4.20250508.0",
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"vite": "^6.1.0",
|
|
57
57
|
"vitest": "~3.1.1",
|
|
58
58
|
"@cloudflare/mock-npm-registry": "0.0.0",
|
|
59
|
-
"@cloudflare/workers-
|
|
60
|
-
"@cloudflare/workers-
|
|
59
|
+
"@cloudflare/workers-tsconfig": "0.0.0",
|
|
60
|
+
"@cloudflare/workers-shared": "0.0.0-92874fef2"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"vite": "^6.1.0",
|