0.3.1 • Published 26 days ago

@aaroon/workbox-rspack-plugin v0.3.1

Weekly downloads
-
License
MIT
Repository
github
Last release
26 days ago

workbox-rspack-plugin

NPM version NPM Downloads License Minified Size Build Status

An rspack plugin to use workbox in rspack. Both GenerateSW and InjectManifest are supported. And all the options are the same as the official workbox-webpack-plugin. Currently, it passes all the tests from the official workbox-webpack-plugin, and should be stable for general uses. If you find anything wrong, feel free to open an issue.

Requirement

@rspack/core@^0.5.6

Or

@rsbuild/core@^0.4.11

Install

npm i -D @aaroon/workbox-rspack-plugin

Or

pnpm i -D @aaroon/workbox-rspack-plugin
yarn add -D @aaroon/workbox-rspack-plugin

Usage

import { GenerateSW, InjectManifest } from '@aaroon/workbox-rspack-plugin'
/**
 * @type import('@rspack/cli').Configuration}
 */
export default {
    plugins: [
        new GenerateSW({
            // options
        }),
        // or
        new InjectManifest({
            // options
        })
    ]
}

If you're using Rsbuild, use it in tools.rspack.plugins:

import { defineConfig } from '@rsbuild/core'
import { GenerateSW, InjectManifest } from '@aaroon/workbox-rspack-plugin'

export default defineConfig({
    tools: {
        rspack: {
            plugins: [
                new GenerateSW({
                    // options
                }),
                // or
                new InjectManifest({
                    // options
                })
            ]
        }
    }
})

Options

Same as workbox-webpack-plugin.

Changelog

Changelog can be found here.

Credits

Most of the code comes from Google's workbox repo, I just make it compatible with Rspack.

Acknowledgment

If you found it useful somehow, I would be grateful if you could leave a star in the project's GitHub repository.

Thank you.

0.3.1

26 days ago

0.3.0

1 month ago

0.2.2

2 months ago

0.2.1

2 months ago

0.2.0

2 months ago

0.1.0

2 months ago