-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
49 lines (46 loc) · 1.22 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
var webpack = require('webpack');
var path = require('path');
var isDev = process.env.NODE_ENV || true;
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var nodeModulesDir = path.join(__dirname, '/node_modules');
var config = {
entry: {
app: ['./app/app.js'],
vendor: [ 'react' ]
},
output: {
publicPath: '/',
path: path.join(__dirname, '/build'),
filename: 'bundle.js'
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
isDev ? new ExtractTextPlugin('app.css', {allChunks: true}) : '',
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
filename: 'vendor.bundle.js'
})
],
module: {
noParse: [],
loaders: [
{
test: /\.js$|\.jsx$/,
loader: 'babel?optional[]=runtime',
exclude: [nodeModulesDir]
},
{ test: /\.woff2$/, loader: 'url-loader?limit=100000' },
{
test: /\.styl$/,
loader: isDev ?
'style!css!stylus?paths[]=node_modules/jeet/stylus/'
: ExtractTextPlugin.extract('stylus', 'css-loader!stylus-loader')
}
]
},
resolve: {
modulesDirectories: ['node_modules'],
extensions: ['', '.js', '.jsx', '.json', '.styl']
}
};
module.exports = config;