{"id":15041858,"url":"https://github.com/discord/babel-plugin-define-patterns","last_synced_at":"2025-10-19T19:30:25.909Z","repository":{"id":42881465,"uuid":"256100865","full_name":"discord/babel-plugin-define-patterns","owner":"discord","description":"Create constants that replace various expressions at build-time","archived":false,"fork":false,"pushed_at":"2023-07-11T08:32:19.000Z","size":186,"stargazers_count":38,"open_issues_count":14,"forks_count":6,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-10-01T03:40:56.131Z","etag":null,"topics":["babel","babel-plugin","loader","webpack","webpack-loader"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":false,"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/discord.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-16T03:36:20.000Z","updated_at":"2024-08-02T02:22:14.000Z","dependencies_parsed_at":"2024-06-19T04:10:25.709Z","dependency_job_id":"d91a6e80-8543-4bd8-a227-0e8d14f1a664","html_url":"https://github.com/discord/babel-plugin-define-patterns","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"6d975c00a47151d2db9d4f3685deece83fdbf815"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discord%2Fbabel-plugin-define-patterns","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discord%2Fbabel-plugin-define-patterns/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discord%2Fbabel-plugin-define-patterns/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discord%2Fbabel-plugin-define-patterns/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/discord","download_url":"https://codeload.github.com/discord/babel-plugin-define-patterns/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219869272,"owners_count":16555575,"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":["babel","babel-plugin","loader","webpack","webpack-loader"],"created_at":"2024-09-24T20:46:33.730Z","updated_at":"2025-10-19T19:30:25.518Z","avatar_url":"https://github.com/discord.png","language":"JavaScript","readme":"# babel-plugin-define-patterns\n\n\u003e Create constants that replace various expressions at build-time\n\n## Install\n\n```sh\nnpm install --save-dev babel-plugin-define-patterns\n```\n\n## Usage\n\n```js\n// babel.config.json\n{\n  \"plugins\": [\n    [\"define-patterns\", {\n      \"replacements\": {\n        \"process.env.NODE_ENV\": \"production\",\n        \"typeof window\": \"object\",\n        \"__DEV__\": true,\n        \"require('currentBuildNumber')\": 42\n      }\n    }]\n  ]\n}\n```\n\n## Example\n\n**Input:**\n\n```js\nprocess.env.NODE_ENV\n```\n\n**Options:**\n\n```json\n{\n\t\"replacements\": {\n\t\t\"process.env.NODE_ENV\": \"development\"\n\t}\n}\n```\n\n**Output:**\n\n```js\n\"development\"\n```\n\nFor more examples see [input.txt](./fixtures/input.txt) and\n[output.txt](./fixtures/output.txt).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiscord%2Fbabel-plugin-define-patterns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiscord%2Fbabel-plugin-define-patterns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiscord%2Fbabel-plugin-define-patterns/lists"}