-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
34 lines (33 loc) · 765 Bytes
/
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
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
module.exports = {
entry: {
app: path.resolve(__dirname, 'src/js/index.js'),
},
output: {
filename: '[name].bundle.js',
path: path.resolve(__dirname, 'dist'),
clean: true,
},
devServer: {
static: {
directory: path.resolve(__dirname, 'dist'),
},
client: {
overlay: {
errors: true,
warnings: false,
},
},
watchFiles: ['src/**/*'],
port: 8080,
},
plugins: [
new HtmlWebpackPlugin({
filename: 'index.html',
template: path.resolve(__dirname, 'src/views/index.html'),
}),
new CleanWebpackPlugin(),
],
};