Releases: rphlmr/react-router-hono-server
Releases · rphlmr/react-router-hono-server
v0.4.0
v0.3.0
v0.2.0
v0.1.0
v0.0.4
v0.0.3
v0.0.2
Full Changelog: v0.0.1...v0.0.2
v0.0.1
Hey 👋 this is the initial release.
Installation
Install the following npm package. NOTE: This is not a dev dependency, as it
creates the Hono server used in production.
npm install hono remix-hono react-router-hono-server
Configuration
Create the server
From your entry.server.tsx file, export the server from createHonoServer
and
name it server
or the name you defined in devServer({exportName})
in your vite.config.ts.
// app/entry.server.tsx
import { createHonoServer } from "react-router-hono-server/node";
export const server = await createHonoServer();
Add the Vite plugin
// vite.config.ts
import { vitePlugin as remix } from "@remix-run/dev";
import { installGlobals } from "@remix-run/node";
import { devServer } from "react-router-hono-server/dev";
import { defineConfig } from "vite";
import tsconfigPaths from "vite-tsconfig-paths";
installGlobals();
export default defineConfig({
build: {
target: "esnext",
},
plugins: [devServer(), remix(), tsconfigPaths()],
});
Update package.json scripts
"scripts": {
"build": "NODE_ENV=production remix vite:build",
"dev": "vite --host",
"start": "NODE_ENV=production node ./build/server/index.js"
},