Skip to content

yusukebe/vite-plugin-wrangler-dev

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vite-plugin-wrangler-dev

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.

Demo

Screen.Recording.2023-07-24.at.16.34.59.mov

Status

WIP. It's not published yet.

Usage

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']
    })
  ]
})

Options

type WranglerDevOptions = {
  entry?: string
  client?: string
  assetDirectory?: string
  passThrough?: string[]
  wranglerDevOptions?: UnstableDevOptions
}

Authors

Yusuke Wada https://github.com/yusukebe

License

MIT

About

[WIP] Vite with Wrangler

Resources

Stars

Watchers

Forks