{"id":22080,"library":"rollup-plugin-include-sourcemaps","title":"rollup-plugin-include-sourcemaps","description":"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.","status":"active","version":"0.7.0","language":"javascript","source_language":"en","source_url":"https://github.com/IIIMADDINIII/rollup-plugin-include-sourcemaps","tags":["javascript","rollup","rollup-plugin","sourcemap","source-map","sourceMappingURL","typescript"],"install":[{"cmd":"npm install rollup-plugin-include-sourcemaps","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-include-sourcemaps","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-include-sourcemaps","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency: plugin hooks require Rollup >=0.31.2","package":"rollup","optional":false},{"reason":"Peer dependency: provides Node.js types for TypeScript users","package":"@types/node","optional":true}],"imports":[{"note":"Default import. The package is ESM-only; CommonJS require() will fail in Node >=13 or Rollup configs using ESM.","wrong":"const sourcemaps = require('rollup-plugin-include-sourcemaps')","symbol":"sourcemaps","correct":"import sourcemaps from 'rollup-plugin-include-sourcemaps'"},{"note":"Named import will not work. The package exports a default function only.","wrong":"import { sourcemaps } from 'rollup-plugin-include-sourcemaps'","symbol":"sourcemaps","correct":"import sourcemaps from 'rollup-plugin-include-sourcemaps'"},{"note":"TypeScript users can import the options interface for type safety. Available since v0.6.0.","symbol":"RollupPluginIncludeSourcemapsOptions","correct":"import type { RollupPluginIncludeSourcemapsOptions } from 'rollup-plugin-include-sourcemaps'"}],"quickstart":{"code":"import sourcemaps from 'rollup-plugin-include-sourcemaps';\n\nexport default {\n  input: 'src/index.js',\n  plugins: [sourcemaps()],\n  output: {\n    sourcemap: true,\n    file: 'dist/bundle.js',\n  },\n};","lang":"typescript","description":"Shows minimal Rollup config using the plugin to include existing source maps from transpiled input files."},"warnings":[{"fix":"Order plugins: sourcemaps() first, then other transforms.","message":"Plugin must be placed before other plugins that transform code (e.g., babel) to ensure source maps from pre-transpiled files are captured.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Set output.sourcemap to true or 'inline'.","message":"Output must have sourcemap: true for the plugin's work to be reflected in the final bundle source map.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Use Rollup's output.sourcemap or plugins like @rollup/plugin-sourcemaps if needed.","message":"This plugin is no longer actively maintained; consider using Rollup's built-in source map handling or a maintained alternative.","severity":"deprecated","affected_versions":">=0.7.0"},{"fix":"Use 'includeFile' and 'excludeFile' instead of 'include' and 'exclude'.","message":"Version 0.6.0 changed options interface; old 'exclude' option was renamed to 'excludeFile' and 'include' to 'includeFile'.","severity":"breaking","affected_versions":">=0.6.0 <0.6.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run `npm install rollup-plugin-include-sourcemaps` and ensure the import statement uses default import (no curly braces).","cause":"Missing npm install or wrong import path when using ESM.","error":"Error: Cannot find module 'rollup-plugin-include-sourcemaps'"},{"fix":"Change to `import sourcemaps from 'rollup-plugin-include-sourcemaps'`.","cause":"Named import used instead of default import.","error":"TypeError: sourcemaps is not a function"},{"fix":"Ensure the input file has a valid sourceMappingURL comment (inline or reference) and the source map file exists adjacent to the source.","cause":"Plugin cannot find sourceMappingURL comment or the .map file is missing/not adjacent.","error":"Source map not found for file: ..."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}