为什么vue用cesium比原生vue界面要暗淡一些
1个回答
展开全部
webpack.base.conf.js
添加代码
const CopyWebpackPlugin = require('copy-webpack-plugin')
// The path to the Cesium source code
const cesiumSource = path.resolve(__dirname, '../node_modules/cesium/Source')
const cesiumWorkers = '../Build/Cesium/Workers'
output: {
// Needed to compile multiline strings in Cesium
sourcePrefix: '',
}
alias: {
// Cesium module name
'cesium': path.resolve(__dirname, cesiumSource),
}
module: {
unknownContextCritical: false,
rules: [
{
test: /\.js$/,
loader: 'babel-loader',
include: [resolve('src'), resolve('test'),resolve('node_modules/webpack-dev-server/client')]
}
]
}
plugins: [
// Copy Cesium Assets, Widgets, and Workers to a static directory
new CopyWebpackPlugin([ {
//from: path.join(cesiumSource, 'Workers'),
from: path.join(cesiumSource, cesiumWorkers),
to: 'Workers' } ]),
new CopyWebpackPlugin([ {
from: path.join(cesiumSource, 'Assets'),
to: 'Assets' } ]),
new CopyWebpackPlugin([ {
from: path.join(cesiumSource, 'Widgets'),
to: 'Widgets' } ]),
]
webpack.dev.conf.js
const path = require('path')
const CopyWebpackPlugin = require('copy-webpack-plugin')
devServer: {
// historyApiFallback: true
historyApiFallback: { rewrites: [ { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, ], },
contentBase: config.build.assetsRoot, // for Cesium
}
plugins: [
new webpack.DefinePlugin({
'process.env': require('../config/dev.env'),
// Define relative base path in cesium for loading assets
CESIUM_BASE_URL: JSON.stringify('/') }),
// copy custom static assets
new CopyWebpackPlugin([ { from: path.resolve(__dirname, '../static'), to: config.dev.assetsSubDirectory, ignore: ['.*'] } ]),
]
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询