Skip to content
This repository has been archived by the owner on Apr 9, 2020. It is now read-only.

Use without .babelrc #74

Closed
IanVS opened this issue Jan 7, 2016 · 4 comments
Closed

Use without .babelrc #74

IanVS opened this issue Jan 7, 2016 · 4 comments

Comments

@IanVS
Copy link

IanVS commented Jan 7, 2016

I'm creating a set of reusable react components, and having a .babelrc file is problematic, so I would like to avoid having one if possible. I cannot figure out how to translate the option objects for transforms into a cli-friendly format. Can this be used without a .babelrc, and if so, how?

@jamiebuilds
Copy link
Collaborator

You should be using a .babelrc file, I have yet to hear a reason its not possible.

@IanVS
Copy link
Author

IanVS commented Jan 7, 2016

I certainly would like to use a .babelrc, except that I've found that if a library has one, the consuming app will try to use it (see this issue). In my development model, I want to use npm link and work concurrently in the library and consuming project rather than frequently publishing to npm, so I can't just add it to my .npmignore. Or, I may move the whole library into my consuming app, but it will still need a unique babel configuration. If you have suggestions of how I could continue using a .babelrc, I'd love to know how.

@ghost
Copy link

ghost commented Jan 7, 2016

@IanVS You can use the babel presets on the cli pretty easily to support your specific use case here.

You can use https://github.com/danmartinez101/babel-preset-react-hmre as an example.

Then just babel --presets react-hmre or babel --presets your-version

n.b. this is just working around the issue as described in the react-native issue of course

@IanVS
Copy link
Author

IanVS commented Jan 7, 2016

@danmartinez101, nice! That looks perfect, thank you.

@IanVS IanVS closed this as completed Jan 7, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants