美文网首页
Error: Can't resolve 'fs' in (we

Error: Can't resolve 'fs' in (we

作者: 涅槃快乐是金 | 来源:发表于2018-09-29 17:52 被阅读0次

    前言,在之前有配置过webpack 2 中css loaders,但是怎么也不正确

    报错:

    ERROR in ./~/convert-source-map/index.js
    Module not found: Error: Can't resolve 'fs' in '/Users/ceshi/Desktop/webpack/node_modules/convert-source-map'
     @ ./~/convert-source-map/index.js 2:9-22
     @ ./~/css-loader/lib/css-base.js
     @ ./~/css-loader!./app/style.css
     @ ./app/style.css
     @ ./app/main.js
    

    解决方法,修改webpack的配置文件,增加一句代码

     node: {
            fs: 'empty'
        },
    

    相关文章

      网友评论

          本文标题:Error: Can't resolve 'fs' in (we

          本文链接:https://www.haomeiwen.com/subject/babugftx.html