# rollup-plugin-sourcemaps2

> Rollup plugin for grabbing source maps from sourceMappingURLs

Latest version **0.5.9** (published 2026-09-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install rollup-plugin-sourcemaps2
pnpm add rollup-plugin-sourcemaps2
yarn add rollup-plugin-sourcemaps2
bun add rollup-plugin-sourcemaps2
```

## Health

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

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

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.5.9 |
| Published | 2026-09-23 |
| First published | 2024-05-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=22.13.0 |
| Dependencies | 1 |
| Unpacked size | 63.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 24 |
| Author | Kudakwashe Mupeni <said.coyness-0m@icloud.com> |
| Maintainers | 2wce |
| Keywords | rollup, rollup-plugin, sourcemap, source-map, sourceMappingURL |

## Links

- npm: https://www.npmjs.com/package/rollup-plugin-sourcemaps2
- Repository: https://github.com/2wce/rollup-plugin-sourcemaps2
- Homepage: https://github.com/2wce/rollup-plugin-sourcemaps2#readme
- Issues: https://github.com/2wce/rollup-plugin-sourcemaps2/issues
- npm.io page: https://npm.io/package/rollup-plugin-sourcemaps2

## Dependencies (1)

- [@rollup/pluginutils](https://npm.io/package/@rollup/pluginutils.md) 5.4.0

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 0.5.9 (latest) — 2026-09-23
- 0.5.8 — 2026-06-24
- 0.5.7 — 2026-05-12
- 0.5.6 — 2026-02-24
- 0.5.4 — 2025-09-04
- 0.5.3 — 2025-07-14
- 0.5.2 — 2025-05-19
- 0.5.1 — 2025-04-23
- 0.5.0 — 2025-02-19
- 0.4.4 — 2025-02-19
- 0.4.3 — 2024-12-11
- 0.4.2 — 2024-10-15
- 0.4.1 — 2024-08-13
- 0.4.0 — 2024-08-10
- 0.3.0 — 2024-05-22
- … 2 more at https://npm.io/package/rollup-plugin-sourcemaps2/versions

## README

# rollup-plugin-sourcemaps2

[![Version](https://img.shields.io/npm/v/rollup-plugin-sourcemaps2.svg)](https://www.npmjs.com/package/rollup-plugin-sourcemaps2)
[![License](https://img.shields.io/npm/l/rollup-plugin-sourcemaps2.svg)](https://github.com/2wce/rollup-plugin-sourcemaps/blob/main/LICENSE)
![Build Status](https://github.com/2wce/rollup-plugin-sourcemaps/actions/workflows/release.yml/badge.svg)

[Rollup](https://rollupjs.org) plugin for loading files with existing source maps.
Inspired by [webpack/source-map-loader](https://github.com/webpack/source-map-loader).

Works with rollup 4.x.x or later.

This is building on top of the awesome work of [Max Davidson](https://github.com/maxdavidson/rollup-plugin-sourcemaps). The repo wasn't getting updates so I took it upon myself to keep a copy updated

If you use [rollup-plugin-babel](https://github.com/rollup/rollup-plugin-babel),
you might be able to use the [`inputSourceMap`](https://babeljs.io/docs/en/options#inputsourcemap) option instead of this plugin. Conversely, if you use this plugin alongside `rollup-plugin-babel`, you should explicitly set the Babel `inputSourceMap` option to `false`.

If this plugin is not resolving the sourcemap URL (particularly on MS Windows), try also including the official rollup plugin [@rollup/plugin-url](https://github.com/rollup/plugins/tree/master/packages/url).

## Why?

- You transpile your files with source maps before bundling with rollup
- You consume external modules with bundled source maps

## Usage

```javascript
import sourcemaps from 'rollup-plugin-sourcemaps2';

export default {
  input: 'src/index.js',
  plugins: [sourcemaps()],
  output: {
    sourcemap: true,
    file: 'dist/my-awesome-package.js',
  },
};
```

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