Registry / devops / rollup-plugin-sourcemaps

rollup-plugin-sourcemaps

JSON →
library0.6.3jsnpmunverified

Rollup plugin that loads existing source maps from sourceMappingURL comments in JavaScript files. Version 0.6.3 is the latest stable, with infrequent releases. It works with Rollup >=0.31.2 and helps preserve source maps from transpiled files or external modules before final bundling. Unlike Babel's inputSourceMap option, this plugin works with any source map source, making it useful when consuming pre-compiled dependencies or when using multiple transpilation steps.

npm install rollup-plugin-sourcemaps
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-SOUR
R
rollup-plugin-sourcemaps
devopsjavascriptv0.6.3
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

sourcemaps
import sourcemaps from 'rollup-plugin-sourcemaps'
const sourcemaps = require('rollup-plugin-sourcemaps')
Default export; also works with require in CommonJS

Sets up Rollup with the sourcemaps plugin to include existing source maps in the final bundle.

import sourcemaps from 'rollup-plugin-sourcemaps'; import { rollup } from 'rollup'; const bundle = await rollup({ input: 'src/index.js', plugins: [sourcemaps()], output: { sourcemap: true, file: 'dist/bundle.js', format: 'esm' } }); await bundle.write({ sourcemap: true, file: 'dist/bundle.js', format: 'esm' });
Debug
Known issues
breakingRollup 3 dropped support for some plugin hooks; ensure compatibility with this plugin version
fix
Update to latest rollup-plugin-sourcemaps and Rollup 3
affects: >=0.0.0
gotchaPlugin only works with files that have a sourceMappingURL comment; inline source maps are not supported
fix
Ensure your input files have external source map references (e.g., //# sourceMappingURL=file.js.map)
affects: >=0.0.0
gotchaOutput must have sourcemap:true for the plugin to take effect
fix
Add sourcemap: true to output options in rollup.config.js
affects: >=0.0.0
deprecatedThis plugin is in maintenance mode; consider using Rollup's built-in source map handling or plugin hooks
fix
Migrate to Rollup's native source map support or use @rollup/plugin-sourcemaps if available
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'rollup-plugin-sourcemaps'
Package not installed
fix
npm install --save-dev rollup-plugin-sourcemaps
TypeError: sourcemaps is not a function
Wrong import style (e.g., using named import instead of default)
fix
Use 'import sourcemaps from "rollup-plugin-sourcemaps"' and call sourcemaps()
Error: You must specify output.sourcemap: true to use this plugin
Output sourcemap option not set
fix
Add sourcemap: true to Rollup output config
Error: Could not resolve source map for '...'
Missing source map file or wrong path in sourceMappingURL
fix
Ensure the referenced .map file exists or fix the path
Upgrade
Version history
0.6.3latest on npm
Audit
Dependencies
rolluprequiredPeer dependency; plugin is designed to work as a Rollup plugin
Agent activity
8 hits · last 30 days
node
8
Resources
rollup-plugin-sourcemaps — npm install rollup-plugin-sourcemaps · libregistry