@cloudflare/vite-plugin 0.0.0-9adbd50cf → 0.0.0-9b469e213
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 +534 -498
- package/dist/index.d.ts +6 -1
- package/dist/index.js +5655 -396
- package/dist/runner-worker/index.js +20 -17
- package/package.json +10 -8
|
@@ -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";
|
|
@@ -1385,13 +1394,6 @@ async function createModuleRunner(env, webSocket, viteRoot) {
|
|
|
1385
1394
|
},
|
|
1386
1395
|
{
|
|
1387
1396
|
async runInlinedModule(context, transformed, module) {
|
|
1388
|
-
if (module.file.includes("/node_modules") && !module.file.includes("/node_modules/.vite")) {
|
|
1389
|
-
throw new Error(
|
|
1390
|
-
`[Error] Trying to import non-prebundled module (only prebundled modules are allowed): ${module.id}
|
|
1391
|
-
|
|
1392
|
-
(have you excluded the module via \`optimizeDeps.exclude\`?)`
|
|
1393
|
-
);
|
|
1394
|
-
}
|
|
1395
1397
|
const codeDefinition = `'use strict';async (${Object.keys(context).join(
|
|
1396
1398
|
","
|
|
1397
1399
|
)})=>{{`;
|
|
@@ -1408,13 +1410,14 @@ async function createModuleRunner(env, webSocket, viteRoot) {
|
|
|
1408
1410
|
}
|
|
1409
1411
|
},
|
|
1410
1412
|
async runExternalModule(filepath) {
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
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
|
+
});
|
|
1418
1421
|
}
|
|
1419
1422
|
filepath = filepath.replace(/^file:\/\//, "");
|
|
1420
1423
|
return import(filepath);
|
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-9b469e213",
|
|
4
4
|
"description": "Cloudflare plugin for Vite",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -33,16 +33,18 @@
|
|
|
33
33
|
"dist"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@cloudflare/unenv-preset": "1.1.1",
|
|
37
36
|
"@hattip/adapter-node": "^0.0.49",
|
|
37
|
+
"get-port": "^7.1.0",
|
|
38
|
+
"picocolors": "^1.1.1",
|
|
38
39
|
"tinyglobby": "^0.2.12",
|
|
39
|
-
"unenv": "2.0.0-rc.
|
|
40
|
+
"unenv": "2.0.0-rc.15",
|
|
40
41
|
"ws": "8.18.0",
|
|
41
|
-
"
|
|
42
|
-
"
|
|
42
|
+
"@cloudflare/unenv-preset": "0.0.0-9b469e213",
|
|
43
|
+
"miniflare": "0.0.0-9b469e213",
|
|
44
|
+
"wrangler": "0.0.0-9b469e213"
|
|
43
45
|
},
|
|
44
46
|
"devDependencies": {
|
|
45
|
-
"@cloudflare/workers-types": "^4.
|
|
47
|
+
"@cloudflare/workers-types": "^4.20250321.0",
|
|
46
48
|
"@types/node": "^22.10.1",
|
|
47
49
|
"@types/ws": "^8.5.13",
|
|
48
50
|
"magic-string": "^0.30.12",
|
|
@@ -51,10 +53,10 @@
|
|
|
51
53
|
"typescript": "^5.7.2",
|
|
52
54
|
"undici": "^5.28.5",
|
|
53
55
|
"vite": "^6.1.0",
|
|
54
|
-
"vitest": "~3.0.
|
|
56
|
+
"vitest": "~3.0.8",
|
|
55
57
|
"@cloudflare/mock-npm-registry": "0.0.0",
|
|
56
58
|
"@cloudflare/workers-tsconfig": "0.0.0",
|
|
57
|
-
"@cloudflare/workers-shared": "0.0.0-
|
|
59
|
+
"@cloudflare/workers-shared": "0.0.0-9b469e213"
|
|
58
60
|
},
|
|
59
61
|
"peerDependencies": {
|
|
60
62
|
"vite": "^6.1.0",
|