{"id":18264881,"url":"https://github.com/bem/webpack-feature-flags-plugin","last_synced_at":"2025-04-09T01:42:26.637Z","repository":{"id":55609044,"uuid":"322286904","full_name":"bem/webpack-feature-flags-plugin","owner":"bem","description":null,"archived":false,"fork":false,"pushed_at":"2020-12-18T10:02:03.000Z","size":2,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":23,"default_branch":"main","last_synced_at":"2025-02-14T19:54:07.238Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/bem.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2020-12-17T12:22:47.000Z","updated_at":"2024-10-03T01:23:38.000Z","dependencies_parsed_at":"2022-08-15T04:20:27.048Z","dependency_job_id":null,"html_url":"https://github.com/bem/webpack-feature-flags-plugin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bem%2Fwebpack-feature-flags-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bem%2Fwebpack-feature-flags-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bem%2Fwebpack-feature-flags-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bem%2Fwebpack-feature-flags-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bem","download_url":"https://codeload.github.com/bem/webpack-feature-flags-plugin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247958710,"owners_count":21024821,"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-11-05T11:16:22.143Z","updated_at":"2025-04-09T01:42:26.610Z","avatar_url":"https://github.com/bem.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# webpack-feature-flags-plugin\n\nWebpack plugin for Feature Flags development.\n\n### Usage\n\n1. Add plugin in webpack config\n\n```js\n\n  plugins: [\n    new FeatureFlagsWebpackPlugin([\n      {\n        value: 'FEATURE_1',\n        component: 'Button',\n      },\n    ]),\n  ],\n\n```\n\n2. Create a function that returns false by default\n\n```ts\nexport function isFeatureEnabled(_feature: { value: string; component: string }): boolean {\n  return false\n}\n```\n\n3. Add new feature in your component. The plugin checking the call `isFeatureEnabled` function and replaces its call to `true` or `false`, depending on the flag passed to it\n\n```tsx\nimport React from 'react';\n\nexport const Button = () =\u003e {\n    if (isFeatureEnabled({ value: 'FEATURE_1', component: 'Button' })) {\n        return \u003cbutton\u003eButton with new feature\u003c/button\u003e\n    }\n\n    return \u003cbuttton\u003eRegular button\u003c/button\u003e\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbem%2Fwebpack-feature-flags-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbem%2Fwebpack-feature-flags-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbem%2Fwebpack-feature-flags-plugin/lists"}