Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(feat request) Support options inside babel-preset-react-app #2985

Closed
mgcrea opened this issue Aug 21, 2017 · 1 comment
Closed

(feat request) Support options inside babel-preset-react-app #2985

mgcrea opened this issue Aug 21, 2017 · 1 comment

Comments

@mgcrea
Copy link

mgcrea commented Aug 21, 2017

Is this a bug report?

No

Feature description

I'm currently building a component library with create-react-app, basically, I'm simply building my components with babel for them to be imported by another app, something like:

"build": "rimraf lib/*; NODE_ENV=production babel src/components --out-dir lib/ --ignore '__tests__/**'",

However, for this to work, I need to compile modules to commonjs so they don't have to be re-processed again by the parent app.

Therefore, it would be great to have the ability to pass a module option like what's existing for other presets:

"presets": [["es2015", {"modules": false}], "react"],

Directly to the react-app preset:

"presets": [["react-app", {"modules": "commonjs"}]],

Therefore I could easily keep create-react-app babel's preset but actually build components exactly how I want them.

Changes are trivial, will PR on demand.

Thanks!

@Timer
Copy link
Contributor

Timer commented Aug 21, 2017

Please see #1415 (comment).
We're not ready to do this, (yet)! I'm really sorry, it has come up multiple times before so maybe you can help push #1249 along?

@Timer Timer closed this as completed Aug 21, 2017
@lock lock bot locked and limited conversation to collaborators Jan 21, 2019
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