vite-plugin-feathersjs
v1.4.0
Published
A vite plugin to run Feathers and other Node servers.
Downloads
27
Maintainers
Readme
Vite Plugin Feathersjs
Requirements
- Your Feathers app needs to be created, setup and returned in a function called main
Example usage:
// vite.config.ts
// https://vitejs.dev/config/
import { defineConfig } from 'vite'
import { feathers } from 'vite-plugin-feathersjs'
// https://vitejs.dev/config/#async-config
export default defineConfig(async () => {
return {
plugins: [feathers({ app: 'src/app.ts', port: 3030 })]
}
})Important notes
Your feathers server will run on another port... make sure to configure socket.io with cors
- ie:
socketio({ cors: { origin: '*' } })
- ie:
To make things easier, an Environment Variable named VITE_FV_URL is defined in development.
- In client apps
const url = import.meta.env.VITE_FV_URL
- In client apps
This plugin will not run with the build command.
