Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[@hono/vite-dev-server] Allow setting port for dev server #21

Open
gkiely opened this issue Nov 6, 2023 · 1 comment
Open

[@hono/vite-dev-server] Allow setting port for dev server #21

gkiely opened this issue Nov 6, 2023 · 1 comment

Comments

@gkiely
Copy link

gkiely commented Nov 6, 2023

It is useful to be able to to set the server port to a different port to the vite server.
Currently passing port to the cf object doesn't work.

@gkiely
Copy link
Author

gkiely commented Nov 6, 2023

The workaround is to use a separate vite server config file and use concurrently to run 2 vite processes, but it would be nice if this was not needed.

concurrently -r -g 'vite --config vite.server.config.ts' 'vite'
// Client config
import { defineConfig } from 'vite';
export default defineConfig({
  // ...
});

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

export default defineConfig({
  plugins: [
    devServer({
      entry: 'server/server.ts',
    }),
  ],
  server: {
    port: 8080,
  },
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant