Back to Serwist

rollupFormat

docs-nuxt-configuring-rollup-format.md

latest782 B
Original Source

rollupFormat

First added

8.2.0

Default

"es"

About

The format used to build the service worker. Usually used alongside type.

Usage

vite.config.ts

export default defineConfig({
  plugins: [
    // Other plugins...
    serwist({
      rollupFormat: "iife",
      type: "classic",
      swSrc: "src/sw.ts",
      swDest: "sw.js",
      globDirectory: "dist",
      injectionPoint: "self.__SW_MANIFEST",
    }),
  ],
});

More resources

Here is a list of resources you can read to learn more about rollupFormat: