-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
executable file
·45 lines (43 loc) · 1.18 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
var Webpack = require('webpack');
var path = require('path');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var config = {
devtool: 'eval-source-map',
entry: [
'webpack-dev-server/client?http://localhost:3000',
'webpack/hot/dev-server',
'./src/index.js'
],
output: {
path: path.resolve(__dirname, 'build'),
filename: 'bundle.js',
publicPath: '/build/' // This HAS to point to the build path in order for hot reload to work
},
module: {
loaders: [{
test: /\.js$/,
loaders: ['react-hot', 'babel?stage=0&optional=runtime'],
include: path.join(__dirname, 'src')
}, {
test: /\.css$/,
loader: 'style-loader!css-loader!autoprefixer-loader',
include: path.join(__dirname, 'src')
}, {
test: /\.styl$/,
loader: 'style-loader!css-loader!autoprefixer-loader!stylus-loader',
include: path.join(__dirname, 'src')
}]
},
resolve: {
extensions: ['', '.js', '.json', '.css', 'styl']
},
plugins: [
new Webpack.HotModuleReplacementPlugin(),
new Webpack.NoErrorsPlugin(),
new HtmlWebpackPlugin({
title: 'My App',
filename: 'index.html'
})
]
};
module.exports = config;