@cloudflare/vite-plugin 0.1.5 → 0.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/dist/asset-workers/asset-worker.js +3 -3
- package/dist/index.js +12 -8
- package/package.json +5 -5
|
@@ -2072,8 +2072,8 @@ var Ve = class {
|
|
|
2072
2072
|
};
|
|
2073
2073
|
var Yn = "public, max-age=0, must-revalidate";
|
|
2074
2074
|
function Jn(t, e, n) {
|
|
2075
|
-
let r = new Headers({
|
|
2076
|
-
return Ds(n) && r.append("Cache-Control", Yn), r;
|
|
2075
|
+
let r = new Headers({ ETag: `"${t}"` });
|
|
2076
|
+
return e !== void 0 && r.append("Content-Type", e), Ds(n) && r.append("Cache-Control", Yn), r;
|
|
2077
2077
|
}
|
|
2078
2078
|
function Ds(t) {
|
|
2079
2079
|
return !t.headers.has("Authorization") && !t.headers.has("Range");
|
|
@@ -2280,7 +2280,7 @@ var Kn = class extends Us {
|
|
|
2280
2280
|
async unstable_getByETag(t) {
|
|
2281
2281
|
let e = await Wn(this.env.ASSETS_KV_NAMESPACE, t);
|
|
2282
2282
|
if (!e || !e.value) throw new Error(`Requested asset ${t} exists in the asset manifest but not in the KV namespace.`);
|
|
2283
|
-
return { readableStream: e.value, contentType: e.metadata?.contentType
|
|
2283
|
+
return { readableStream: e.value, contentType: e.metadata?.contentType };
|
|
2284
2284
|
}
|
|
2285
2285
|
async unstable_getByPathname(t) {
|
|
2286
2286
|
let e = await this.unstable_exists(t);
|
package/dist/index.js
CHANGED
|
@@ -1364,7 +1364,12 @@ import * as fs2 from "node:fs";
|
|
|
1364
1364
|
import * as fsp from "node:fs/promises";
|
|
1365
1365
|
import * as path3 from "node:path";
|
|
1366
1366
|
import { fileURLToPath } from "node:url";
|
|
1367
|
-
import {
|
|
1367
|
+
import {
|
|
1368
|
+
kCurrentWorker,
|
|
1369
|
+
Log,
|
|
1370
|
+
LogLevel,
|
|
1371
|
+
Response as MiniflareResponse
|
|
1372
|
+
} from "miniflare";
|
|
1368
1373
|
import "vite";
|
|
1369
1374
|
import {
|
|
1370
1375
|
unstable_getMiniflareWorkerOptions,
|
|
@@ -1398,11 +1403,10 @@ function getWorkerToWorkerEntrypointNamesMap(workers) {
|
|
|
1398
1403
|
);
|
|
1399
1404
|
for (const worker of workers) {
|
|
1400
1405
|
for (const value of Object.values(worker.serviceBindings ?? {})) {
|
|
1401
|
-
if (typeof value === "object" && "name" in value &&
|
|
1402
|
-
const
|
|
1403
|
-
|
|
1404
|
-
);
|
|
1405
|
-
assert4(entrypointNames, missingWorkerErrorMessage(value.name));
|
|
1406
|
+
if (typeof value === "object" && "name" in value && value.entrypoint !== void 0 && value.entrypoint !== "default") {
|
|
1407
|
+
const targetWorkerName = value.name === kCurrentWorker ? worker.name : value.name;
|
|
1408
|
+
const entrypointNames = workerToWorkerEntrypointNamesMap.get(targetWorkerName);
|
|
1409
|
+
assert4(entrypointNames, missingWorkerErrorMessage(targetWorkerName));
|
|
1406
1410
|
entrypointNames.add(value.entrypoint);
|
|
1407
1411
|
}
|
|
1408
1412
|
}
|
|
@@ -9216,7 +9220,7 @@ function cloudflare2(pluginConfig = {}) {
|
|
|
9216
9220
|
}
|
|
9217
9221
|
} : void 0,
|
|
9218
9222
|
builder: {
|
|
9219
|
-
|
|
9223
|
+
buildApp: userConfig.builder?.buildApp ?? (async (builder) => {
|
|
9220
9224
|
const clientEnvironment = builder.environments.client;
|
|
9221
9225
|
const defaultHtmlPath = path7.resolve(
|
|
9222
9226
|
builder.config.root,
|
|
@@ -9242,7 +9246,7 @@ function cloudflare2(pluginConfig = {}) {
|
|
|
9242
9246
|
)
|
|
9243
9247
|
);
|
|
9244
9248
|
}
|
|
9245
|
-
}
|
|
9249
|
+
})
|
|
9246
9250
|
}
|
|
9247
9251
|
};
|
|
9248
9252
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudflare/vite-plugin",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "Cloudflare plugin for Vite",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@hattip/adapter-node": "^0.0.49",
|
|
38
38
|
"unenv": "2.0.0-rc.1",
|
|
39
39
|
"ws": "8.18.0",
|
|
40
|
-
"miniflare": "3.20250214.
|
|
40
|
+
"miniflare": "3.20250214.1"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@cloudflare/workers-types": "^4.20250214.0",
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
"undici": "^5.28.5",
|
|
51
51
|
"vite": "^6.1.0",
|
|
52
52
|
"vitest": "~3.0.5",
|
|
53
|
-
"@cloudflare/
|
|
53
|
+
"@cloudflare/mock-npm-registry": "0.0.0",
|
|
54
|
+
"@cloudflare/workers-shared": "0.14.4",
|
|
54
55
|
"@cloudflare/workers-tsconfig": "0.0.0",
|
|
55
|
-
"wrangler": "3.
|
|
56
|
-
"@cloudflare/mock-npm-registry": "0.0.0"
|
|
56
|
+
"wrangler": "3.111.0"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"vite": "^6.1.0",
|