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-sourcemapsVerified import paths — ran on the pinned version, not inferred.
Sets up Rollup with the sourcemaps plugin to include existing source maps in the final bundle.
Update to latest rollup-plugin-sourcemaps and Rollup 3
Ensure your input files have external source map references (e.g., //# sourceMappingURL=file.js.map)
Add sourcemap: true to output options in rollup.config.js
Migrate to Rollup's native source map support or use @rollup/plugin-sourcemaps if available
npm install --save-dev rollup-plugin-sourcemaps
Use 'import sourcemaps from "rollup-plugin-sourcemaps"' and call sourcemaps()
Add sourcemap: true to Rollup output config
Ensure the referenced .map file exists or fix the path