GithubHelp home page GithubHelp logo

salakar / babel-preset-react-native-syntax Goto Github PK

View Code? Open in Web Editor NEW

This project forked from invertase/babel-preset-react-native-syntax

0.0 3.0 0.0 14 KB

📦Babel preset providing syntax only plugins used by babel-preset-react-native - supports React Native ^0.56.0.

License: Other

JavaScript 100.00%

babel-preset-react-native-syntax's Introduction


Babel Preset React Native Syntax

NPM downloads NPM version License Chat Follow on Twitter

This preset includes the latest syntax plugins as specified in babel-preset-react-native.

Latest supported React Native version: ^0.56.0

Latest supported Metro version: ^0.45.0

Latest supported Babel version: ^7.0.0


npm i @invertase/babel-preset-react-native-syntax


This is useful for React Native libraries that want to use Babel plugins that may not be supported by React Native's default preset.

Additionally this allows editing/viewing library source from within node_modules (useful for debugging) as there's no transformation of library code (unless you add any additional transform plugins).

Example Usage

{
  "presets": ["@invertase/react-native-syntax"],
  "plugins": [
    "transform-decorators-legacy"
  ]
}

Options

flow -> 'strip' | 'comment'

Optional: Whether to transform flow syntax by striping it out entirely or comment it out but preserve the /* @flow */ directive and still be able to use flow.

  • strip -> @babel/plugin-transform-flow-strip-types
  • comment -> @babel/plugin-transform-flow-comments
  • undefined -> do nothing - flow syntax remains untouched

Example

{
  "presets": [
    "@invertase/react-native-syntax",
    {
      "flow": "comment"
    }
  ],
  "plugins": [
    "transform-decorators-legacy"
  ]
}

Credits

babel-preset-react-native-syntax's People

Contributors

salakar avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.