Whats the difference when configuring webpack babel-loader vs configuring it within package.json?

馋奶兔 提交于 2019-11-29 10:54:46

Webpack config :

config the babel-loader completely in webpack.conf.js (no .babelrc).

Webpack config + .babelrc :

Enable the babel-loader in webpack.conf.js, let the options object be empty. Configure the options in a .babelrc. Webpack will use the babel-loader with the options given in .babelrc.

you can remove the webpack presets options if you have a .babelrc, because babel-loader uses babel, which obviously respects the .babelrc.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!