Cannot resolve module 'child_process'

来源:互联网 发布:51单片机ad转换 编辑:程序博客网 时间:2024/05/22 15:13
ERROR in ./~/xmlhttprequest/lib/XMLHttpRequest.jsModule not found: Error: Cannot resolve module 'child_process' in D:\workspace\wosoPro\node_modules\xmlhttprequest\lib @ ./~/xmlhttprequest/lib/XMLHttpRequest.js 15:12-36Child html-webpack-plugin for "index.html":    chunk    {0} index.html 541 kB [rendered]        [0] ./~/html-webpack-plugin/lib/loader.js!./index.html 1.71 kB {0} [built]        [1] ./~/lodash/lodash.js 539 kB {0} [built]        [2] (webpack)/buildin/module.js 241 bytes {0} [built]

解决方法:

解决问题的图片

在webpack.base.config.js文件中添加:

externals: [{   xmlhttprequest:'{XMLHttpRequest:XMLHttpRequest}'}]

参考来源:https://github.com/webpack/webpack-dev-server/issues/66