-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathwebpack.dev.config.js
47 lines (37 loc) · 1.18 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
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var path = require('path');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
devtool: 'inline-source-map',
debug: true,
entry: {
main: ['./src/main'],
vendor: ['react', 'react-dom', 'react-router', 'babel-polyfill', 'redux', 'react-redux']
},
output: {
path: path.join(__dirname, 'dist'),
filename: '/[name].bundle.js',
chunkFilename: '/[name].js'
},
module: {
loaders: [
{ test: /\.js$/, loaders: ['babel'], include: path.join(__dirname, 'src') },
{ test: /\.css$/, loader: ExtractTextPlugin.extract('style', 'css') }
]
},
plugins: [
new ExtractTextPlugin('/main.css'),
new webpack.DefinePlugin({
'process.env': {
ENV: JSON.stringify('development'),
NODE_ENV: JSON.stringify('development')
},
'__NODE__': JSON.stringify(false),
}),
new webpack.optimize.CommonsChunkPlugin({
names: 'vendor',
minChunks: Infinity
}),
],
};