@cloudflare/vite-plugin 0.0.0-dae7bd4dd → 0.0.0-db300ef98
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/README.md +15 -480
- package/dist/asset-workers/asset-worker.js +716 -690
- package/dist/asset-workers/router-worker.js +1 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +5487 -206
- package/dist/runner-worker/index.js +18 -22
- package/package.json +11 -8
|
@@ -29,7 +29,7 @@ function stripInternalEnv(internalEnv) {
|
|
|
29
29
|
return userEnv;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
// ../../node_modules/.pnpm/vite@6.1.0_@types+node@18.19.76_jiti@2.4.2/node_modules/vite/dist/node/module-runner.js
|
|
32
|
+
// ../../node_modules/.pnpm/vite@6.1.0_@types+node@18.19.76_jiti@2.4.2_lightningcss@1.29.2/node_modules/vite/dist/node/module-runner.js
|
|
33
33
|
var VALID_ID_PREFIX = "/@id/";
|
|
34
34
|
var NULL_BYTE_PLACEHOLDER = "__x00__";
|
|
35
35
|
var SOURCEMAPPING_URL = "sourceMa";
|
|
@@ -1394,13 +1394,6 @@ async function createModuleRunner(env, webSocket, viteRoot) {
|
|
|
1394
1394
|
},
|
|
1395
1395
|
{
|
|
1396
1396
|
async runInlinedModule(context, transformed, module) {
|
|
1397
|
-
if (module.file.includes("/node_modules") && !module.file.includes("/node_modules/.vite")) {
|
|
1398
|
-
throw new Error(
|
|
1399
|
-
`[Error] Trying to import non-prebundled module (only prebundled modules are allowed): ${module.id}
|
|
1400
|
-
|
|
1401
|
-
(have you excluded the module via \`optimizeDeps.exclude\`?)`
|
|
1402
|
-
);
|
|
1403
|
-
}
|
|
1404
1397
|
const codeDefinition = `'use strict';async (${Object.keys(context).join(
|
|
1405
1398
|
","
|
|
1406
1399
|
)})=>{{`;
|
|
@@ -1417,12 +1410,14 @@ async function createModuleRunner(env, webSocket, viteRoot) {
|
|
|
1417
1410
|
}
|
|
1418
1411
|
},
|
|
1419
1412
|
async runExternalModule(filepath) {
|
|
1420
|
-
if (
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
(
|
|
1425
|
-
|
|
1413
|
+
if (filepath === "cloudflare:workers") {
|
|
1414
|
+
const originalCloudflareWorkersModule = await import("cloudflare:workers");
|
|
1415
|
+
return Object.seal({
|
|
1416
|
+
...originalCloudflareWorkersModule,
|
|
1417
|
+
env: stripInternalEnv(
|
|
1418
|
+
originalCloudflareWorkersModule.env
|
|
1419
|
+
)
|
|
1420
|
+
});
|
|
1426
1421
|
}
|
|
1427
1422
|
filepath = filepath.replace(/^file:\/\//, "");
|
|
1428
1423
|
return import(filepath);
|
|
@@ -1440,20 +1435,21 @@ async function getWorkerEntryExport(path, entrypoint) {
|
|
|
1440
1435
|
}
|
|
1441
1436
|
|
|
1442
1437
|
// src/runner-worker/index.ts
|
|
1438
|
+
var IGNORED_KEYS = ["self", "tailStream"];
|
|
1443
1439
|
var WORKER_ENTRYPOINT_KEYS = [
|
|
1444
1440
|
"fetch",
|
|
1441
|
+
"queue",
|
|
1445
1442
|
"tail",
|
|
1443
|
+
"test",
|
|
1446
1444
|
"trace",
|
|
1447
|
-
"scheduled"
|
|
1448
|
-
"queue",
|
|
1449
|
-
"test"
|
|
1445
|
+
"scheduled"
|
|
1450
1446
|
];
|
|
1451
1447
|
var DURABLE_OBJECT_KEYS = [
|
|
1452
|
-
"fetch",
|
|
1453
1448
|
"alarm",
|
|
1454
|
-
"
|
|
1449
|
+
"fetch",
|
|
1455
1450
|
"webSocketClose",
|
|
1456
|
-
"webSocketError"
|
|
1451
|
+
"webSocketError",
|
|
1452
|
+
"webSocketMessage"
|
|
1457
1453
|
];
|
|
1458
1454
|
var WORKFLOW_ENTRYPOINT_KEYS = ["run"];
|
|
1459
1455
|
var entryPath = "";
|
|
@@ -1518,7 +1514,7 @@ function createWorkerEntrypointWrapper(entrypoint) {
|
|
|
1518
1514
|
if (value !== void 0) {
|
|
1519
1515
|
return value;
|
|
1520
1516
|
}
|
|
1521
|
-
if (key === "
|
|
1517
|
+
if (typeof key === "symbol" || IGNORED_KEYS.includes(key) || DURABLE_OBJECT_KEYS.includes(key)) {
|
|
1522
1518
|
return;
|
|
1523
1519
|
}
|
|
1524
1520
|
const property = getWorkerEntrypointRpcProperty.call(
|
|
@@ -1616,7 +1612,7 @@ function createDurableObjectWrapper(className) {
|
|
|
1616
1612
|
if (value !== void 0) {
|
|
1617
1613
|
return value;
|
|
1618
1614
|
}
|
|
1619
|
-
if (key === "
|
|
1615
|
+
if (typeof key === "symbol" || IGNORED_KEYS.includes(key) || WORKER_ENTRYPOINT_KEYS.includes(key)) {
|
|
1620
1616
|
return;
|
|
1621
1617
|
}
|
|
1622
1618
|
const property = getDurableObjectRpcProperty.call(
|
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-db300ef98",
|
|
4
4
|
"description": "Cloudflare plugin for Vite",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -34,15 +34,18 @@
|
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@hattip/adapter-node": "^0.0.49",
|
|
37
|
+
"@rollup/plugin-replace": "^6.0.1",
|
|
38
|
+
"get-port": "^7.1.0",
|
|
39
|
+
"picocolors": "^1.1.1",
|
|
37
40
|
"tinyglobby": "^0.2.12",
|
|
38
41
|
"unenv": "2.0.0-rc.15",
|
|
39
42
|
"ws": "8.18.0",
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
+
"wrangler": "0.0.0-db300ef98",
|
|
44
|
+
"@cloudflare/unenv-preset": "0.0.0-db300ef98",
|
|
45
|
+
"miniflare": "0.0.0-db300ef98"
|
|
43
46
|
},
|
|
44
47
|
"devDependencies": {
|
|
45
|
-
"@cloudflare/workers-types": "^4.
|
|
48
|
+
"@cloudflare/workers-types": "^4.20250424.0",
|
|
46
49
|
"@types/node": "^22.10.1",
|
|
47
50
|
"@types/ws": "^8.5.13",
|
|
48
51
|
"magic-string": "^0.30.12",
|
|
@@ -51,10 +54,10 @@
|
|
|
51
54
|
"typescript": "^5.7.2",
|
|
52
55
|
"undici": "^5.28.5",
|
|
53
56
|
"vite": "^6.1.0",
|
|
54
|
-
"vitest": "~3.
|
|
57
|
+
"vitest": "~3.1.1",
|
|
55
58
|
"@cloudflare/mock-npm-registry": "0.0.0",
|
|
56
|
-
"@cloudflare/workers-
|
|
57
|
-
"@cloudflare/workers-
|
|
59
|
+
"@cloudflare/workers-shared": "0.0.0-db300ef98",
|
|
60
|
+
"@cloudflare/workers-tsconfig": "0.0.0"
|
|
58
61
|
},
|
|
59
62
|
"peerDependencies": {
|
|
60
63
|
"vite": "^6.1.0",
|