-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwebpack.config.js
More file actions
76 lines (73 loc) · 1.83 KB
/
webpack.config.js
File metadata and controls
76 lines (73 loc) · 1.83 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
const path = require("path");
const webpack = require("webpack");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const cesiumSource = '/node_modules/cesium/Build/Cesium';
module.exports = {
context: path.join(__dirname, "demo"),
entry: "./scripts/index.ts",
output: {
path: "/dist",
publicPath: "/dist",
filename: "demo.js",
libraryTarget: "umd",
sourcePrefix: ''
},
node: {
fs: 'empty'
},
amd: {
toUrlUndefined: true
},
resolve: {
extensions: ['.ts', '.js', '.html', '.webpack.js', '.web.js', '.css']
},
module: {
unknownContextCritical: false,
rules: [
{
test: /\.tsx?$/,
loader: "ts-loader"
}, {
test: /\.less$/,
use: ["style-loader", "css-loader", "less-loader"]
}, {
test: /\.css$/,
use: ["style-loader", "css-loader"]
}, {
test: /\.svg$/,
loader: "svg-url-loader",
options: { limit: 10000 }
}, {
test: require.resolve("./app/vendor/earth-api-utility-library/extensions.js"),
loader: "exports-loader?window.GEarthExtensions"
},
{ test: /\.(jpe?g|png|kml|gif|jpg|ico)$/, loader: "url-loader", options: { limit: 10000 } }
]
},
plugins: [
new CopyWebpackPlugin([{
from: path.join(__dirname, cesiumSource, 'Workers'),
to: path.join(__dirname, 'demo/Workers')
}, {
from: path.join(__dirname, cesiumSource, 'Assets'),
to: path.join(__dirname, 'demo/Assets')
}, {
from: path.join(__dirname, cesiumSource, 'Widgets'),
to: path.join(__dirname, 'demo/Widgets')
},{
from: path.join(__dirname, cesiumSource, 'ThirdParty'),
to: path.join(__dirname, 'demo/ThirdParty')
}]),
new webpack.DefinePlugin({
CESIUM_BASE_URL: JSON.stringify('/')
})
],
devtool: "inline-source-map",
devServer: {
inline: true,
hot: true,
contentBase: path.join(__dirname, "demo"),
port: 88
},
mode: "development"
};