{"id":17963358,"url":"https://github.com/kristerkari/babel-plugin-react-native-platform-specific-extensions","last_synced_at":"2025-06-25T19:02:46.059Z","repository":{"id":66125962,"uuid":"116806859","full_name":"kristerkari/babel-plugin-react-native-platform-specific-extensions","owner":"kristerkari","description":"Allow react-native platform specific extensions to be used for other file types than Javascript.","archived":false,"fork":false,"pushed_at":"2020-05-31T00:05:41.000Z","size":2514,"stargazers_count":13,"open_issues_count":10,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-25T19:02:40.708Z","etag":null,"topics":["babel","babel-plugin","extensions","imports","platform-specific","react-native"],"latest_commit_sha":null,"homepage":null,"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/kristerkari.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-09T11:22:09.000Z","updated_at":"2025-05-27T06:56:37.000Z","dependencies_parsed_at":"2023-07-25T08:30:43.077Z","dependency_job_id":null,"html_url":"https://github.com/kristerkari/babel-plugin-react-native-platform-specific-extensions","commit_stats":{"total_commits":31,"total_committers":3,"mean_commits":"10.333333333333334","dds":0.3548387096774194,"last_synced_commit":"fee9c2aa504770d3f7c2500e9030ab74be4f74a2"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/kristerkari/babel-plugin-react-native-platform-specific-extensions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristerkari%2Fbabel-plugin-react-native-platform-specific-extensions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristerkari%2Fbabel-plugin-react-native-platform-specific-extensions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristerkari%2Fbabel-plugin-react-native-platform-specific-extensions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristerkari%2Fbabel-plugin-react-native-platform-specific-extensions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kristerkari","download_url":"https://codeload.github.com/kristerkari/babel-plugin-react-native-platform-specific-extensions/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristerkari%2Fbabel-plugin-react-native-platform-specific-extensions/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261937022,"owners_count":23232843,"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","extensions","imports","platform-specific","react-native"],"created_at":"2024-10-29T11:35:12.490Z","updated_at":"2025-06-25T19:02:46.039Z","avatar_url":"https://github.com/kristerkari.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# babel-plugin-react-native-platform-specific-extensions\n\n[![NPM version](http://img.shields.io/npm/v/babel-plugin-react-native-platform-specific-extensions.svg)](https://www.npmjs.org/package/babel-plugin-react-native-platform-specific-extensions)\n[![Build Status](https://travis-ci.org/kristerkari/babel-plugin-react-native-platform-specific-extensions.svg?branch=master)](https://travis-ci.org/kristerkari/babel-plugin-react-native-platform-specific-extensions)\n[![Coverage Status](https://coveralls.io/repos/github/kristerkari/babel-plugin-react-native-platform-specific-extensions/badge.svg?branch=master)](https://coveralls.io/github/kristerkari/babel-plugin-react-native-platform-specific-extensions?branch=master)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github)\n[![Greenkeeper badge](https://badges.greenkeeper.io/kristerkari/babel-plugin-react-native-platform-specific-extensions.svg)](https://greenkeeper.io/)\n\nAllow [react-native platform specific extensions](https://facebook.github.io/react-native/docs/platform-specific-code.html#platform-specific-extensions) to be used for other file types than Javascript.\n\nExample:\n\n`import styles from \"./styles.css\";`\n\n* `styles.android.css` \u003c- Android only\n* `styles.ios.css` \u003c- iOS only\n* `styles.native.css` \u003c- Both Android and iOS\n* `styles.css` \u003c- Default. Android, iOS and Web\n\n## Usage\n\n### Step 1: Install\n\n```sh\nyarn add --dev babel-plugin-react-native-platform-specific-extensions\n```\n\nor\n\n```sh\nnpm install --save-dev babel-plugin-react-native-platform-specific-extensions\n```\n\n### Step 2: Configure `.babelrc`\n\nYou must give one or more file extensions inside an array in the plugin options.\n\n```\n{\n  \"presets\": [\n    \"react-native\"\n  ],\n  \"plugins\": [\n    [\"react-native-platform-specific-extensions\", {\n      \"extensions\": [\"css\", \"scss\", \"sass\"],\n    }]\n  ]\n}\n```\n\n## TODO\n\n* Support `require`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkristerkari%2Fbabel-plugin-react-native-platform-specific-extensions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkristerkari%2Fbabel-plugin-react-native-platform-specific-extensions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkristerkari%2Fbabel-plugin-react-native-platform-specific-extensions/lists"}