0.0.3 • Published 3 months ago

farm-js-plugin-pwa v0.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
3 months ago

farm-js-plugin-pwa

A pwa js plugin for farm

Install

pnpm add -D farm-js-plugin-pwa

Usage

import { defineConfig } from "@farmfe/core";
import farmJsPluginPwa from "farm-js-plugin-pwa";

interface Options {
  /* Your options here */
  /**
   * scope of sw cache
   */
  scope?: string; // default: publicPath of the farm config
  /**
   * name of the sw.js
   */
  swName?: string; // default: 'sw'
  /**
   * name of sw cache
   */
  cacheName?: string; // default: 'sw-cache'
  /**
   * custom cache files
   */
  staticFiles?: string[]; // ['/favicon.ico']
  /**
   * request url reg
   */
  patten?: RegExp; // default:  /(.html|.js|.mjs|.css|.png|.jpg|.jpeg|.svg|.webp|.svga)$/
}

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

3 months ago

0.0.2

3 months ago

0.0.1

3 months ago