-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack-demo.config.js
49 lines (46 loc) · 951 Bytes
/
webpack-demo.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
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var config = {
entry: [
'webpack/hot/dev-server',
'./todo-demo.js'
],
devServer: {
contentBase: 'src/www',
port: 3000,
hot: true,
inline: true,
historyApiFallback: true,
stats: 'errors-only'
},
devtool: '#source-map',
output: {
path: './build',
filename: 'index.js',
publicPath: '/'
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
new HtmlWebpackPlugin()
],
module: {
preLoaders: [
{
test: /\.(js|jsx)$/,
loader: 'eslint-loader',
include: ["./src/js"],
exclude: /node_modules/
},
],
loaders: [
{
test: /\.(js|jsx)$/,
loaders: ['react-hot', 'babel'],
exclude: /node_modules/
}
]
},
eslint: { configFile: '.eslintrc' }
};
module.exports = config;