加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
vue.config.js 1.88 KB
一键复制 编辑 原始数据 按行查看 历史
Zandney 提交于 2022-11-24 21:08 . updata(20221124 21.05)
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('')
})
],
},
})
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化