{"id":13447658,"url":"https://github.com/rollup/rollup-plugin-replace","last_synced_at":"2025-03-22T01:31:09.389Z","repository":{"id":48231730,"uuid":"44850334","full_name":"rollup/rollup-plugin-replace","owner":"rollup","description":"This module has moved and is now available at @rollup/plugin-replace / https://github.com/rollup/plugins/blob/master/packages/replace","archived":true,"fork":false,"pushed_at":"2021-08-04T16:28:19.000Z","size":217,"stargazers_count":162,"open_issues_count":2,"forks_count":23,"subscribers_count":19,"default_branch":"master","last_synced_at":"2024-10-28T13:10:46.620Z","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":null,"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":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-24T03:18:24.000Z","updated_at":"2024-07-21T08:58:05.000Z","dependencies_parsed_at":"2022-09-15T12:11:24.959Z","dependency_job_id":null,"html_url":"https://github.com/rollup/rollup-plugin-replace","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollup%2Frollup-plugin-replace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollup%2Frollup-plugin-replace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollup%2Frollup-plugin-replace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollup%2Frollup-plugin-replace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rollup","download_url":"https://codeload.github.com/rollup/rollup-plugin-replace/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244893423,"owners_count":20527587,"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.699Z","updated_at":"2025-03-22T01:31:09.144Z","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-replace](https://github.com/rollup/plugins). Please update your dependencies. This repository is no longer maintained.\n\n# rollup-plugin-replace\n\n[![](https://img.shields.io/npm/v/rollup-plugin-replace.svg?style=flat)](https://www.npmjs.com/package/rollup-plugin-replace)\n\nReplace strings in files while bundling them.\n\n## Installation\n\n```bash\nnpm install --save-dev rollup-plugin-replace\n```\n\n## Usage\n\nGenerally, you need to ensure that rollup-plugin-replace goes _before_ other things (like rollup-plugin-commonjs) in your `plugins` array, so that those plugins can apply any optimisations such as dead code removal.\n\n```js\n// rollup.config.js\nimport replace from 'rollup-plugin-replace';\n\nexport default {\n\t// ...\n\tplugins: [\n\t\treplace({\n\t\t\tENVIRONMENT: JSON.stringify('production')\n\t\t})\n\t]\n};\n```\n\n## Options\n\n```js\n{\n  // a minimatch pattern, or array of patterns, of files that\n  // should be processed by this plugin (if omitted, all files\n  // are included by default)...\n  include: 'config.js',\n\n  // ...and those that shouldn't, if `include` is otherwise\n  // too permissive\n  exclude: 'node_modules/**',\n\n  // To replace every occurrence of `\u003c@foo@\u003e` instead of every\n  // occurrence of `foo`, supply delimiters\n  delimiters: ['\u003c@', '@\u003e'],\n\n  // All other options are treated as `string: replacement`\n  // replacers...\n  VERSION: '1.0.0',\n  ENVIRONMENT: JSON.stringify('development'),\n\n  // or `string: (id) =\u003e replacement` functions...\n  __dirname: (id) =\u003e `'${path.dirname(id)}'`,\n\n  // ...unless you want to be careful about separating\n  // values from other options, in which case you can:\n  values: {\n    VERSION: '1.0.0',\n    ENVIRONMENT: JSON.stringify('development')\n  }\n}\n```\n\n## Word boundaries\n\nBy default, values will only match if they are surrounded by _word boundaries_ — i.e. with options like this...\n\n```js\n{\n\tchanged: 'replaced';\n}\n```\n\n...and code like this...\n\n```js\nconsole.log('changed');\nconsole.log('unchanged');\n```\n\n...the result will be this:\n\n```js\nconsole.log('replaced');\nconsole.log('unchanged');\n```\n\nIf that's not what you want, specify empty strings as delimiters:\n\n```js\n{\n  changed: 'replaced',\n  delimiters: ['', '']\n}\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frollup%2Frollup-plugin-replace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frollup%2Frollup-plugin-replace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frollup%2Frollup-plugin-replace/lists"}