-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack-config.js
79 lines (69 loc) · 1.73 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
var path = require('path');
var webpack = require('webpack');
var ProgressBarPlugin = require('progress-bar-webpack-plugin');
var chalk = require('chalk');
var precss = require('precss');
var autoprefixer = require('autoprefixer');
module.exports = {
devtool: 'eval-source-map',
entry: [
'webpack-dev-server/client?http://localhost:3001',
// 'webpack/hot/only-dev-server',
'webpack/hot/dev-server',
'./src/index',
'babel-polyfill',
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/dist'
},
plugins: [
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin(),
// new webpack.NoErrorsPlugin(),
new webpack.DefinePlugin({ 'process.env.NODE_ENV': JSON.stringify('development'),
}),
new ProgressBarPlugin({
format: chalk.yellow.bold('build [:bar]') + chalk.blue.bold(':percent') + ' (:elapsed seconds)',
clear: false
})
],
resolve: {
extensions: ['', '.js', '.jsx']
},
module: {
noParse: [/autoit.js/],
loaders: [
{
test: /\.js$/,
loader: 'react-hot!babel-loader',
exclude: /node_modules/,
include: __dirname
},
{
test: /\.json?$/,
loader: 'json'
},
{
test: /\.css?$/,
loaders: ['style', 'raw', 'postcss'],
include: __dirname
},
{
test: /\.scss$/,
loaders: ['style', 'css', 'postcss', 'sass']
},
{
test: /\.(eot|woff|woff2|ttf|svg|png|jpg|gif)$/,
loader: 'url-loader?limit=10000&minetype=application/font-woff=./dist/'
},
]
},
postcss: function() {
return [precss, autoprefixer];
},
stats: {
colors: true
}
};