webpack 打包异常 UglifyJs Unexpected token: name (result)

ERROR in static/js/vendor.cd343368afc930cacc1d.js from UglifyJs
Unexpected token: name (result) [./node_modules/_asn1.js@5.4.1@asn1.js/lib/asn1/base/node.js:282,0][static/js/vendor.cd343368afc930cacc1d.js:31281,6]

Build failed with errors.

起因:

项目新安装js-md5和node-rsa依赖包,打包出现了这个报错

原因:

使用webpack打包的时候会出现Unexpected token: name的问题,
是因为在webpack.config.js中的loaders过滤了node_modules,但是有依赖的模块需要进行babel处理

解决方案:

webpack.base.conf.js

参考地址:https://www.codeleading.com/article/75975323194/

原文地址:https://www.cnblogs.com/zhaomeizi/p/14721455.html