# @stoplight/spectral-ruleset-bundler

> - **plugins** - any other Rollup.js plugin, i.e. a minifier. - **target**: - `node` - a preset suitable for the Node.js runtime - `browser` - a preset tailored to Browsers - `runtime` - a preset you want to use if you want to bundle & execute the ru

Latest version **1.8.0** (published 2026-10-01) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @stoplight/spectral-ruleset-bundler
pnpm add @stoplight/spectral-ruleset-bundler
yarn add @stoplight/spectral-ruleset-bundler
bun add @stoplight/spectral-ruleset-bundler
```

## Health

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

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.8.0 |
| Published | 2026-10-01 |
| First published | 2021-09-16 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | ^16.20 \|\| ^18.18 \|\| >= 20.17 |
| Dependencies | 16 |
| Unpacked size | 43.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3224 |
| Author | Stoplight |
| Maintainers | stoplight-devops, mrunkle-sb, smartbear_devops, stoplight-spectral-bot |

## Links

- npm: https://www.npmjs.com/package/@stoplight/spectral-ruleset-bundler
- Repository: https://github.com/stoplightio/spectral
- Issues: https://github.com/stoplightio/spectral/issues
- npm.io page: https://npm.io/package/@stoplight/spectral-ruleset-bundler

## Dependencies (16)

- [tslib](https://npm.io/package/tslib.md) ^2.8.1
- [rollup](https://npm.io/package/rollup.md) ^2.80.0
- [pony-cause](https://npm.io/package/pony-cause.md) 1.1.1
- [@types/node](https://npm.io/package/@types/node.md) *
- [@stoplight/path](https://npm.io/package/@stoplight/path.md) 1.3.2
- [@stoplight/types](https://npm.io/package/@stoplight/types.md) ^13.6.0
- [@rollup/plugin-commonjs](https://npm.io/package/@rollup/plugin-commonjs.md) ~22.0.2
- [@stoplight/spectral-core](https://npm.io/package/@stoplight/spectral-core.md) >=1
- [validate-npm-package-name](https://npm.io/package/validate-npm-package-name.md) 3.0.0
- [@stoplight/spectral-formats](https://npm.io/package/@stoplight/spectral-formats.md) ^1.8.1
- [@stoplight/spectral-parsers](https://npm.io/package/@stoplight/spectral-parsers.md) >=1
- [@stoplight/spectral-runtime](https://npm.io/package/@stoplight/spectral-runtime.md) ^1.1.2
- [@stoplight/spectral-rulesets](https://npm.io/package/@stoplight/spectral-rulesets.md) >=1
- [@stoplight/spectral-functions](https://npm.io/package/@stoplight/spectral-functions.md) >=1
- [@stoplight/spectral-ref-resolver](https://npm.io/package/@stoplight/spectral-ref-resolver.md) ^1.0.4
- [@stoplight/spectral-ruleset-migrator](https://npm.io/package/@stoplight/spectral-ruleset-migrator.md) ^1.9.6

## Recent versions

- 1.8.0 (latest) — 2026-10-01
- 1.5.2-beta.2 (beta) — 2026-04-09
- 1.7.0 — 2026-04-13
- 1.5.2-beta.1 — 2026-04-08
- 1.5.2-beta.0 — 2026-04-08
- 1.6.3-beta-0.8 — 2026-03-06
- 1.6.3 — 2025-04-23
- 1.6.2 — 2025-03-07
- 1.6.1 — 2024-11-13
- 1.6.0 — 2024-09-12
- 1.5.2 — 2023-05-17
- 1.5.1 — 2023-02-22
- 1.5.0 — 2022-11-30
- 1.4.0 — 2022-10-24
- 1.3.3 — 2022-10-21
- … 9 more at https://npm.io/package/@stoplight/spectral-ruleset-bundler/versions

## README

# @stoplight/spectral-ruleset-bundler

## Options

- **plugins** - any other Rollup.js plugin, i.e. a minifier.
- **target**:
  - `node` - a preset suitable for the Node.js runtime
  - `browser` - a preset tailored to Browsers
  - `runtime` - a preset you want to use if you want to bundle & execute the ruleset at the runtime
- format - supported values are: `esm`, `commonjs`, `iife`.
- treeshake - whether to enable tree shaking. False by default.

**Bolded** options are required.

## Loading YAML/JSON Ruleset

```js
// spectral.mjs
import * as fs from "node:fs";
import { fileURLToPath } from "node:url";
import * as path from "node:path";
import { Spectral } from "@stoplight/spectral-core";
import { bundleAndLoadRuleset } from "@stoplight/spectral-ruleset-bundler/with-loader";
import { fetch } from "@stoplight/spectral-runtime";

const __dirname = path.dirname(fileURLToPath(import.meta.url));

const s = new Spectral();
s.setRuleset(await bundleAndLoadRuleset(path.join(__dirname, ".spectral.yaml"), { fs, fetch }));

// lint as usual
```

---
_Source: https://npm.io/package/@stoplight/spectral-ruleset-bundler · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
