{"id":25690685,"url":"https://github.com/csath/babel-plugin-rn-white-label","last_synced_at":"2025-04-24T04:37:37.155Z","repository":{"id":47371457,"uuid":"225839644","full_name":"csath/babel-plugin-rn-white-label","owner":"csath","description":"Transforms require statements for given custom extensions","archived":false,"fork":false,"pushed_at":"2022-12-04T23:26:44.000Z","size":450,"stargazers_count":4,"open_issues_count":11,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-30T06:51:17.241Z","etag":null,"topics":["babel-plugin","babel-plugin-rn-white-label","react-native","transforming-files"],"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/csath.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":"2019-12-04T10:24:43.000Z","updated_at":"2022-07-27T10:00:39.000Z","dependencies_parsed_at":"2023-01-22T22:35:17.527Z","dependency_job_id":null,"html_url":"https://github.com/csath/babel-plugin-rn-white-label","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csath%2Fbabel-plugin-rn-white-label","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csath%2Fbabel-plugin-rn-white-label/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csath%2Fbabel-plugin-rn-white-label/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csath%2Fbabel-plugin-rn-white-label/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/csath","download_url":"https://codeload.github.com/csath/babel-plugin-rn-white-label/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250566357,"owners_count":21451227,"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-plugin","babel-plugin-rn-white-label","react-native","transforming-files"],"created_at":"2025-02-24T22:50:49.486Z","updated_at":"2025-04-24T04:37:37.137Z","avatar_url":"https://github.com/csath.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# babel-plugin-rn-white-label   [![npm](https://img.shields.io/npm/v/babel-plugin-rn-white-label.svg)](https://npmjs.com/package/babel-plugin-rn-white-label)  [![npm](https://img.shields.io/npm/dm/babel-plugin-rn-white-label.svg)](https://npmjs.com/package/babel-plugin-rn-white-label)\r\n\r\nTransforms require statements for given custom extensions:\r\n\r\n_This plugin was originally created for [react-native-white-label](https://github.com/csath/react-native-white-label) library._\r\n\r\n## What plugin does?\r\n\r\nModify `require` statements according to specified options.\r\n\r\nIf you have `img.png` asset as follows using custom extensions,\r\n\r\n![Image of Assets](https://github.com/csath/babel-plugin-rn-white-label/blob/master/screenshots/assets.png)\r\n\r\nand if you want to bundle different files without modifiying the code,\r\n\r\n`require('./src/img.png')`\r\n\r\nfor specific configs you are running your application, pass following options to babel plugin.\r\n\r\n``\r\n{ \r\n      mask: 'csa', \r\n      exts: [\"png\", \"jpeg\", \"gif\"]\r\n}\r\n``\r\n\r\nIf `src` directory has `img.csa.png` bundler will pick up it or if `img.csa.png` is not available it'll pick up `img.png`\r\n\r\n#### Options\r\n\r\n| Attribute     | Data type     | Description    |\r\n| ------------- | ------------- | ------------- |\r\n| mask          | String \\| \"\"   | Custom extension (eg: 'csa' to pick up `for abc.csa.png`)        |\r\n| exts          | String Array \\| [] | Extensions to be modified (eg: ['png', 'jpeg']) |\r\n\r\n## Installation\r\n\r\n```to be modified\r\nnpm install --save-dev babel-plugin-rn-white-label\r\n```\r\nor\r\n```\r\nyarn add -D babel-plugin-rn-white-label\r\n```\r\n\r\n## Usage\r\n\r\n`babel.config.js`:\r\n\r\n```javascript\r\nmodule.exports = {\r\n  presets: ['module:metro-react-native-babel-preset'],\r\n  plugins: [\r\n    ['rn-white-label', { \r\n      mask: 'csa', \r\n      exts: [\"png\", \"jpeg\", \"gif\"]\r\n    }\r\n    ]\r\n  ]\r\n};\r\n```\r\n\r\nor\r\n\r\n`.babelrc`:\r\n\r\n```json\r\n{\r\n  \"plugins\": [\r\n    [\"rn-white-label\", {\r\n      \"mask\": \"csa\",\r\n      \"exts\": [\"png\", \"jpeg\", \"gif\"]\r\n     }\r\n    ]\r\n  ]\r\n}\r\n```\r\n\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsath%2Fbabel-plugin-rn-white-label","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsath%2Fbabel-plugin-rn-white-label","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsath%2Fbabel-plugin-rn-white-label/lists"}