@reactea/sw
TypeScript icon, indicating that this package has built-in type declarations

1.0.0-alpha.3 • Public • Published

@reactea/sw

@reactea/sw is a Webpack configuration package that provides the basic configuration for a Service Worker in a Progressive Web Application (PWA). It is designed to be extendable and configurable via other @reactea packages.

Installation

To install @reactea/sw, run the following command:

npm install --save-dev @reactea/sw

Usage

In your webpack.config.js file, import @reactea/sw and call the default export function to obtain the configuration for a Service Worker.

import { createConfig, extendConfig } from "@reactea/config";
import swConfig from "@reactea/sw";

export default function myConfig() {
  const config = createConfig();

  extendConfig(reactea, swConfig());

  return config;
}

Configuration

@reactea/sw provides a configuration object for generating the Service Worker script with the InjectManifest plugin from workbox-webpack-plugin. By default, it injects the Service Worker script from the src/service-worker.js file, and precaches all assets except for .map, asset-manifest.json, and LICENSE files. It also increases the maximum file size that can be precached to 5MB.

/@reactea/sw/

    Package Sidebar

    Install

    npm i @reactea/sw

    Weekly Downloads

    1

    Version

    1.0.0-alpha.3

    License

    ISC

    Unpacked Size

    4.18 kB

    Total Files

    5

    Last publish

    Collaborators

    • e9x