-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.config.js
62 lines (61 loc) · 1.49 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
const resolve = require('path').resolve;
const join = require('path').join;
const webpack = require('webpack');
const dotenv = require('dotenv');
const env = dotenv.config().parsed;
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin')
module.exports = {
mode: 'production',
entry: './src',
output: {
path: __dirname + '/dist',
filename: 'bundle.js'
},
devtool: 'source-map',
devServer: {
contentBase: __dirname + '/dist/',
compress: false,
port: 9000
},
module: {
rules: [
{
// Compile ES2015 using buble
test: /\.js$/,
loader: 'buble-loader',
include: [resolve('.')],
exclude: [/node_modules/],
options: {
objectAssign: 'Object.assign'
}
},
{
test: /\.css$/,
use: ['style-loader','css-loader'],
}
]
},
resolve: {
alias: {
// From mapbox-gl-js README. Required for non-browserify bundlers (e.g. webpack):
'mapbox-gl$': resolve('./node_modules/mapbox-gl/dist/mapbox-gl.js')
}
},
// Optional: Enables reading mapbox token from environment variable
plugins: [
new webpack.EnvironmentPlugin(['MapboxAccessToken']),
new HtmlWebpackPlugin({
title: 'deck.gl example',
filename: 'index.html',
template: 'src/html/index_template.html',
}),
new CopyWebpackPlugin(
['./src/json/buildings.json','./src/json/stations.json','./src/json/trips_sample.json']
)
],
optimization: {
// We no not want to minimize our code.
minimize: false
},
}