forked from andrewngu/sound-redux
-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.prod.config.js
34 lines (33 loc) · 1011 Bytes
/
webpack.prod.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
var path = require('path');
var webpack = require('webpack');
var ignore = new webpack.IgnorePlugin(/\.svg$/);
var nodeModulesDir = path.resolve(__dirname, 'node_modules');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
entry: {
main: './scripts/main.js',
vendor: [
'lodash',
'moment',
'normalizr',
'react',
'redux',
'soundcloud'
]
},
output: {
publicPath: 'http://localhost:8080/',
filename: './server/public/js/[name].js'
},
module: {
loaders: [
{ test: /\.js$/, loader: 'babel', exclude: [nodeModulesDir] },
{ test: /\.scss$/, loader: ExtractTextPlugin.extract('style', 'css!autoprefixer!sass') }
]
},
plugins: [
ignore,
new ExtractTextPlugin('./server/public/css/main.css'),
new webpack.optimize.CommonsChunkPlugin('vendor', './server/public/js/vendor.js')
]
};