-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
42 lines (41 loc) · 1.09 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
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const webpack = require('webpack');
module.exports = {
entry: __dirname + "/src/index.js",
output: {
path: __dirname + '/dist',
filename: 'bundle.js',
publicPath: '/'
},
module: {
rules: [
{
test: /\.js$/,
use: ["babel-loader", "eslint-loader"],
exclude: [
/node_modules/
]
},
{
test: /\.html$/,
use: [{ loader: "html-loader", options: { minimize: true } }]
},
]
},
plugins: [
new HtmlWebpackPlugin({
template: __dirname + "/src/public/index.html",
inject: 'body'
}),
new webpack.HotModuleReplacementPlugin(),
new CleanWebpackPlugin()
],
devtool: "inline-source-map",
devServer: {
contentBase: './src/public',
port: 7700,
historyApiFallback: true,
hot: true
}
};