-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.config.js
55 lines (51 loc) · 1.55 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
50
51
52
53
54
55
// Boilerplate stolen from
// https://github.com/jbinto/redux-voting-client/blob/b53a33b0cab9454c016fbaf53d9823fc7c623d78/webpack.config.js
// https://webpack.github.io/docs/configuration.html
var webpack = require('webpack');
module.exports = {
entry: [
// react-hot-loader: http://gaearon.github.io/react-hot-loader/getstarted/
'webpack-dev-server/client?http://localhost:8080', // "client-side library of the Webpack dev server"
'webpack/hot/only-dev-server', // "Webpack hot module loader"
'./src/index.js',
],
module: {
loaders: [
{
// babel: https://babeljs.io/docs/setup/#webpack
// https://github.com/babel/babel-loader
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'react-hot!babel' // react-hot-loader
},
{
// css-loader: https://github.com/webpack/css-loader
// style-loader: https://github.com/webpack/style-loader
// autoprefixer-loader: https://github.com/passy/autoprefixer-loader#usage
test: /.css$/,
loader: 'style!css!autoprefixer?browsers=last 2 versions'
},
{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'eslint-loader'
}
]
},
// https://webpack.github.io/docs/configuration.html#resolve-extensions
resolve: {
extensions: ['', '.js', '.jsx']
},
output: {
path: __dirname + '/dist',
publicPath: '/',
filename: 'bundle.js'
},
devServer: {
contentBase: './dist',
hot: true
},
plugins: [
new webpack.HotModuleReplacementPlugin()
]
};