While using babel it's recommended to ignore node_modules folder. But then those libraries in node_modules are not passing through babel and as result you get code some of which complies with babel presets and some not. For example, if one wants to target ES5, that will not work if any of the libraries in node_modules are not ES5 compliant.
What is the recommended way?
It's correct not to run the node_modules folder through babel, because of two reasons:
So unless you use specific modules, or you need compatibility with older browsers, you'll be fine with ignoring the node_modules
folder.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.