Code Monkey home page Code Monkey logo

Comments (4)

vitalets avatar vitalets commented on June 15, 2024

Hi @gwmccull ,

It's good point. As React Native applies Babel to node_modules I think the best solution is to put separate .babelrc into app directory:

{
  "plugins": [
    "babel-plugin-runtyper"
  ]
}

In that case runtyper will be applied only to application files.
I think I should add this to readme.

Please let me know is it works for you.

from babel-plugin-runtyper.

gwmccull avatar gwmccull commented on June 15, 2024

@vitalets yes, that worked.

If anyone else needs to do this, you'll need to copy the .babelrc file from your root, create a 2nd .babelrc file in /app/ and add the babel-plugin-runtyper to this 2nd file.

The new /app/.babelrc file will substitute for the original; it does not add to the original.

from babel-plugin-runtyper.

vitalets avatar vitalets commented on June 15, 2024

Hmm.. it's interesting. Did not notice this, thanks.
I will investigate as duplicating .babelrc looks not pretty to me.
But I see several issues related to such behavior in RN collected here:
facebook/react-native#7821

from babel-plugin-runtyper.

vitalets avatar vitalets commented on June 15, 2024

@gwmccull what version of RN are you using?
I've tested on 0.44 and nested .babelrc files are merged.
But I found that such behavior was removed in favor of extends property. Could you try this:

{
  "extends": "../.babelrc",
  "plugins": [
    "babel-plugin-runtyper"
  ]
}

PS: when checking I re-run packager every time with --reset-cache option to clear cache.

from babel-plugin-runtyper.

Related Issues (12)

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.