github cloudflare/workers-sdk @cloudflare/vite-plugin@1.39.0

Minor Changes

  • #13985 c809d30 Thanks @jamesopstad! - Add assetsOnly (entry Worker) and devOnly (auxiliary Workers) options to the plugin config

    Both options accept a boolean or a function that returns a boolean. The function is evaluated lazily at build time, allowing frameworks to provide the value after initialization.

    Use assetsOnly on the entry Worker to skip building the Worker and instead emit an assets-only Wrangler config to the client output directory. This enables frameworks such as Astro to use the ssr environment during development but produce a fully static app for deployment.

    export default defineConfig({
      plugins: [
        cloudflare({
          assetsOnly: () => isStaticBuild,
        }),
      ],
    });

    Use devOnly on an auxiliary Worker to include it during vite dev but skip it at build time.

    export default defineConfig({
      plugins: [
        cloudflare({
          auxiliaryWorkers: [
            { configPath: "./dev-only-worker/wrangler.jsonc", devOnly: true },
          ],
        }),
      ],
    });

Patch Changes

Don't miss a new workers-sdk release

NewReleases is sending notifications on new releases.