---
url: /api/symbols/workbox-build/build/webpack/webpackworkboxpwaplugin.md
---

# WebpackWorkboxPWAPlugin

Class @vite-pwa/workbox-build/build/webpack

[webpack plugin](https://webpack.js.org/plugins/) for Workbox build strategies.
**WARNING**: strategy from the resolved options will override the strategy used in the plugin constructor.

TODO: review this, should be reversed — a strategy provided at the plugin constructor
must override the default strategy from the resolved options
(`strategy ?? buildContext.strategy` in `builder/internal-webpack-build.ts`).

## Constructor

```ts
new WebpackWorkboxPWAPlugin(strategy: S, options: Partial<WorkboxBuildConfiguration<S, T>>)
```

## Properties

## Methods

### apply()

```ts
apply(compiler: Compiler): void
```

Webpack plugin interface — compatible with Webpack 5.
In Webpack 4 the compiler is un-typed, whereas Webpack 5 provides full type definitions.
