-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathvue.config.js
38 lines (37 loc) · 1.38 KB
/
vue.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// vue.config.js
const CopyWebpackPlugin = require("copy-webpack-plugin");
const NodePolyfillPlugin = require("node-polyfill-webpack-plugin");
const webpack = require("webpack");
module.exports = {
publicPath:
process.env.NODE_ENV === "production" ? "/\n" + "vue-cesium-example/" : "/",
configureWebpack: {
node: {},
plugins: [
// Copy Cesium Assets, Widgets, and Workers to a static directory
new CopyWebpackPlugin({
patterns: [
{ from: "node_modules/cesium/Build/Cesium/Workers", to: "Workers" },
{
from: "node_modules/cesium/Build/Cesium/ThirdParty",
to: "ThirdParty",
},
{ from: "node_modules/cesium/Build/Cesium/Assets", to: "Assets" },
{ from: "node_modules/cesium/Build/Cesium/Widgets", to: "Widgets" },
],
}),
new NodePolyfillPlugin(),
new webpack.DefinePlugin({
// Define relative base path in cesium for loading assets
CESIUM_BASE_URL: JSON.stringify(""),
}),
],
module: {
// Removes these errors: "Critical dependency: require function is used in a way in which dependencies cannot be statically extracted"
// https://github.com/AnalyticalGraphicsInc/cesium-webpack-example/issues/6
unknownContextCritical: false,
unknownContextRegExp:
/\/cesium\/cesium\/Source\/Core\/buildModuleUrl\.js/,
},
},
};