{"id":13775009,"url":"https://github.com/sebastian-software/rollup-plugin-rebase","last_synced_at":"2025-08-20T14:30:34.905Z","repository":{"id":10574496,"uuid":"66215351","full_name":"sebastian-software/rollup-plugin-rebase","owner":"sebastian-software","description":"The Rollup Rebase Plugin copies static assets as required from your JavaScript code to the destination folder and adjusts the references in there to point to the new location.","archived":false,"fork":false,"pushed_at":"2023-03-04T02:26:35.000Z","size":6120,"stargazers_count":58,"open_issues_count":13,"forks_count":12,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-05-12T17:01:12.377Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sebastian-software.png","metadata":{"files":{"readme":"readme.md","changelog":null,"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}},"created_at":"2016-08-21T18:56:32.000Z","updated_at":"2024-04-07T05:36:04.000Z","dependencies_parsed_at":"2023-07-19T13:41:33.074Z","dependency_job_id":null,"html_url":"https://github.com/sebastian-software/rollup-plugin-rebase","commit_stats":{"total_commits":493,"total_committers":5,"mean_commits":98.6,"dds":"0.012170385395537497","last_synced_commit":"def425acf13a93357d3438d1bfe8aab097d86925"},"previous_names":["sebastian-software/rollup-plugin-relink"],"tags_count":121,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastian-software%2Frollup-plugin-rebase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastian-software%2Frollup-plugin-rebase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastian-software%2Frollup-plugin-rebase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastian-software%2Frollup-plugin-rebase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sebastian-software","download_url":"https://codeload.github.com/sebastian-software/rollup-plugin-rebase/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230431100,"owners_count":18224655,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-08-03T17:01:32.741Z","updated_at":"2024-12-19T12:09:03.399Z","avatar_url":"https://github.com/sebastian-software.png","language":"JavaScript","funding_links":[],"categories":["Plugins"],"sub_categories":["Output"],"readme":"# Rollup Rebase \u003cbr/\u003e[![Sponsored by][sponsor-img]][sponsor] [![Version][npm-version-img]][npm] [![Downloads][npm-downloads-img]][npm] [![Build Status][github-img]][github]\n\nThe Rollup Rebase Plugin copies static assets as required from your JavaScript code to the destination folder and adjusts the references in there to point to the new location. It also respects assets referenced from your CSS/SCSS files.\n\n[sponsor]: https://www.sebastian-software.de\n[npm]: https://www.npmjs.com/package/rollup-plugin-rebase\n[sponsor-img]: https://badgen.net/badge/Sponsored%20by/Sebastian%20Software/692446\n[npm-downloads-img]: https://badgen.net/npm/dm/rollup-plugin-rebase\n[npm-version-img]: https://badgen.net/npm/v/rollup-plugin-rebase\n[github]: https://github.com/sebastian-software/rollup-plugin-rebase/actions\n[github-img]: https://badgen.net/github/status/sebastian-software/rollup-plugin-rebase?label=tests\u0026icon=github\n\n## Features\n\n- Copies over asset files references from JavaScript into the given output folder.\n- Adjust asset references in the output JavaScript files to map to the relative new location.\n- Transforms CSS files to inline all includes from `@import` via [PostCSS Import](https://github.com/postcss/postcss-import) into the origin files.\n- Detects and processes assets referenced from both, JavaScript and CSS.\n- Renames all assets based on their hash (XXHash + Base62) so that conflicts are automatically eliminated while producing a flat output structure.\n- Supports _normal_ CSS, but also [SugarSS](https://github.com/postcss/sugarss), [SCSS](https://github.com/postcss/postcss-scss) and [Sass](https://github.com/aleshaoleg/postcss-sass) via the standard PostCSS parser plugins.\n\n## Comparison\n\nThe plugin is meant as a tool for preparing a library for being published. In this it differs from plugins like [Rollup URL Plugin](https://github.com/Swatinem/rollup-plugin-url) as it is designed for usage in _libraries_ and not for _applications_. The output of this plugin can be used by tools like Webpacks [File Loader](https://github.com/webpack/file-loader), [URL Loader](https://github.com/webpack/url-loader) or the already mentioned [Rollup URL Plugin](https://github.com/Swatinem/rollup-plugin-url).\n\n## Installation\n\n```console\n$ npm install --save-dev rollup-plugin-rebase\n```\n\nor\n\n```console\n$ yarn add --dev rollup-plugin-rebase\n```\n\n## Usage\n\nYou can configure Rollup Rebase as part of your Rollup configuration. This can be either done in a `rollup.config.js` or by scripting using the Rollup API:\n\n```js\nimport { rollup } from \"rollup\"\nimport rebasePlugin from \"rollup-plugin-rebase\"\n\nasync function config() {\n  const bundle = await rollup({\n    input: \"./src/index.js\",\n    plugins: [rebasePlugin()]\n  })\n\n  await bundle.write({\n    dest: \"./lib/index.js\"\n  })\n}\n\nconfig()\n```\n\n### Options (all optional)\n\n- `assetFolder`: When set assets are placed inside a sub folder with that name.\n- `keepName`: If `true`, generated filenames will be `${filename}~${hash}.${ext}` instead of just `${hash}.${ext}`\n- `verbose`: If `true`, increases log level\n- `include`: Standard include option for rollup plugins.\n- `exclude`: Standard exclude option for rollup plugins.\n\n## Copyright\n\n\u003cimg src=\"https://cdn.rawgit.com/sebastian-software/sebastian-software-brand/0d4ec9d6/sebastiansoftware-en.svg\" alt=\"Logo of Sebastian Software GmbH, Mainz, Germany\" width=\"460\" height=\"160\"/\u003e\n\nCopyright 2016-2022\u003cbr/\u003e[Sebastian Software GmbH](http://www.sebastian-software.de)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebastian-software%2Frollup-plugin-rebase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsebastian-software%2Frollup-plugin-rebase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebastian-software%2Frollup-plugin-rebase/lists"}