{"id":22423353,"url":"https://github.com/prantlf/rollup-sourcemap-path-transform","last_synced_at":"2026-02-01T20:36:30.644Z","repository":{"id":57680125,"uuid":"493124886","full_name":"prantlf/rollup-sourcemap-path-transform","owner":"prantlf","description":"Function sourcemapPathTransform for Rollup to rebase sources in source maps, so that they start with the same path prefix.","archived":false,"fork":false,"pushed_at":"2024-12-10T20:28:23.000Z","size":120,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-19T16:21:44.049Z","etag":null,"topics":["path","plugin","rollup","rollup-plugin","sourcemap","sourcemappathtransform","transform"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prantlf.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-17T06:34:05.000Z","updated_at":"2025-07-06T09:33:30.000Z","dependencies_parsed_at":"2024-08-06T09:19:23.308Z","dependency_job_id":"741440f9-a095-4bd5-8362-ff6f0387d3fe","html_url":"https://github.com/prantlf/rollup-sourcemap-path-transform","commit_stats":{"total_commits":11,"total_committers":2,"mean_commits":5.5,"dds":0.2727272727272727,"last_synced_commit":"e88d98c5f02aaeef71ee2e700b6fa638eed8de03"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/prantlf/rollup-sourcemap-path-transform","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prantlf%2Frollup-sourcemap-path-transform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prantlf%2Frollup-sourcemap-path-transform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prantlf%2Frollup-sourcemap-path-transform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prantlf%2Frollup-sourcemap-path-transform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prantlf","download_url":"https://codeload.github.com/prantlf/rollup-sourcemap-path-transform/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prantlf%2Frollup-sourcemap-path-transform/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28989355,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T18:17:03.387Z","status":"ssl_error","status_checked_at":"2026-02-01T18:16:57.287Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["path","plugin","rollup","rollup-plugin","sourcemap","sourcemappathtransform","transform"],"created_at":"2024-12-05T18:10:32.362Z","updated_at":"2026-02-01T20:36:30.631Z","avatar_url":"https://github.com/prantlf.png","language":"JavaScript","readme":"# rollup-sourcemap-path-transform\n\n[![Latest version](https://img.shields.io/npm/v/rollup-sourcemap-path-transform)\n ![Dependency status](https://img.shields.io/librariesio/release/npm/rollup-sourcemap-path-transform)\n](https://www.npmjs.com/package/rollup-sourcemap-path-transform)\n[![Coverage](https://codecov.io/gh/prantlf/rollup-sourcemap-path-transform/branch/master/graph/badge.svg)](https://codecov.io/gh/prantlf/rollup-sourcemap-path-transform)\n\nFunction [sourcemapPathTransform] for [Rollup] to rebase sources in source maps, so that they start with the same path prefix. Helps grouping all your sources in the same node in the source tree, when using the debugger in the browser developer tools.\n\n## Synopsis\n\n```js\nimport { createPathTransform } from 'rollup-sourcemap-path-transform'\n\nexport default {\n  input: 'src/index.js',\n  output: {\n    file: 'dist/index.js',\n    sourcemap: true,\n    // Rebase all source map sources to /compi\n    sourcemapPathTransform: createPathTransform({\n      prefixes: {\n        '*src/components/': '/compi/comps/',\n        '/node_modules/': '/compi/deps/'\n      }\n    })\n  }\n}\n```\n\n## Installation\n\nMake sure that you use [Node.js] 14 or newer and [Rollup] 2 or newer. Use your favourite package manager - [NPM], [PNPM] or [Yarn]:\n\n```sh\nnpm i -D rollup-sourcemap-path-transform\npnpm i -D rollup-sourcemap-path-transform\nyarn add -D rollup-sourcemap-path-transform\n```\n\n## Usage\n\nEdit a `rollup.config.js` [configuration file], import the `createPathTransform` function, call it to create a transformation method and assign it to the `sourcemapPathTransform` property of the `output` configuration:\n\n```js\nimport { createPathTransform } from 'rollup-sourcemap-path-transform'\n\nconst sourcemapPathTransform = createPathTransform({\n  prefixes: {\n    '*src/': '/myproj/'\n  }\n})\n\nexport default {\n  input: 'src/index.js',\n  output: {\n    file: 'dist/index.js',\n    sourcemap: true,\n    sourcemapPathTransform\n  }\n}\n```\n\nThen call `rollup` either via the [command-line] or [programmatically].\n\n## Options\n\nThe following options can be passed in an object to the `createPathTransform` function.\n\n### `prefixes`\n\nType: `Object`\u003cbr\u003e\nDefault: `{}`\n\nMap of path prefixes to path replacements. The prefixes will be searched in the declared order and as soon as the first will match the beginning of the source path, it will be replaced with the value in the map tuple. If a prefix start with an asterisk (`*`) it will be search anywhere in the source path.\n\n### `requirePrefix`\n\nType: `Boolean`\u003cbr\u003e\nDefault: `false`\n\nIf enabled and no prefix is detected in a source path, the transformation will fail by throwing an error.\n\n## Contributing\n\nIn lieu of a formal styleguide, take care to maintain the existing coding style. Lint and test your code.\n\n## License\n\nCopyright (C) 2022-2024 Ferdinand Prantl\n\nLicensed under the [MIT License].\n\n[MIT License]: http://en.wikipedia.org/wiki/MIT_License\n[Rollup]: https://rollupjs.org/\n[Node.js]: https://nodejs.org/\n[NPM]: https://www.npmjs.com/\n[PNPM]: https://pnpm.io/\n[Yarn]: https://yarnpkg.com/\n[configuration file]: https://www.rollupjs.org/guide/en/#configuration-files\n[command-line]: https://www.rollupjs.org/guide/en/#command-line-reference\n[programmatically]: https://www.rollupjs.org/guide/en/#javascript-api\n[sourcemapPathTransform]: https://rollupjs.org/guide/en/#outputsourcemappathtransform\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprantlf%2Frollup-sourcemap-path-transform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprantlf%2Frollup-sourcemap-path-transform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprantlf%2Frollup-sourcemap-path-transform/lists"}