0.3.1 • Published 8 months ago

wds-use-vite v0.3.1

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

Vite Middleware for Web Dev Server

A middleware for Web Dev Server (WDS) and Web Test Runner (WTR) that allows requests to be transformed and served using Vite. Rather than starting Vite's dev server alongside WDS/WTR and proxying requests to it, this will install Vite as a middleware component inside the WDS/WTR request pipeline.

Installation

npm install --save-dev wds-use-vite

Configuration

This package exports two functions

  • addVite Creates a WDS/WTR plugin that is responsible for starting Vite in middleware mode when WDS/WTR starts.
  • useVite Defines a WDS/WTR middleware function that inspects the current request and determines if it should allow the Vite middleware to process it or not.

You must configure both in order for the Vite middleware to work as intended. To do so, modify your WDS/WTR config as follows:

import { addVite, useVite } from 'wds-use-vite';

export default {
  plugins: [addVite()],
  middleware: [useVite()],
  // ... rest of config here ...
};
0.3.0

8 months ago

0.2.1

9 months ago

0.2.0

9 months ago

0.3.1

8 months ago

0.1.0

1 year ago