Babel does not transpile imported modules from 'node_modules'

后端 未结 2 1208
夕颜
夕颜 2021-02-14 10:54

I got a problem with transpiling imported modules from node_modules. Babel for some reason doesn\'t transpile imported module from node_modules, but tr

2条回答
  •  难免孤独
    2021-02-14 11:37

    To expand upon my comments:

    You really don't want to transpile all of node_modules – it'll take a long time, and most of the code there should already be ES5 (unless they're actually ES6 modules, in which case the ES6 entry point is announced as "module" in the package.json manifest).

    query-string@6.x isn't, and it says so in its README:

    This module targets Node.js 6 or later and the latest version of Chrome, Firefox, and Safari. If you want support for older browsers, use version 5: npm install query-string@5.

提交回复
热议问题