Skip to content

x8BitRain/vite-plugin-ts-sw-hmr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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',
      },
    ]),
  ]
}

About

HMR for multiple TypeScript ServiceWorkers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published