-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
47 lines (42 loc) · 1022 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
35
36
37
38
39
40
41
42
43
44
45
46
47
const path = require('path');
const webpack = require('webpack');
// var HtmlWebpackPlugin = require('html-webpack-plugin');
// var HtmlWebpackPluginConfig = new HtmlWebpackPlugin({
// template: __dirname + '/app/index.html',
// filename: 'index.html',
// inject: 'body'
// });
module.exports = {
context: __dirname + '/src',
entry: [
'webpack-hot-middleware/client?path=/__webpack_hmr&timeout=20000',
'./app.js',
],
output: {
filename: 'app.js',
path: __dirname + '/dist',
},
resolve: {
extensions: ['.js', '.jsx', '.json'],
},
module: {
rules: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
use: ['react-hot-loader/webpack', 'babel-loader'],
}, {
test: /\.html?$/,
use: 'file-loader?name=[name].[ext]',
},
{
test: /\.css?$/,
use: ['style-loader', 'css-loader'],
},
],
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
],
};