A lightweight Harper application integration that mounts a Vite dev server in middleware mode and forwards HTTP requests to it.
This allows Vite-powered frontends or components to be served directly inside a Harper application during development.
This plugin:
- Creates a Vite dev server scoped to a Harper application directory
- Runs Vite in middleware mode
- Forwards incoming Harper HTTP requests to Vite's Connect middleware
- Enables seamless local development of Vite apps inside Harper
This is intended for development workflows, not production builds.
- Harper loads your application and calls
handleApplication - A Vite dev server is created with:
rootset to the application directoryvite.config.jsloaded from that directorymiddlewareMode: true
- Incoming HTTP requests are forwarded to Vite's middleware stack
Install the plugin in your Harper application:
npm install @harperfast/vite-plugin --save-devThen, in your Harper applications config.yaml paste the plugin:
'@harperfast/vite-plugin':
package: '@harperfast/vite-plugin'Next, open package.json and change the "dev" script to:
"dev": "harper run .",
Your application will now run on http://localhost:9926.
- TypeScript for static typing
- ESLint for linting
- Prettier for code formatting
- Vite for the development server and middleware