代码拉取完成,页面将自动刷新
const { defineConfig } = require('@vue/cli-service')
// The path to the CesiumJS source code
const cesiumSource = 'node_modules/cesium/Source';
const cesiumWorkers = '../Build/Cesium/Workers';
const CopyWebpackPlugin = require('copy-webpack-plugin');
const path = require('path');
const webpack = require('webpack');
module.exports = defineConfig({
transpileDependencies: true,
devServer: {
hot:true, // 它是热更新:只更新改变的组件或者模块,不会整体刷新页面
open: false, // 是否自动打开浏览器
allowedHosts:'all',
// 代理示例
proxy: {
'/3dtiles':{
target:'http://gis.bjcity.net',
ws:true,
changeOrigin:true
},
'/files':{
target:'http://43.138.122.217:8080',
ws:true,
changeOrigin:true
},
'/sswyTiles':{
target:'http://gd.cecc.cn',
ws:true,
changeOrigin:true
},
'/prod-api': {
target: 'http://43.138.122.217:8080',
ws: false,
changeOrigin: true
},
'/model': {
target: 'http://localhost:9003',
ws: false,
changeOrigin: true
}
}
},
configureWebpack: {
output: {
sourcePrefix: ''
},
resolve: {
fallback: { "https": false, "zlib": false, "http": false, "url": false },
mainFiles: ['index', 'Cesium']
},
plugins: [
// Copy Cesium Assets, Widgets, and Workers to a static directory
new CopyWebpackPlugin({
patterns: [
{ from: path.join(cesiumSource, cesiumWorkers), to: 'Workers' },
{ from: path.join(cesiumSource, 'Assets'), to: 'Assets' },
{ from: path.join(cesiumSource, 'Widgets'), to: 'Widgets' }
]
}),
new webpack.DefinePlugin({
// Define relative base path in cesium for loading assets
CESIUM_BASE_URL: JSON.stringify('')
})
],
},
})
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。