在build目录下的webpack.base.conf.js文件最后添加一下语句

node: {
    // prevent webpack from injecting useless setImmediate polyfill because Vue
    // source contains it (although only uses it if it's native).
    setImmediate: false,
    // prevent webpack from injecting mocks to Node native modules
    // that does not make sense for the client
    dgram: 'empty',
    fs: 'empty',
    net: 'empty',
    tls: 'empty',
    child_process: 'empty'
  },
  externals: {
    'AMap': 'AMap',
    "BMap": "BMap"
  }
Logo

前往低代码交流专区

更多推荐