# @aaroon/workbox-rspack-plugin

> An Rspack plugin to use workbox

Latest version **1.0.1** (published 2026-05-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install @aaroon/workbox-rspack-plugin
pnpm add @aaroon/workbox-rspack-plugin
yarn add @aaroon/workbox-rspack-plugin
bun add @aaroon/workbox-rspack-plugin
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2026-05-23 |
| First published | 2024-03-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=18.0.0 |
| Dependencies | 4 |
| Unpacked size | 33.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 28 |
| Author | Aaron Zhou |
| Maintainers | aaron_zhou |
| Keywords | workbox, rspack, rsbuild, workbox-webpack-plugin, pwa, service worker, manifest |

## Links

- npm: https://www.npmjs.com/package/@aaroon/workbox-rspack-plugin
- Repository: https://github.com/Clarkkkk/workbox-rspack-plugin
- Homepage: https://github.com/Clarkkkk/workbox-rspack-plugin#readme
- Issues: https://github.com/Clarkkkk/workbox-rspack-plugin/issues
- npm.io page: https://npm.io/package/@aaroon/workbox-rspack-plugin

## Dependencies (4)

- [pathe](https://npm.io/package/pathe.md) ^1.1.2
- [pretty-bytes](https://npm.io/package/pretty-bytes.md) ^6.1.1
- [workbox-build](https://npm.io/package/workbox-build.md) ^7.4.0
- [fast-json-stable-stringify](https://npm.io/package/fast-json-stable-stringify.md) ^2.1.0

## Alternatives

- [cron](https://npm.io/package/cron.md) — 4.9M weekly downloads
- [@vercel/queue](https://npm.io/package/@vercel/queue.md) — 731.6K weekly downloads
- [create-sonicjs](https://npm.io/package/create-sonicjs.md) — 1.6K weekly downloads
- [@exellix/jobs-api](https://npm.io/package/@exellix/jobs-api.md) — 941 weekly downloads
- [@forwardimpact/libskill](https://npm.io/package/@forwardimpact/libskill.md) — 575 weekly downloads

## Recent versions

- 1.0.1 (latest) — 2026-05-23
- 1.0.0 — 2026-05-15
- 0.3.3 — 2026-01-19
- 0.3.2 — 2024-09-01
- 0.3.1 — 2024-04-07
- 0.3.0 — 2024-04-01
- 0.2.2 — 2024-03-13
- 0.2.1 — 2024-03-10
- 0.2.0 — 2024-03-10
- 0.1.0 — 2024-03-10

## README

# workbox-rspack-plugin

[![NPM version][npm-image]][npm-url] [![NPM Downloads][npm-download]][npm-url] [![License][license]][license-url] [![Minified Size][minified-size]][npm-url] [![Build Status][build-status]][github-actions]

An rspack plugin to use [workbox](https://developer.chrome.com/docs/workbox) in rspack. Both `GenerateSW` and `InjectManifest` are supported. And all the options are the same as the official [`workbox-webpack-plugin`](https://developer.chrome.com/docs/workbox/modules/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](https://github.com/Clarkkkk/workbox-rspack-plugin/issues).

## Requirement

```sh
node >= 18
```

And one of the following:

```sh
@rspack/core@^1.0.0 || ^2.0.0
```

Or

```sh
@rsbuild/core@^1.0.0 || ^2.0.0
```

## Install

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

Or

```sh
pnpm i -D @aaroon/workbox-rspack-plugin
```

```sh
yarn add -D @aaroon/workbox-rspack-plugin
```

## Usage

```js
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`:

```js
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](https://developer.chrome.com/docs/workbox/modules/workbox-webpack-plugin).

## Changelog

Changelog can be found [here](https://github.com/Clarkkkk/workbox-rspack-plugin/blob/main/CHANGELOG.md).

## Credits

Most of the code comes from Google's workbox [repo](https://github.com/GoogleChrome/workbox), 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.

[npm-url]: https://www.npmjs.com/package/@aaroon/workbox-rspack-plugin
[npm-image]: https://badge.fury.io/js/@aaroon%2Fworkbox-rspack-plugin.svg
[npm-download]: https://img.shields.io/npm/dw/@aaroon/workbox-rspack-plugin
[license]: https://img.shields.io/github/license/Clarkkkk/workbox-rspack-plugin
[license-url]: https://github.com/Clarkkkk/workbox-rspack-plugin/blob/main/LICENSE.md
[minified-size]: https://img.shields.io/npm/unpacked-size/%40aaroon%2Fworkbox-rspack-plugin
[build-status]: https://img.shields.io/github/actions/workflow/status/Clarkkkk/workbox-rspack-plugin/.github%2Fworkflows%2Fpublish.yml
[github-actions]: https://github.com/Clarkkkk/workbox-rspack-plugin/actions

---
_Source: https://npm.io/package/@aaroon/workbox-rspack-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
