vite-plugin-wrangler-dev is a Vite Plugin designed for the development of Cloudflare Workers or Cloudflare Pages. It allows the "wrangler dev server" to run inside of Vite, makes the use of Workers Bindings possible for Vite-based web frameworks.
WIP. It's not published yet.
import { defineConfig } from 'vite'
import vitePluginWranglerDev from '../src'
export default defineConfig({
plugins: [
vitePluginWranglerDev({
entry: '/src/_worker.ts',
client: '/src/client.ts',
passThrough: ['/js/client.js']
})
]
})
type WranglerDevOptions = {
entry?: string
client?: string
assetDirectory?: string
passThrough?: string[]
wranglerDevOptions?: UnstableDevOptions
}
Yusuke Wada https://github.com/yusukebe
MIT