-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathwebpack.config.js
More file actions
68 lines (65 loc) · 1.66 KB
/
webpack.config.js
File metadata and controls
68 lines (65 loc) · 1.66 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
/*
* Copyright © 2017-2019 HERE Europe B.V.
* Licensed under Apache 2.0, see full license in LICENSE
* SPDX-License-Identifier: Apache-2.0
*/
require('dotenv-safe').config()
const path = require('path')
const webpack = require('webpack')
const CopyWebpackPlugin = require('copy-webpack-plugin')
module.exports = [
{
target: 'webworker',
entry: './src/quantized-mesh-decoder-worker.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'quantized-mesh-decoder.bundle.js'
},
devServer: {
contentBase: path.join(__dirname, './'),
publicPath: '/dist/'
},
externals: {
three: 'THREE'
},
devtool: 'source-map'
},
{
target: 'webworker',
entry: './src/png-decoder-worker.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'png-decoder.bundle.js'
},
devServer: {
contentBase: path.join(__dirname, './'),
publicPath: '/dist/'
},
devtool: 'source-map'
},
{
devServer: {
contentBase: path.join(__dirname, './'),
publicPath: '/dist/'
},
devtool: 'source-map',
entry: './src/app.js',
externals: {
three: 'THREE'
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'app.bundle.js'
},
plugins: [
new CopyWebpackPlugin([
{ from: './node_modules/three', to: './three' }
]),
new webpack.DefinePlugin({
'process.env.APP_ID': JSON.stringify(process.env.APP_ID),
'process.env.APP_CODE': JSON.stringify(process.env.APP_CODE),
'process.env.CESIUM_USER_ACCESS_TOKEN': JSON.stringify(process.env.CESIUM_USER_ACCESS_TOKEN)
})
]
}
]