Socket
Socket
Sign inDemoInstall

babel-plugin-react-native-platform-specific-extensions

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-react-native-platform-specific-extensions

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


Version published
Weekly downloads
3.2K
decreased by-2.67%
Maintainers
1
Weekly downloads
 
Created
Source

babel-plugin-react-native-platform-specific-extensions

NPM version Build Status Coverage Status PRs Welcome Greenkeeper badge

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

Usage

Step 1: Install

yarn add --dev babel-plugin-react-native-platform-specific-extensions

or

npm install --save-dev babel-plugin-react-native-platform-specific-extensions

Step 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.

Keywords

FAQs

Package last updated on 04 Jul 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc