-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack-dev.config.js
39 lines (38 loc) · 1.09 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
var path = require('path');
var webpack = require('webpack');
module.exports = {
devtool: 'cheap-module-eval-source-map',
entry: './client/src/app',
output: {
path: path.join(__dirname, 'build'),
filename: 'bundle.js',
publicPath: "/static/"
},
plugins: [
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.ProgressPlugin(function handler(percentage, msg) {
if ((percentage * 100) % 20 === 0) {
console.log(percentage * 100 + '%')
}
})
],
module: {
preLoaders: [
{ test: /\.js$/, loaders: ['eslint-loader'], exclude: /node_modules/ }
],
loaders: [
{ test: /\.js$/, loaders: [ 'babel'], exclude: /node_modules/ },
{ test: /\.jsx$/, loaders: [ 'babel'], exclude: /node_modules/ },
{ test: /\.(jpe?g|png|gif|svg)$/i, loader: 'url?limit=10000!img?progressive=true' },
{ include: /\.json$/, loaders: ['json-loader'] }
]
},
resolve: {
extensions: ['', '.json', '.jsx', '.js']
},
eslint: {
formatter: require("eslint-friendly-formatter"),
configFile: './.eslintrc',
failOnError: true
}
}