vue2使用openlayers10.3.0版本组包
"node-polyfill-webpack-plugin": "2.0.1",
"@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-plugin-eslint": "~5.0.0",
"@vue/cli-service": "~5.0.0",
"node-polyfill-webpack-plugin": "2.0.1",
"ol": "^10.3.0",
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset',
['@babel/preset-env', { modules: false }]
],
plugins: [
[
'component',
{
libraryName: 'element-ui',
styleLibraryName: 'theme-chalk'
}
]
]
}
module.exports = defineConfig({
transpileDependencies: ['ol'],
lintOnSave: false,
configureWebpack: {
devtool: !isProduction ? 'source-map' : false,
plugins: [new NodePolyfillPlugin()],
},
devServer: {
client: {
overlay: false // 禁用全局错误提示
},
port: 8151,
host: '0.0.0.0',
open: true,
proxy: {
'/api': {
target: devProxyUrl,
// 是否开启请求证书效验
secure: false,
changeOrigin: true,
overlay: {
warnings: false,
errors: true
},
pathRewrite: {
'^/api': ''
}
}
}
}
})