代码拉取完成,页面将自动刷新
/*
* @Description: "vueconfig.js配置文件,配置cesium路径"
* @Author: coderqiang
* @Date: 2023-06-06 21:17:52
* @LastEditTime: 2023-06-07 21:33:30
* @LastEditors: coderqiang
*/
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin')
const { defineConfig } = require("@vue/cli-service");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const webpack = require("webpack");
const path = require("path");
let cesiumSource = "./node_modules/cesium/Source"
const cesiumWorkers = '../Build/Cesium/Workers';
module.exports = defineConfig({
transpileDependencies: true,
lintOnSave: false,
publicPath: '/',
configureWebpack: {
output: {
sourcePrefix: " ",
},
amd: {
//Enanble webpack-friendly use of require in Cesium
toUrlUndefined: true,
},
resolve: {
alias: {
"@": path.resolve("src"),
// "/": path.resolve("public")
// cesium: path.resolve(__dirname, cesiumSource),
},
fallback: { "https": false, "zlib": false, "http": false, "url": false },
mainFiles: ['index', 'Cesium']
},
plugins: [
//Copy Cesium Assets, Widgets, and Workers to a static dirctory
new CopyWebpackPlugin({
patterns: [{
from: path.join(cesiumSource, cesiumWorkers),
to: "Workers",
},
{
from: path.join(cesiumSource, "Assets"),
to: "Assets",
},
{
from: path.join(cesiumSource, "Widgets"),
to: "Widgets",
},
{
from: path.join(cesiumSource, "ThirdParty/Workers"),
to: "ThirdParty/Workers",
},
],
}),
new webpack.DefinePlugin({
//Define relate base path in cesium for loading assets
CESIUM_BASE_URL: JSON.stringify("../../"),
}),
new NodePolyfillPlugin()
],
},
});
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。