🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

feathers-vite

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

feathers-vite

A vite plugin to run Feathers and other Node servers.

1.2.7
latest
Source
npm
Version published
Weekly downloads
12
-40%
Maintainers
1
Weekly downloads
 
Created
Source

Feathers Vite Plugin

Try it Online

  • StackBlitz CodeFlow
  • StackBlitz Classic

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 'feathers-vite'

// https://vitejs.dev/config/#async-config
export default defineConfig(async () => {
  return {
    plugins: [feathers({ app: 'src/app.ts', port: 8099 })]
  }
})

Important notes

  • Your feathers server will run on another port... make sure to configure socket.io with cors
    • ie: socketio({ cors: { origin: '*' } })
  • 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
  • We listen to the an env var named VITE_FV_SSG, if it is set to "off" the plugin won't run.
  • This plugin will not run with the build command.

Keywords

feathersjs

FAQs

Package last updated on 26 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts