@cloudflare/vite-plugin 0.0.0-62d5471ea → 0.0.0-665ebd857
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 +61 -1
- package/dist/asset-workers/asset-worker.js +169 -153
- package/dist/index.d.ts +6 -1
- package/dist/index.js +5508 -370
- package/dist/runner-worker/index.js +22 -5
- package/package.json +8 -7
|
@@ -6,12 +6,21 @@ import {
|
|
|
6
6
|
} from "cloudflare:workers";
|
|
7
7
|
|
|
8
8
|
// src/constants.ts
|
|
9
|
-
var
|
|
9
|
+
var ADDITIONAL_MODULE_TYPES = [
|
|
10
|
+
"CompiledWasm",
|
|
11
|
+
"Data",
|
|
12
|
+
"Text"
|
|
13
|
+
];
|
|
10
14
|
|
|
11
15
|
// src/shared.ts
|
|
12
16
|
var UNKNOWN_HOST = "http://localhost";
|
|
13
17
|
var INIT_PATH = "/__vite_plugin_cloudflare_init__";
|
|
14
|
-
var
|
|
18
|
+
var ADDITIONAL_MODULE_PATTERN = `__CLOUDFLARE_MODULE__(${ADDITIONAL_MODULE_TYPES.join("|")})__(.*?)__`;
|
|
19
|
+
var additionalModuleRE = new RegExp(ADDITIONAL_MODULE_PATTERN);
|
|
20
|
+
var additionalModuleGlobalRE = new RegExp(
|
|
21
|
+
ADDITIONAL_MODULE_PATTERN,
|
|
22
|
+
"g"
|
|
23
|
+
);
|
|
15
24
|
var VITE_DEV_METADATA_HEADER = "__VITE_DEV_METADATA__";
|
|
16
25
|
|
|
17
26
|
// src/runner-worker/env.ts
|
|
@@ -20,7 +29,7 @@ function stripInternalEnv(internalEnv) {
|
|
|
20
29
|
return userEnv;
|
|
21
30
|
}
|
|
22
31
|
|
|
23
|
-
// ../../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
|
|
24
33
|
var VALID_ID_PREFIX = "/@id/";
|
|
25
34
|
var NULL_BYTE_PLACEHOLDER = "__x00__";
|
|
26
35
|
var SOURCEMAPPING_URL = "sourceMa";
|
|
@@ -1408,8 +1417,16 @@ async function createModuleRunner(env, webSocket, viteRoot) {
|
|
|
1408
1417
|
}
|
|
1409
1418
|
},
|
|
1410
1419
|
async runExternalModule(filepath) {
|
|
1411
|
-
|
|
1412
|
-
|
|
1420
|
+
if (filepath === "cloudflare:workers") {
|
|
1421
|
+
const originalCloudflareWorkersModule = await import("cloudflare:workers");
|
|
1422
|
+
return Object.seal({
|
|
1423
|
+
...originalCloudflareWorkersModule,
|
|
1424
|
+
env: stripInternalEnv(
|
|
1425
|
+
originalCloudflareWorkersModule.env
|
|
1426
|
+
)
|
|
1427
|
+
});
|
|
1428
|
+
}
|
|
1429
|
+
if (!additionalModuleRE.test(filepath) && filepath.includes("/node_modules") && !filepath.includes("/node_modules/.vite")) {
|
|
1413
1430
|
throw new Error(
|
|
1414
1431
|
`[Error] Trying to import non-prebundled module (only prebundled modules are allowed): ${filepath}
|
|
1415
1432
|
|
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-665ebd857",
|
|
4
4
|
"description": "Cloudflare plugin for Vite",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -34,15 +34,16 @@
|
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@hattip/adapter-node": "^0.0.49",
|
|
37
|
+
"picocolors": "^1.1.1",
|
|
37
38
|
"tinyglobby": "^0.2.12",
|
|
38
39
|
"unenv": "2.0.0-rc.15",
|
|
39
40
|
"ws": "8.18.0",
|
|
40
|
-
"@cloudflare/unenv-preset": "0.0.0-
|
|
41
|
-
"miniflare": "0.0.0-
|
|
42
|
-
"wrangler": "0.0.0-
|
|
41
|
+
"@cloudflare/unenv-preset": "0.0.0-665ebd857",
|
|
42
|
+
"miniflare": "0.0.0-665ebd857",
|
|
43
|
+
"wrangler": "0.0.0-665ebd857"
|
|
43
44
|
},
|
|
44
45
|
"devDependencies": {
|
|
45
|
-
"@cloudflare/workers-types": "^4.
|
|
46
|
+
"@cloudflare/workers-types": "^4.20250321.0",
|
|
46
47
|
"@types/node": "^22.10.1",
|
|
47
48
|
"@types/ws": "^8.5.13",
|
|
48
49
|
"magic-string": "^0.30.12",
|
|
@@ -53,8 +54,8 @@
|
|
|
53
54
|
"vite": "^6.1.0",
|
|
54
55
|
"vitest": "~3.0.8",
|
|
55
56
|
"@cloudflare/mock-npm-registry": "0.0.0",
|
|
56
|
-
"@cloudflare/workers-
|
|
57
|
-
"@cloudflare/workers-
|
|
57
|
+
"@cloudflare/workers-tsconfig": "0.0.0",
|
|
58
|
+
"@cloudflare/workers-shared": "0.0.0-665ebd857"
|
|
58
59
|
},
|
|
59
60
|
"peerDependencies": {
|
|
60
61
|
"vite": "^6.1.0",
|