webpack 打包编译nodejs 下的fs等模块报错问题

webpackconfig.js配置文件

const path = require('path');

module.exports = {
  entry: './main.js',
  output: {
    filename: 'main.bundle.js',
    path: path.resolve(__dirname, 'dist')
  },
  target: 'node',
  node:{
      fs:'empty',
      child_process:'empty',
     
  }
};

你可能感兴趣的:(webpack 打包编译nodejs 下的fs等模块报错问题)