honojs / vite-plugins

Vite Plugins for Hono
https://hono.dev
135 stars 35 forks source link

WIP: initial commit for wrangler support #26

Open Code-Hex opened 1 year ago

Code-Hex commented 1 year ago

Relate: https://github.com/honojs/vite-plugins/issues/25

Now, we can use wrangler.toml and use local storage under .wrangler/state/v3

import { defineConfig } from 'vite';
import devServer from '@hono/vite-dev-server'

export default defineConfig(({ mode }) => {
  return {
    plugins: [
      devServer({
        entry: 'src/worker.ts',
        wranglerTomlPath: 'wrangler.toml',
      }),
    ],
    esbuild: {
      target: 'es2021',
    },
  };
});
yusukebe commented 1 year ago

Hi @Code-Hex,

I'm currently refactoring the dev-server code. This won't involve any breaking changes, but there will be significant changes to the code base. I'll create a PR soon, but you should hold off on any further developments until then.

Code-Hex commented 1 year ago

@yusukebe OK! Thanks.

yusukebe commented 1 year ago

Hi @Code-Hex,

I've refactored and added the ENV / env feature in PR #30, and have bumped to a new version.

So, now you can go ahead with your PR!