@cloudflare/vite-plugin 2.0.0-beta.v.10 → 2.0.0-beta.v.11
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 +0 -34
- package/dist/index.d.mts +5 -3
- package/dist/index.mjs +11 -3
- package/dist/{package-DkG_FTc0.mjs → package-iBDedL58.mjs} +1 -1
- package/package.json +12 -12
package/README.md
CHANGED
|
@@ -18,40 +18,6 @@ export default defineConfig({
|
|
|
18
18
|
|
|
19
19
|
Full documentation can be found [here](https://developers.cloudflare.com/workers/vite-plugin/).
|
|
20
20
|
|
|
21
|
-
## Programmatic configuration
|
|
22
|
-
|
|
23
|
-
The `config` option accepts a customizer with the signature
|
|
24
|
-
`(loadedConfig: ParsedInputConfigWithWorker) => ParsedInputConfigWithWorker`. It receives the parsed
|
|
25
|
-
`cloudflare.config.ts` configuration, or a default Worker configuration when no
|
|
26
|
-
file exists, and can customize account settings, Containers, and the entry Worker.
|
|
27
|
-
The loaded and returned configurations must include a Worker, even for assets-only projects.
|
|
28
|
-
|
|
29
|
-
Return a new configuration object, spreading any existing fields you want to
|
|
30
|
-
preserve. Nested objects and arrays are replaced rather than merged:
|
|
31
|
-
|
|
32
|
-
```ts
|
|
33
|
-
import { cloudflare } from "@cloudflare/vite-plugin";
|
|
34
|
-
|
|
35
|
-
cloudflare({
|
|
36
|
-
config(loadedConfig) {
|
|
37
|
-
return {
|
|
38
|
-
...loadedConfig,
|
|
39
|
-
worker: {
|
|
40
|
-
...loadedConfig.worker,
|
|
41
|
-
env: {
|
|
42
|
-
...loadedConfig.worker.env,
|
|
43
|
-
FRAMEWORK_NAME: { type: "text", value: "my-framework" },
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
},
|
|
48
|
-
});
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
The customized configuration is recorded in the build output. Preview and
|
|
52
|
-
deployment from that output use the recorded configuration. Generated types
|
|
53
|
-
continue to describe `cloudflare.config.ts`.
|
|
54
|
-
|
|
55
21
|
## Features
|
|
56
22
|
|
|
57
23
|
- Uses the Vite [Environment API](https://vite.dev/guide/api-environment) to integrate Vite with the Workers runtime
|
package/dist/index.d.mts
CHANGED
|
@@ -5,9 +5,11 @@ import { CompatDate } from "@cloudflare/workers-utils";
|
|
|
5
5
|
//#region src/plugin-config.d.ts
|
|
6
6
|
|
|
7
7
|
/** Parsed configuration with the entry Worker required by the Vite plugin. */
|
|
8
|
-
type
|
|
8
|
+
type CloudflareConfig = Omit<ParsedInputConfig, "worker"> & {
|
|
9
9
|
worker: ParsedInputWorkerConfig;
|
|
10
10
|
};
|
|
11
|
+
/** @deprecated Use `CloudflareConfig` instead. */
|
|
12
|
+
type ParsedInputConfigWithWorker = CloudflareConfig;
|
|
11
13
|
type PersistState = boolean | {
|
|
12
14
|
path: string;
|
|
13
15
|
};
|
|
@@ -77,7 +79,7 @@ interface PluginConfig extends EntryWorkerOptions {
|
|
|
77
79
|
* Return a new configuration object including an entry Worker, copying any settings to preserve.
|
|
78
80
|
* Preview uses the configuration recorded in the build output.
|
|
79
81
|
*/
|
|
80
|
-
config?: (loadedConfig:
|
|
82
|
+
config?: (loadedConfig: CloudflareConfig) => CloudflareConfig;
|
|
81
83
|
auxiliaryWorkers?: AuxiliaryWorkerOptions[];
|
|
82
84
|
/** Configuration for a dedicated prerender Worker. */
|
|
83
85
|
prerenderWorker?: PrerenderWorkerOptions;
|
|
@@ -120,4 +122,4 @@ declare function getLocalWorkerdCompatibilityDate(_options?: {
|
|
|
120
122
|
*/
|
|
121
123
|
declare function cloudflare(pluginConfig?: PluginConfig): vite.Plugin[];
|
|
122
124
|
//#endregion
|
|
123
|
-
export { type ParsedInputConfigWithWorker, type PluginConfig, type WorkerConfig, cloudflare, getLocalWorkerdCompatibilityDate };
|
|
125
|
+
export { type CloudflareConfig, type ParsedInputConfigWithWorker, type PluginConfig, type WorkerConfig, cloudflare, getLocalWorkerdCompatibilityDate };
|
package/dist/index.mjs
CHANGED
|
@@ -50708,7 +50708,7 @@ function mapWorkerMetadataBindings(bindings) {
|
|
|
50708
50708
|
}, {});
|
|
50709
50709
|
}
|
|
50710
50710
|
__name$3(mapWorkerMetadataBindings, "mapWorkerMetadataBindings");
|
|
50711
|
-
var DEFAULT_COMPAT_DATE = "2026-11-
|
|
50711
|
+
var DEFAULT_COMPAT_DATE = "2026-11-03";
|
|
50712
50712
|
function constructWranglerConfig(config$3) {
|
|
50713
50713
|
const mappedBindings = mapWorkerMetadataBindings(config$3.bindings);
|
|
50714
50714
|
const durableObjectClassNames = config$3.bindings.filter((binding) => binding.type === "durable_object_namespace" && binding.script_name === config$3.name).map((durableObject) => durableObject.class_name);
|
|
@@ -77270,10 +77270,11 @@ function isDockerfileContainerConfig(container) {
|
|
|
77270
77270
|
}
|
|
77271
77271
|
__name$2(isDockerfileContainerConfig, "isDockerfileContainerConfig");
|
|
77272
77272
|
async function constructBuildCommand(options) {
|
|
77273
|
+
const imageOutput = process.env.WRANGLER_CONTAINER_IMAGE_COMPRESSION === "zstd" ? "type=docker,oci-mediatypes=true,compression=zstd,compression-level=3,force-compression=true" : void 0;
|
|
77273
77274
|
const platform$1 = options.platform ?? "linux/amd64";
|
|
77274
77275
|
const buildCmd = [
|
|
77275
77276
|
"build",
|
|
77276
|
-
"--load",
|
|
77277
|
+
...imageOutput ? ["--output", imageOutput] : ["--load"],
|
|
77277
77278
|
"-t",
|
|
77278
77279
|
options.tag,
|
|
77279
77280
|
"--platform",
|
|
@@ -77293,6 +77294,13 @@ async function constructBuildCommand(options) {
|
|
|
77293
77294
|
}
|
|
77294
77295
|
__name$2(constructBuildCommand, "constructBuildCommand");
|
|
77295
77296
|
async function startContainerBuild({ build, pathToDocker, verifyDockerIsRunning }) {
|
|
77297
|
+
if (process.env.WRANGLER_CONTAINER_IMAGE_COMPRESSION === "zstd") {
|
|
77298
|
+
if (!runDockerCmdWithOutput(pathToDocker, [
|
|
77299
|
+
"info",
|
|
77300
|
+
"--format",
|
|
77301
|
+
"{{json .DriverStatus}}"
|
|
77302
|
+
]).includes("io.containerd.snapshotter.v1")) throw new UserError("Zstd compression requires Docker's containerd image store. Enable the containerd image store or unset WRANGLER_CONTAINER_IMAGE_COMPRESSION.", { telemetryMessage: false });
|
|
77303
|
+
}
|
|
77296
77304
|
const { buildCmd, dockerfile } = await constructBuildCommand(build);
|
|
77297
77305
|
return await dockerBuild(pathToDocker, {
|
|
77298
77306
|
buildCmd,
|
|
@@ -89390,7 +89398,7 @@ __name(createWorkerUploadForm, "createWorkerUploadForm");
|
|
|
89390
89398
|
//#endregion
|
|
89391
89399
|
//#region ../remote-bindings/dist/index.mjs
|
|
89392
89400
|
var import_undici = require_undici();
|
|
89393
|
-
var version$1 = "0.0.
|
|
89401
|
+
var version$1 = "0.0.59";
|
|
89394
89402
|
var NoDefaultValueProvided = class extends UserError {
|
|
89395
89403
|
constructor() {
|
|
89396
89404
|
super("This command cannot be run in a non-interactive context", { telemetryMessage: "remote bindings prompt default missing" });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudflare/vite-plugin",
|
|
3
|
-
"version": "2.0.0-beta.v.
|
|
3
|
+
"version": "2.0.0-beta.v.11",
|
|
4
4
|
"description": "Cloudflare plugin for Vite",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -42,14 +42,14 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"unenv": "2.0.0-rc.24",
|
|
44
44
|
"ws": "8.21.0",
|
|
45
|
-
"@cloudflare/
|
|
46
|
-
"@cloudflare/
|
|
47
|
-
"
|
|
45
|
+
"@cloudflare/config": "0.30.1",
|
|
46
|
+
"@cloudflare/runtime-types": "0.1.22",
|
|
47
|
+
"miniflare": "5.20261103.0-beta",
|
|
48
48
|
"@cloudflare/unenv-preset": "2.16.2",
|
|
49
|
-
"
|
|
49
|
+
"@cloudflare/build-output-utils": "0.9.9"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@cloudflare/workers-types": "^5.
|
|
52
|
+
"@cloudflare/workers-types": "^5.20261103.1",
|
|
53
53
|
"@remix-run/node-fetch-server": "^1.0.0",
|
|
54
54
|
"@types/node": "22.15.17",
|
|
55
55
|
"@types/semver": "^7.5.1",
|
|
@@ -69,14 +69,14 @@
|
|
|
69
69
|
"vite": "8.3.4",
|
|
70
70
|
"vite-legacy": "npm:vite@7.1.12",
|
|
71
71
|
"vitest": "5.0.4",
|
|
72
|
-
"@cloudflare/cli-shared-helpers": "0.3.
|
|
73
|
-
"@cloudflare/containers-shared": "0.23.
|
|
74
|
-
"@cloudflare/remote-bindings": "0.0.58",
|
|
72
|
+
"@cloudflare/cli-shared-helpers": "0.3.3",
|
|
73
|
+
"@cloudflare/containers-shared": "0.23.8",
|
|
75
74
|
"@cloudflare/mock-npm-registry": "0.0.0",
|
|
75
|
+
"@cloudflare/remote-bindings": "0.0.59",
|
|
76
|
+
"@cloudflare/workers-auth": "0.15.6",
|
|
76
77
|
"@cloudflare/workers-shared": "0.20.2",
|
|
77
|
-
"@cloudflare/workers-
|
|
78
|
-
"@cloudflare/workers-
|
|
79
|
-
"@cloudflare/workers-utils": "0.51.0"
|
|
78
|
+
"@cloudflare/workers-utils": "0.51.1",
|
|
79
|
+
"@cloudflare/workers-tsconfig": "0.0.0"
|
|
80
80
|
},
|
|
81
81
|
"peerDependencies": {
|
|
82
82
|
"vite": "^7.0.0 || ^8.0.0"
|