# @lwc/rollup-plugin

> Rollup plugin to compile LWC

Latest version **9.4.3** (published 2026-09-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install @lwc/rollup-plugin
pnpm add @lwc/rollup-plugin
yarn add @lwc/rollup-plugin
bun add @lwc/rollup-plugin
```

## Health

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

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 9.4.3 |
| Published | 2026-09-02 |
| First published | 2018-12-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=16.6.0 |
| Dependencies | 4 |
| Unpacked size | 41.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 1792 |
| Maintainers | lwc-admin, caridy, jye-sf, ravi.jayaramappa, jodarove, abdulsattar, rax-it1, lpomerleau |
| Keywords | lwc |

## Links

- npm: https://www.npmjs.com/package/@lwc/rollup-plugin
- Repository: https://github.com/salesforce/lwc
- Homepage: https://lwc.dev
- Issues: https://github.com/salesforce/lwc/issues
- npm.io page: https://npm.io/package/@lwc/rollup-plugin

## Dependencies (4)

- [@lwc/shared](https://npm.io/package/@lwc/shared.md) 9.4.3
- [@lwc/compiler](https://npm.io/package/@lwc/compiler.md) 9.4.3
- [@rollup/pluginutils](https://npm.io/package/@rollup/pluginutils.md) ~5.4.0
- [@lwc/module-resolver](https://npm.io/package/@lwc/module-resolver.md) 9.4.3

## Recent versions

- 9.4.3 (latest) — 2026-09-02
- 9.4.6-alpha.1 (canary) — 2026-09-22
- 9.3.10 (winter27) — 2026-09-21
- 9.1.5 (summer26) — 2026-04-28
- 8.25.1 (spring26) — 2025-11-19
- 8.20.6 (winter26) — 2025-10-20
- 8.16.5 (summer25) — 2025-05-05
- 8.10.3 (spring25) — 2025-01-09
- 7.1.5 (winter25) — 2024-10-10
- 7.0.1-alpha.0 (next) — 2024-06-21
- 6.4.5 (summer24) — 2024-06-05
- 5.0.10 (spring24) — 2024-03-20
- 3.0.4 (winter24) — 2023-10-02
- 2.40.2-lbc (lbc-avante-garde) — 2023-03-21
- 2.31.8 (spring23) — 2023-03-20
- … 874 more at https://npm.io/package/@lwc/rollup-plugin/versions

## README

# @lwc/rollup-plugin

Rollup plugin to compile LWC

## Installation

```sh
yarn add --dev @lwc/rollup-plugin
```

## Usage

```js
// rollup.config.js
import lwc from '@lwc/rollup-plugin';

export default {
    input: './src/main.js',
    plugins: [lwc()],
};
```

## Options

- `include` (type: `string | string[]`, default: `null`) - A [minimatch pattern](https://github.com/isaacs/minimatch), or array of patterns, which specifies the files in the build the plugin should transform on. By default all files are targeted.
- `exclude` (type: `string | string[]`, default: `null`) - A [minimatch pattern](https://github.com/isaacs/minimatch), or array of patterns, which specifies the files in the build the plugin should not transform. By default no files are ignored.
- `rootDir` (type: `string`, default: rollup `input` directory) - The LWC root module directory.
- `sourcemap` (type: `boolean`, default: `false`) - If `true` the plugin will produce source maps.
- `modules` (type: `ModuleRecord[]`, default: `[]`) - The [module resolution](https://lwc.dev/guide/es_modules#module-resolution) overrides passed to the `@lwc/module-resolver`.
- `stylesheetConfig` (type: `object`, default: `{}`) - Deprecated. Ignored by compiler.
- `preserveHtmlComments` (type: `boolean`, default: `false`) - The configuration to pass to the `@lwc/template-compiler`.
- `dynamicImports` (type: `DynamicImportConfig`, default: `null`) - The configuration to pass to `@lwc/compiler`.
- `experimentalDynamicDirective` (type: `boolean`, default: `false`) - The configuration to pass to `@lwc/template-compiler` to enable deprecated dynamic components.
- `enableDynamicComponents` (type: `boolean`, default: `false`) - The configuration to pass to `@lwc/template-compiler` to enable dynamic components.
- `enableLightningWebSecurityTransforms` (type: `boolean`, default: `false`) - The configuration to pass to `@lwc/compiler`.
- `enableLwcSpread` (type: `boolean`, default: `false`) - The configuration to pass to the `@lwc/template-compiler`.
- `enableLwcOn` (type: `boolean`, default: `false`) - The configuration to pass to the `@lwc/template-compiler`.
- `disableSyntheticShadowSupport` (type: `boolean`, default: `false`) - Set to true if synthetic shadow DOM support is not needed, which can result in smaller output.
- `apiVersion` (type: `number`, default: `undefined`) - Set to a valid API version such as 58, 59, etc. This will be overridden if the component itself overrides the version with a `*.js-meta.xml` file.
- `enableStaticContentOptimization` (type: `boolean`, optional) - True if the static content optimization should be enabled. Passed to `@lwc/template-compiler`. True by default.
- `targetSSR` (type: `boolean`) - Utilize the experimental SSR compilation mode. False by default. Do not use unless you know what you're doing.
- `ssrMode` (type: `string`): The variety of SSR code that should be generated when using experimental SSR compilation mode. Should be one of `sync`, `async` or `asyncYield`.
- `enablePrivateMethods` (type: `boolean`, default: `false`) - Enable the private method round-trip transform. When false or omitted, private methods are not supported. Passed to `@lwc/compiler`.

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