arcgis-maps-demo/vue.config.js

34 lines
1.1 KiB
JavaScript
Raw Permalink Normal View History

2024-04-10 09:11:57 +08:00
const { defineConfig } = require('@vue/cli-service')
2024-05-14 17:16:50 +08:00
//配置@为src的别名
2024-04-16 17:29:27 +08:00
const path = require('path')
function resolve(dir){
return path.join(__dirname,dir)
}
2024-05-14 17:16:50 +08:00
// 配置cesium资源文件
const CopyWebpackPlugin = require('copy-webpack-plugin')
const webpack = require('webpack')
let cesiumSource = './node_modules/cesium/Source'
let cesiumWorkers = '../Build/Cesium/Workers'
2024-04-10 09:11:57 +08:00
module.exports = defineConfig({
2024-04-11 17:23:39 +08:00
transpileDependencies: true,
2024-04-16 17:29:27 +08:00
lintOnSave:false,
chainWebpack:(config)=>{
config.resolve.alias
.set("@",resolve('src'))
2024-05-14 17:16:50 +08:00
},
configureWebpack:{
plugins: [
new CopyWebpackPlugin({patterns:[{ from: path.join(cesiumSource, cesiumWorkers), to: 'Workers' }]}),
new CopyWebpackPlugin({patterns:[{ from: path.join(cesiumSource, 'Assets'), to: 'Assets' }]}),
new CopyWebpackPlugin({patterns:[{ from: path.join(cesiumSource, 'Widgets'), to: 'Widgets' }]}),
new CopyWebpackPlugin({patterns:[{ from: path.join(cesiumSource, 'ThirdParty/Workers'), to: 'ThirdParty/Workers' }]}),
new webpack.DefinePlugin({
CESIUM_BASE_URL: JSON.stringify('./')
})
],
2024-04-16 17:29:27 +08:00
}
2024-05-14 17:16:50 +08:00
2024-04-10 09:11:57 +08:00
})