-
Notifications
You must be signed in to change notification settings - Fork 3
/
webpack.config.js
49 lines (43 loc) · 1.2 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
const {resolve} = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
mode: 'development',
devtool: 'source-map',
entry: './src/app.js',
devServer: {
port: 3000,
host: 'localhost',
inline: true,
hot: true,
historyApiFallback: {
index: 'index.html',
},
contentBase: 'public',
overlay: {
errors: true,
warnings: true,
},
},
module: {
rules: [
{
// Transpile ES6 to ES5 with babel
// Remove if your app does not use JSX or you don't need to support old browsers
test: /\.js$/,
loader: 'babel-loader',
exclude: [/node_modules/]
}
]
},
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')
}
},
plugins: [
new HtmlWebpackPlugin({inject: true,
template: resolve( __dirname, './public/index.html' ),
})
]
};