-
Notifications
You must be signed in to change notification settings - Fork 81
/
Copy pathwebpack-dev.config.js
64 lines (61 loc) · 1.5 KB
/
webpack-dev.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
56
57
58
59
60
61
62
63
64
/**
* @author Kuitos
* @homepage https://github.com/kuitos/
* @since 2015-08-06
*/
var path = require('path');
var webpack = require('webpack');
var autoprefixer = require('autoprefixer');
module.exports = {
devtool: 'source-map',
entry : [
'webpack-hot-middleware/client?path=/__webpack_hmr&reload=true',
'./src/app/Index.jsx'
],
output : {
path : path.join(__dirname, 'build'),
filename : 'bundle.js',
publicPath: '/' // hot loader publish dir
},
plugins: [
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin()
],
resolve: {
extensions: ['', '.js', '.jsx', '.css']
},
eslint : {
configFile : '.eslintrc',
emitWarning: true,
emitError : true,
formatter : require('eslint-friendly-formatter')
},
postcss: [autoprefixer({browsers: ['last 2 versions']})],
module : {
preLoaders: [
{
test : /\.jsx?$/,
loader : 'eslint-loader',
exclude: /(node_modules|src\/app\/containers)|(src\/app\/App\.jsx)/,
include: path.join(__dirname, 'src')
}
],
loaders: [
{
test : /\.jsx?$/,
loaders: ['babel'],
exclude: /(node_modules|bower_components)/,
include: path.join(__dirname, 'src')
},
{
test : /\.css$/,
loaders: ['style', 'css', 'postcss']
},
{
test : /\.scss$/,
loaders: ['style', 'css', 'sass', 'postcss']
}
]
}
};