forked from nkbt/react-collapse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.development.js
53 lines (48 loc) · 1.32 KB
/
webpack.config.development.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
'use strict';
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var path = require('path');
var babelLoader = 'babel?' +
JSON.stringify({
presets: ['es2015', 'react'],
plugins: ['transform-es2015-modules-commonjs', 'transform-object-rest-spread']
});
module.exports = {
devtool: 'eval',
entry: [
'./src/example/Example.js',
'webpack-dev-server/client?http://localhost:8080',
'webpack/hot/only-dev-server'
],
output: {filename: 'bundle.js', path: path.resolve('example')},
plugins: [
new HtmlWebpackPlugin(),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"development"'
}
}),
new webpack.HotModuleReplacementPlugin()
],
module: {
loaders: [
{test: /\.json$/, loader: 'json', include: [path.resolve('src')]},
{test: /\.js$/, loaders: ['react-hot', babelLoader], include: [path.resolve('src')]}
],
preLoaders: [
{test: /\.js$/, loaders: ['eslint'], include: [path.resolve('src')]}
]
},
resolve: {extensions: ['', '.js']},
stats: {colors: true},
eslint: {configFile: 'src/.eslintrc'},
devServer: {
hot: true,
historyApiFallback: true,
stats: {
// Do not show list of hundreds of files included in a bundle
chunkModules: false,
colors: true
}
}
};