1.1.1 • Published 7 years ago
babel-plugin-react-native-platform-specific-extensions v1.1.1
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 onlystyles.ios.css<- iOS onlystyles.native.css<- Both Android and iOSstyles.css<- Default. Android, iOS and Web
Usage
Step 1: Install
yarn add --dev babel-plugin-react-native-platform-specific-extensionsor
npm install --save-dev babel-plugin-react-native-platform-specific-extensionsStep 2: Configure .babelrc
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"],
}]
]
}TODO
- Support
require.