Allow react-native platform specific extensions to be used for other file types than Javascript.
npm install babel-plugin-react-native-platform-specific-extensions




Allow react-native platform specific extensions to be used for other file types than Javascript.
Example:
import styles from "./styles.css";
* styles.android.css <- Android only
* styles.ios.css <- iOS only
* styles.native.css <- Both Android and iOS
* styles.css <- Default. Android, iOS and Web
``sh`
yarn add --dev babel-plugin-react-native-platform-specific-extensions
or
`sh`
npm install --save-dev babel-plugin-react-native-platform-specific-extensions
You must give one or more file extensions inside an array in the plugin options.
``
{
"presets": [
"react-native"
],
"plugins": [
["react-native-platform-specific-extensions", {
"extensions": ["css", "scss", "sass"],
}]
]
}
* Support require`.