Skip to main content

base

First added

8.2.0

Default

viteOptions.base

About

The base from which Serwist resolves URLs.

Usage

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

More resources

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