{"id":13447662,"url":"https://github.com/rollup/rollup-plugin-url","last_synced_at":"2025-03-22T01:31:10.053Z","repository":{"id":48229551,"uuid":"51271008","full_name":"rollup/rollup-plugin-url","owner":"rollup","description":"This module has moved and is now available at @rollup/plugin-url / https://github.com/rollup/plugins/blob/master/packages/url","archived":true,"fork":false,"pushed_at":"2021-08-04T17:26:20.000Z","size":120,"stargazers_count":75,"open_issues_count":0,"forks_count":19,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-10-15T12:03:16.760Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rollup.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}},"created_at":"2016-02-07T23:10:27.000Z","updated_at":"2024-04-22T09:48:16.000Z","dependencies_parsed_at":"2022-09-26T16:31:25.960Z","dependency_job_id":null,"html_url":"https://github.com/rollup/rollup-plugin-url","commit_stats":null,"previous_names":["swatinem/rollup-plugin-url"],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollup%2Frollup-plugin-url","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollup%2Frollup-plugin-url/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollup%2Frollup-plugin-url/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollup%2Frollup-plugin-url/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rollup","download_url":"https://codeload.github.com/rollup/rollup-plugin-url/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244811321,"owners_count":20514276,"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-07-31T05:01:23.784Z","updated_at":"2025-03-22T01:31:09.731Z","avatar_url":"https://github.com/rollup.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Moved\n\nThis module has moved and is now available at [@rollup/plugin-url](https://github.com/rollup/plugins). Please update your dependencies. This repository is no longer maintained.\n\n# rollup-plugin-url\n\nInline import files as data-URIs, or copy them to output\n\n## Install\n\n```sh\nnpm i --save-dev rollup-plugin-url\n```\n\n## Usage\n\n```js\nimport {rollup} from \"rollup\"\nimport url from \"rollup-plugin-url\"\n\nconst writeoptions = {dest: \"output/output.js\"}\nconst plugin = url({\n  limit: 10 * 1024, // inline files \u003c 10k, copy files \u003e 10k\n  include: [\"**/*.svg\"], // defaults to .svg, .png, .jpg and .gif files\n  emitFiles: true // defaults to true\n})\n\nrollup({\n  entry: \"main.js\",\n  plugins: [plugin],\n})\n.then(bundle =\u003e bundle.write(writeoptions))\n```\n\n## Options\n\n### limit\n\nOptional. Type: `number`.\n\nThis is the file size limit to inline files. If files exceed this limit, they\nwill be copied instead to the destination folder and the hashed filename will\nbe given instead. If value set to `0` all files will be copied.\n\nDefaults to 14336 (14kb).\n\n### include / exclude\n\nOptional. Type: a minimatch pattern, or array of minimatch patterns\n\nThese patterns determine which files are inlined. Defaults to .svg, .png, .jpg\nand .gif files.\n\n### publicPath\n\nOptional. Type: `string`\n\nThe `publicPath` will be added in front of file names when they are not inlined\nbut copied.\n\n### emitFiles\n\nOptional. Type: `boolean`\n\nThe `emitFiles` option is used to run the plugin as you normally would but prevents any files being emitted. This is useful for when you are using rollup to emit both a client side and server side bundle.\n\n### fileName\n\nOptional. Type: `string`\n\nWhen `emitFiles` is `true`, the `fileName` option can be used to rename the emitted files. It accepts the following string replacements:\n\n- `[hash]` - The hash value of the file's contents\n- `[name]` - The name of the imported file, without it's file extension\n- `[extname]` - The extension of the imported file, including the leading `.`\n- `[dirname]` - The parent directory name of the imported file, including trailing `/`\n\nDefaults to: `\"[hash][extname]\"`\n\n### sourceDir\n\nOptional. Type: `string`\n\nWhen using the `[dirname]` replacement in `fileName`, uses this directory as the source directory to create the file path from rather than the parent directory of the imported file. For example:\n\n*src/path/to/file.js*\n```js\nimport png from \"./image.png\";\n```\n*rollup.config.js*\n```js\nurl({\n  fileName: \"[dirname][hash][extname]\",\n  sourceDir: path.join(__dirname, \"src\")\n})\n```\nEmitted File: `path/to/image.png`\n\n### destDir\n\nOptional. Type: `string`\n\nThe destination dir to copy assets, usually used to rebase the assets according to HTML files.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frollup%2Frollup-plugin-url","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frollup%2Frollup-plugin-url","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frollup%2Frollup-plugin-url/lists"}