@cloudflare/vite-plugin 1.21.0 → 1.21.1
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
//#region package.json
|
|
2
2
|
var package_default = {
|
|
3
3
|
name: "@cloudflare/vite-plugin",
|
|
4
|
-
version: "1.21.
|
|
4
|
+
version: "1.21.1",
|
|
5
5
|
description: "Cloudflare plugin for Vite",
|
|
6
6
|
keywords: [
|
|
7
7
|
"cloudflare",
|
|
@@ -78,4 +78,4 @@ var package_default = {
|
|
|
78
78
|
|
|
79
79
|
//#endregion
|
|
80
80
|
export { package_default as default };
|
|
81
|
-
//# sourceMappingURL=package-
|
|
81
|
+
//# sourceMappingURL=package-BLWYKDcZ.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-
|
|
1
|
+
{"version":3,"file":"package-BLWYKDcZ.mjs","names":[],"sources":["../package.json"],"sourcesContent":["{\n\t\"name\": \"@cloudflare/vite-plugin\",\n\t\"version\": \"1.21.1\",\n\t\"description\": \"Cloudflare plugin for Vite\",\n\t\"keywords\": [\n\t\t\"cloudflare\",\n\t\t\"workers\",\n\t\t\"cloudflare-workers\",\n\t\t\"vite\",\n\t\t\"vite-plugin\"\n\t],\n\t\"homepage\": \"https://github.com/cloudflare/workers-sdk/tree/main/packages/vite-plugin-cloudflare#readme\",\n\t\"bugs\": {\n\t\t\"url\": \"https://github.com/cloudflare/workers-sdk/issues\"\n\t},\n\t\"repository\": {\n\t\t\"type\": \"git\",\n\t\t\"url\": \"https://github.com/cloudflare/workers-sdk.git\",\n\t\t\"directory\": \"packages/vite-plugin-cloudflare\"\n\t},\n\t\"license\": \"MIT\",\n\t\"sideEffects\": false,\n\t\"type\": \"module\",\n\t\"exports\": {\n\t\t\".\": {\n\t\t\t\"types\": \"./dist/index.d.mts\",\n\t\t\t\"import\": \"./dist/index.mjs\"\n\t\t}\n\t},\n\t\"main\": \"./dist/index.mjs\",\n\t\"types\": \"./dist/index.d.mts\",\n\t\"files\": [\n\t\t\"dist\"\n\t],\n\t\"scripts\": {\n\t\t\"build\": \"tsdown\",\n\t\t\"check:lint\": \"eslint . --max-warnings=0\",\n\t\t\"check:type\": \"tsc --build\",\n\t\t\"dev\": \"tsdown --watch\",\n\t\t\"test\": \"vitest run\",\n\t\t\"test:ci\": \"pnpm test\",\n\t\t\"test:e2e\": \"vitest run -c e2e/vitest.config.ts\",\n\t\t\"test:watch\": \"vitest\"\n\t},\n\t\"dependencies\": {\n\t\t\"@cloudflare/unenv-preset\": \"workspace:*\",\n\t\t\"miniflare\": \"workspace:*\",\n\t\t\"unenv\": \"2.0.0-rc.24\",\n\t\t\"wrangler\": \"workspace:*\",\n\t\t\"ws\": \"catalog:default\"\n\t},\n\t\"devDependencies\": {\n\t\t\"@cloudflare/containers-shared\": \"workspace:*\",\n\t\t\"@cloudflare/mock-npm-registry\": \"workspace:*\",\n\t\t\"@cloudflare/workers-shared\": \"workspace:*\",\n\t\t\"@cloudflare/workers-tsconfig\": \"workspace:*\",\n\t\t\"@cloudflare/workers-types\": \"catalog:default\",\n\t\t\"@cloudflare/workers-utils\": \"workspace:*\",\n\t\t\"@remix-run/node-fetch-server\": \"^0.8.0\",\n\t\t\"@types/node\": \"catalog:vite-plugin\",\n\t\t\"@types/semver\": \"^7.5.1\",\n\t\t\"@types/ws\": \"^8.5.13\",\n\t\t\"defu\": \"^6.1.4\",\n\t\t\"get-port\": \"^7.1.0\",\n\t\t\"magic-string\": \"^0.30.12\",\n\t\t\"mlly\": \"^1.7.4\",\n\t\t\"picocolors\": \"^1.1.1\",\n\t\t\"semver\": \"^7.7.1\",\n\t\t\"tinyglobby\": \"^0.2.12\",\n\t\t\"tree-kill\": \"^1.2.2\",\n\t\t\"tsdown\": \"0.16.3\",\n\t\t\"typescript\": \"catalog:default\",\n\t\t\"vite\": \"catalog:vite-plugin\",\n\t\t\"vitest\": \"catalog:default\"\n\t},\n\t\"peerDependencies\": {\n\t\t\"vite\": \"^6.1.0 || ^7.0.0\",\n\t\t\"wrangler\": \"workspace:^\"\n\t},\n\t\"publishConfig\": {\n\t\t\"access\": \"public\"\n\t},\n\t\"workers-sdk\": {\n\t\t\"prerelease\": true\n\t}\n}\n"],"mappings":";sBAAA;OACS;UACG;cACI;WACH;EACX;EACA;EACA;EACA;EACA;EACA;WACW;OACJ,EACP,OAAO,oDACP;aACa;EACb,QAAQ;EACR,OAAO;EACP,aAAa;EACb;UACU;cACI;OACP;UACG,EACV,KAAK;EACJ,SAAS;EACT,UAAU;EACV,EACD;OACO;QACC;QACA,CACR,OACA;UACU;EACV,SAAS;EACT,cAAc;EACd,cAAc;EACd,OAAO;EACP,QAAQ;EACR,WAAW;EACX,YAAY;EACZ,cAAc;EACd;eACe;EACf,4BAA4B;EAC5B,aAAa;EACb,SAAS;EACT,YAAY;EACZ,MAAM;EACN;kBACkB;EAClB,iCAAiC;EACjC,iCAAiC;EACjC,8BAA8B;EAC9B,gCAAgC;EAChC,6BAA6B;EAC7B,6BAA6B;EAC7B,gCAAgC;EAChC,eAAe;EACf,iBAAiB;EACjB,aAAa;EACb,QAAQ;EACR,YAAY;EACZ,gBAAgB;EAChB,QAAQ;EACR,cAAc;EACd,UAAU;EACV,cAAc;EACd,aAAa;EACb,UAAU;EACV,cAAc;EACd,QAAQ;EACR,UAAU;EACV;mBACmB;EACnB,QAAQ;EACR,YAAY;EACZ;gBACgB,EAChB,UAAU,UACV;CACD,eAAe,EACd,cAAc,MACd;CACD"}
|
|
@@ -1218,10 +1218,10 @@ var __VITE_RUNNER_OBJECT__ = class extends DurableObject {
|
|
|
1218
1218
|
*/
|
|
1219
1219
|
async fetch(request) {
|
|
1220
1220
|
const { pathname } = new URL(request.url);
|
|
1221
|
-
if (pathname !== INIT_PATH) throw new Error(`__VITE_RUNNER_OBJECT__ received invalid pathname: ${pathname}`);
|
|
1221
|
+
if (pathname !== INIT_PATH) throw new Error(`__VITE_RUNNER_OBJECT__ received invalid pathname: "${pathname}"`);
|
|
1222
1222
|
const environmentName = request.headers.get(ENVIRONMENT_NAME_HEADER);
|
|
1223
|
-
if (!environmentName) throw new Error(`__VITE_RUNNER_OBJECT__ received request without ${ENVIRONMENT_NAME_HEADER} header`);
|
|
1224
|
-
if (moduleRunners.has(environmentName)) throw new Error(`Module runner already initialized for environment: ${environmentName}`);
|
|
1223
|
+
if (!environmentName) throw new Error(`__VITE_RUNNER_OBJECT__ received request without "${ENVIRONMENT_NAME_HEADER}" header`);
|
|
1224
|
+
if (moduleRunners.has(environmentName)) throw new Error(`Module runner already initialized for environment: "${environmentName}"`);
|
|
1225
1225
|
if (request.headers.get(IS_PARENT_ENVIRONMENT_HEADER) === "true") parentEnvironmentName = environmentName;
|
|
1226
1226
|
const { 0: client, 1: server } = new WebSocketPair();
|
|
1227
1227
|
server.accept();
|
|
@@ -1245,7 +1245,7 @@ var __VITE_RUNNER_OBJECT__ = class extends DurableObject {
|
|
|
1245
1245
|
*/
|
|
1246
1246
|
send(environmentName, data) {
|
|
1247
1247
|
const environmentState = this.#environments.get(environmentName);
|
|
1248
|
-
if (!environmentState) throw new Error(`Module runner WebSocket not initialized for environment: ${environmentName}`);
|
|
1248
|
+
if (!environmentState) throw new Error(`Module runner WebSocket not initialized for environment: "${environmentName}"`);
|
|
1249
1249
|
environmentState.webSocket.send(data);
|
|
1250
1250
|
}
|
|
1251
1251
|
/**
|
|
@@ -1258,9 +1258,9 @@ var __VITE_RUNNER_OBJECT__ = class extends DurableObject {
|
|
|
1258
1258
|
*/
|
|
1259
1259
|
async getFetchedModuleId(environmentName, url, importer) {
|
|
1260
1260
|
const moduleRunner = moduleRunners.get(environmentName);
|
|
1261
|
-
if (!moduleRunner) throw new Error(`Module runner not initialized for environment: ${environmentName}`);
|
|
1261
|
+
if (!moduleRunner) throw new Error(`Module runner not initialized for environment: "${environmentName}"`);
|
|
1262
1262
|
const environmentState = this.#environments.get(environmentName);
|
|
1263
|
-
if (!environmentState) throw new Error(`Environment state not found for environment: ${environmentName}`);
|
|
1263
|
+
if (!environmentState) throw new Error(`Environment state not found for environment: "${environmentName}"`);
|
|
1264
1264
|
let cached = environmentState.concurrentModuleNodePromises.get(url);
|
|
1265
1265
|
if (!cached) {
|
|
1266
1266
|
const cachedModule = moduleRunner.evaluatedModules.getModuleByUrl(url);
|
|
@@ -1358,7 +1358,7 @@ async function getWorkerEntryExportTypes() {
|
|
|
1358
1358
|
*/
|
|
1359
1359
|
async function importFromEnvironment(environmentName, id) {
|
|
1360
1360
|
const moduleRunner = moduleRunners.get(environmentName);
|
|
1361
|
-
if (!moduleRunner) throw new Error(`Module runner not initialized for environment: ${environmentName}
|
|
1361
|
+
if (!moduleRunner) throw new Error(`Module runner not initialized for environment: "${environmentName}". Do you need to set \`childEnvironments: ["${environmentName}"]\` in the plugin config?`);
|
|
1362
1362
|
return moduleRunner.import(id);
|
|
1363
1363
|
}
|
|
1364
1364
|
globalThis.__VITE_ENVIRONMENT_RUNNER_IMPORT__ = importFromEnvironment;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudflare/vite-plugin",
|
|
3
|
-
"version": "1.21.
|
|
3
|
+
"version": "1.21.1",
|
|
4
4
|
"description": "Cloudflare plugin for Vite",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
"unenv": "2.0.0-rc.24",
|
|
37
37
|
"ws": "8.18.0",
|
|
38
38
|
"@cloudflare/unenv-preset": "2.10.0",
|
|
39
|
-
"miniflare": "4.
|
|
40
|
-
"wrangler": "4.59.
|
|
39
|
+
"miniflare": "4.20260116.0",
|
|
40
|
+
"wrangler": "4.59.3"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@cloudflare/workers-types": "^4.
|
|
43
|
+
"@cloudflare/workers-types": "^4.20260116.0",
|
|
44
44
|
"@remix-run/node-fetch-server": "^0.8.0",
|
|
45
45
|
"@types/node": "^22.10.1",
|
|
46
46
|
"@types/semver": "^7.5.1",
|
|
@@ -57,15 +57,15 @@
|
|
|
57
57
|
"typescript": "~5.8.3",
|
|
58
58
|
"vite": "7.1.12",
|
|
59
59
|
"vitest": "~3.2.0",
|
|
60
|
+
"@cloudflare/containers-shared": "0.8.0",
|
|
60
61
|
"@cloudflare/mock-npm-registry": "0.0.0",
|
|
61
62
|
"@cloudflare/workers-shared": "0.18.9",
|
|
62
63
|
"@cloudflare/workers-tsconfig": "0.0.0",
|
|
63
|
-
"@cloudflare/workers-utils": "0.7.
|
|
64
|
-
"@cloudflare/containers-shared": "0.8.0"
|
|
64
|
+
"@cloudflare/workers-utils": "0.7.1"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
67
|
"vite": "^6.1.0 || ^7.0.0",
|
|
68
|
-
"wrangler": "^4.59.
|
|
68
|
+
"wrangler": "^4.59.3"
|
|
69
69
|
},
|
|
70
70
|
"publishConfig": {
|
|
71
71
|
"access": "public"
|