@vavite/expose-vite-dev-server
TypeScript icon, indicating that this package has built-in type declarations

5.0.1 • Public • Published

@vavite/expose-vite-dev-server

@vavite/expose-vite-dev-server is a Vite plugin for exposing the Vite development server to user code during development. It can be used for accessing Vite development server methods such as ssrFixStacktrace and transformIndexHtml in vavite, @vavite/connect, and @vavite/reloader applications.

Installation and usage

Install vite and @vavite/expose-vite-dev-server as development dependencies (npm install --save-dev vite @vavite/expose-vite-dev-server) and add @vavite/expose-vite-dev-server plugin to your Vite config:

import { defineConfig } from "vite";
import exposeViteDevServer from "@vavite/expose-vite-dev-server";

export default defineConfig({
  plugins: [exposeViteDevServer()],
});

Now you can import the dev server in your application with import viteDevServer from @vavite/expose-vite-dev-server/vite-dev-server during development. In production, it will be available but its value will be undefined.

Readme

Keywords

none

Package Sidebar

Install

npm i @vavite/expose-vite-dev-server

Weekly Downloads

2,621

Version

5.0.1

License

MIT

Unpacked Size

4.18 kB

Total Files

6

Last publish

Collaborators

  • cyco130