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

Allow user to define what node_modules to transpile down to ES5 #3669

Closed
seivan opened this issue Jan 2, 2018 · 2 comments
Closed

Allow user to define what node_modules to transpile down to ES5 #3669

seivan opened this issue Jan 2, 2018 · 2 comments

Comments

@seivan
Copy link

seivan commented Jan 2, 2018

This is regarding the issue with packages that aren't in ES6

There seems to be a binary choice here were one is forced to eject or pick one of the many solutions (submodule in src/ or fork) to get the package in ES5.

It would be nice if create-react-app started allowing for small hooks without a full blown ejection.
In this case, it be nice to allow what packages would need to be transpiled down to ES5 since they are distributed in ES6.

The main argument I've been reading is that it might open up a whole avenue of bugs since you're deviating from the version the author offers, but that shouldn't matter if it's something one opts into.

Relevant discussion #1125
This comment could be fixed by using something like:

exclude: /node_modules\/(?!(USER_DEFINED_PACKAGE_1| USER_DEFINED_PACKAGE_2)\/).*/

From babel/babel-loader#171 (comment)

@gaearon
Copy link
Contributor

gaearon commented Jan 8, 2018

I don't think we'll allow this in particular.

If we run Babel on node_modules, we should only run the subset of plugins related to JS language features (and not JSX/Flow, for example).

We have an existing issue to track that work: #1125.

@gaearon gaearon closed this as completed Jan 8, 2018
@gaearon
Copy link
Contributor

gaearon commented Jan 13, 2018

FYI, we're starting the work to compile deps with babel-preset-env in Create React App: #3776

Let us know if you have feedback about how this should work.

@lock lock bot locked and limited conversation to collaborators Jan 20, 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