Skip to content

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

Closed
@seivan

Description

@seivan

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions