Skip to content

Latest commit

 

History

History
42 lines (31 loc) · 837 Bytes

README.md

File metadata and controls

42 lines (31 loc) · 837 Bytes

vite-plugin-sw-ts-hmr

npm

Vite plugin for transpiling multiple ServiceWorkers written in TypeScript with HMR.

You can use this for any arbitrary TypeScript files, just provide an input and output, and it will transpile with HMR.

Installation

yarn add vite-plugin-sw-ts-hmr --dev

or

npm install vite-plugin-sw-ts-hmr --save-dev

Usage

import TsServiceWorkers from 'vite-plugin-sw-ts-hmr'

export default {
  plugins: [
    TsServiceWorkers([
      {
        inputFile: 'src/firebase-messaging-sw.ts',
        outputFile: 'public/firebase-messaging-sw.js',
      },
      {
        inputFile: 'src/memes.ts',
        outputFile: 'public/memes.js',
      },
    ]),
  ]
}