Registry / web-framework / rollup-plugin-include-sourcemaps

rollup-plugin-include-sourcemaps

JSON →
library0.7.0jsnpmunverified

Rollup plugin (v0.7.0) that loads existing source maps from sourceMappingURL comments in transpiled files. Designed for workflows where files are pre-transpiled (e.g., with Babel or TypeScript) before bundling, or when consuming external modules that include inline source maps. It automatically reads and attaches source maps so Rollup's output contains accurate mappings. Lightweight alternative to webpack's source-map-loader, with no extra configuration needed. Works with Rollup >=0.31.2 and Node >=10.0.0. Ships TypeScript declarations. Last updated 2021, stable release.

npm install rollup-plugin-include-sourcemaps
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-INCL
R
rollup-plugin-include-sourcemaps
web-frameworkjavascriptv0.7.0
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-include-sourcemaps'
const sourcemaps = require('rollup-plugin-include-sourcemaps')
Default import. The package is ESM-only; CommonJS require() will fail in Node >=13 or Rollup configs using ESM.
sourcemaps
import sourcemaps from 'rollup-plugin-include-sourcemaps'
import { sourcemaps } from 'rollup-plugin-include-sourcemaps'
Named import will not work. The package exports a default function only.
RollupPluginIncludeSourcemapsOptions
import type { RollupPluginIncludeSourcemapsOptions } from 'rollup-plugin-include-sourcemaps'
TypeScript users can import the options interface for type safety. Available since v0.6.0.

Shows minimal Rollup config using the plugin to include existing source maps from transpiled input files.

import sourcemaps from 'rollup-plugin-include-sourcemaps'; export default { input: 'src/index.js', plugins: [sourcemaps()], output: { sourcemap: true, file: 'dist/bundle.js', }, };
Debug
Known issues
gotchaPlugin must be placed before other plugins that transform code (e.g., babel) to ensure source maps from pre-transpiled files are captured.
fix
Order plugins: sourcemaps() first, then other transforms.
affects: >=0.1.0
gotchaOutput must have sourcemap: true for the plugin's work to be reflected in the final bundle source map.
fix
Set output.sourcemap to true or 'inline'.
affects: >=0.1.0
deprecatedThis plugin is no longer actively maintained; consider using Rollup's built-in source map handling or a maintained alternative.
fix
Use Rollup's output.sourcemap or plugins like @rollup/plugin-sourcemaps if needed.
affects: >=0.7.0
breakingVersion 0.6.0 changed options interface; old 'exclude' option was renamed to 'excludeFile' and 'include' to 'includeFile'.
fix
Use 'includeFile' and 'excludeFile' instead of 'include' and 'exclude'.
affects: >=0.6.0 <0.6.0
Errors
Common errors & fixes
Error: Cannot find module 'rollup-plugin-include-sourcemaps'
Missing npm install or wrong import path when using ESM.
fix
Run `npm install rollup-plugin-include-sourcemaps` and ensure the import statement uses default import (no curly braces).
TypeError: sourcemaps is not a function
Named import used instead of default import.
fix
Change to `import sourcemaps from 'rollup-plugin-include-sourcemaps'`.
Source map not found for file: ...
Plugin cannot find sourceMappingURL comment or the .map file is missing/not adjacent.
fix
Ensure the input file has a valid sourceMappingURL comment (inline or reference) and the source map file exists adjacent to the source.
Upgrade
Version history
0.7.0latest on npm
Audit
Dependencies
rolluprequiredPeer dependency: plugin hooks require Rollup >=0.31.2
@types/nodeoptionalPeer dependency: provides Node.js types for TypeScript users
Agent activity
7 hits · last 30 days
node
6
Resources
rollup-plugin-include-sourcemaps — npm install rollup-plugin-include-sourcemaps · libregistry