{"id":13774263,"url":"https://github.com/recursive-beast/rollup-plugin-external-assets","last_synced_at":"2025-05-11T06:32:38.987Z","repository":{"id":113248877,"uuid":"339421988","full_name":"recursive-beast/rollup-plugin-external-assets","owner":"recursive-beast","description":"A rollup plugin to make assets external, they will not be added to the bundling pipeline, but they will still be included in the final output.","archived":false,"fork":false,"pushed_at":"2025-01-13T01:26:24.000Z","size":11422,"stargazers_count":2,"open_issues_count":6,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-14T06:50:13.046Z","etag":null,"topics":["assets","external","import","npm","rollup","rollup-plugin"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/recursive-beast.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":"2021-02-16T14:18:28.000Z","updated_at":"2024-10-14T14:50:32.000Z","dependencies_parsed_at":"2024-01-13T11:57:53.148Z","dependency_job_id":"a46772a9-0375-47bc-b101-086e8d33252d","html_url":"https://github.com/recursive-beast/rollup-plugin-external-assets","commit_stats":null,"previous_names":["soufyakoub/rollup-plugin-external-assets"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/recursive-beast%2Frollup-plugin-external-assets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/recursive-beast%2Frollup-plugin-external-assets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/recursive-beast%2Frollup-plugin-external-assets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/recursive-beast%2Frollup-plugin-external-assets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/recursive-beast","download_url":"https://codeload.github.com/recursive-beast/rollup-plugin-external-assets/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253528374,"owners_count":21922623,"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":["assets","external","import","npm","rollup","rollup-plugin"],"created_at":"2024-08-03T17:01:25.163Z","updated_at":"2025-05-11T06:32:38.540Z","avatar_url":"https://github.com/recursive-beast.png","language":"TypeScript","funding_links":[],"categories":["Plugins"],"sub_categories":["Modules"],"readme":"[![npm](https://img.shields.io/npm/dt/rollup-plugin-external-assets)](https://www.npmjs.com/package/rollup-plugin-external-assets)\n[![npm](https://img.shields.io/npm/v/rollup-plugin-external-assets)](https://www.npmjs.com/package/rollup-plugin-external-assets)\n[![build](https://github.com/recursive-beast/rollup-plugin-external-assets/actions/workflows/build.yml/badge.svg)](https://github.com/recursive-beast/rollup-plugin-external-assets/actions/workflows/build.yml)\n[![codecov](https://codecov.io/gh/recursive-beast/rollup-plugin-external-assets/branch/master/graph/badge.svg)](https://codecov.io/gh/recursive-beast/rollup-plugin-external-assets)\n[![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n\n# rollup-plugin-external-assets\n\n\u003e A rollup plugin to make assets external,\u003c/br\u003e\n\u003e they will not be added to the bundling pipeline,\u003c/br\u003e\n\u003e but they will still be included in the final output.\n\n## Installation\n\nVia [npm](https://npmjs.org)\n\n```sh\nnpm install --save-dev rollup-plugin-external-assets\n```\n\nVia [yarn](https://yarnpkg.com)\n\n```sh\nyarn add -D rollup-plugin-external-assets\n```\n\n## Usage\n\nAssuming a `src/index.js` exists and contains code like the following:\n\n```js\nimport logo from \"../assets/logo.png\";\n\nconsole.log(logo);\n```\n\nCreate a `rollup.config.js` [configuration file](https://www.rollupjs.org/guide/en/#configuration-files) and import the plugin:\n\n```js\nimport { externalAssets } from \"rollup-plugin-external-assets\";\n\nexport default {\n\tinput: \"src/index.js\",\n\toutput: {\n\t\tfile: \"dist/index.js\",\n\t\tformat: \"cjs\",\n\t},\n\tplugins: [externalAssets(\"assets/*\")],\n};\n```\n\nThen call `rollup` either via the [CLI](https://www.rollupjs.org/guide/en/#command-line-reference) or the [API](https://www.rollupjs.org/guide/en/#javascript-api).\n\nOnce the bundle is executed, you end up with a `dist` directory like the following:\n\n![dist directory structure](assets/screenshot.png)\n\nWith `dist/index.js` containing:\n\n```js\n\"use strict\";\n\nvar logo = require(\"./assets/logo-0c6cee7b.png\");\nconsole.log(logo);\n```\n\n## Options\n\nTo tailor the plugin behavior to your needs, you can pass a configuration object as the argument:\n\n`include`\n\n• Type: `string | RegExp | (string | RegExp)[]`\n\nA pattern, or array of patterns, to match files the plugin should operate on.\n\n`exclude`\n\n• Type: `string | RegExp | (string | RegExp)[]`\n\nA pattern, or array of patterns, to match files the plugin should ignore.\n\n`resolve`\n\n• Type: `string`\u003cbr/\u003e\n• Default: `process.cwd()`\n\nThe value will be used as the base directory for resolving patterns.\n\n## Contributing\n\n### Prerequisites\n\n-   [nodejs](https://nodejs.org)\n-   [npm](https://npmjs.org)\n\n### Getting Started\n\nAfter cloning this repo, ensure dependencies are installed by running:\n\n```sh\nnpm install\n```\n\nThen to build the final bundle:\n\n```sh\nnpm run build\n```\n\n### Tests\n\nTo run tests:\n\n```sh\nnpm test\n```\n\nTo run tests with coverage report:\n\n```sh\nnpm run test:coverage\n```\n\nCoverage report is located in `tests/coverage`.\n\n### Commiting changes\n\nPlease follow the [conventional commits](https://www.conventionalcommits.org) specification, because [semantic-release](https://github.com/semantic-release/semantic-release) is used to automate the whole package release workflow including: determining the next version number, generating the release notes and publishing the package.\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frecursive-beast%2Frollup-plugin-external-assets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frecursive-beast%2Frollup-plugin-external-assets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frecursive-beast%2Frollup-plugin-external-assets/lists"}