-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathwebpack.config.js
39 lines (39 loc) · 1.21 KB
/
webpack.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
39
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const cesiumSource = 'node_modules/cesium/Source';
const cesiumWorkers = '../Build/Cesium/Workers';
module.exports = [{
context: __dirname,
entry: {
app: './src/index.js'
},
output: {
filename: './dist/bundle.js'
},
amd: {
toUrlUndefined: true
},
node: {
fs: "empty"
},
module: {
rules: [{
test: /\.css$/,
use: ['style-loader', 'css-loader']
}, {
test: /\.(png|gif|jpg|jpeg|svg|xml|json)$/,
use: ['url-loader']
}]
},
plugins: [
new CopyWebpackPlugin([{from: path.join(cesiumSource, cesiumWorkers), to: 'dist/Workers'}]),
new CopyWebpackPlugin([{from: path.join(cesiumSource, 'Assets'), to: 'dist/Assets'}]),
new CopyWebpackPlugin([{from: path.join(cesiumSource, 'Widgets'), to: 'dist/Widgets'}]),
new CopyWebpackPlugin([{from: 'src/index.html', to: 'dist/index.html'}]),
new webpack.DefinePlugin({
CESIUM_BASE_URL: JSON.stringify('')
})
]
}];