vue使用百度地图、高德地图引入报错的解决方法

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/haeasringnar/article/details/82289292

在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"
  }

猜你喜欢

转载自blog.csdn.net/haeasringnar/article/details/82289292