56 lines
1.0 KiB
JavaScript
56 lines
1.0 KiB
JavaScript
|
var webpack = require('webpack');
|
||
|
var ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||
|
|
||
|
module.exports = {
|
||
|
entry: {
|
||
|
app: [
|
||
|
'./client/index.js'
|
||
|
],
|
||
|
vendor: [
|
||
|
'react',
|
||
|
'react-dom'
|
||
|
]
|
||
|
},
|
||
|
|
||
|
output: {
|
||
|
path: __dirname + '/dist',
|
||
|
filename: 'bundle.js',
|
||
|
publicPath: '/dist/'
|
||
|
},
|
||
|
|
||
|
resolve: {
|
||
|
extensions: ['', '.js', '.jsx'],
|
||
|
},
|
||
|
|
||
|
module: {
|
||
|
loaders: [
|
||
|
{
|
||
|
test: /\.scss$/,
|
||
|
exclude: /node_modules/,
|
||
|
loader: ExtractTextPlugin.extract('style', 'css?importLoaders=2&sourceMap!sass?outputStyle=expanded&sourceMap=true&sourceMapContents=true!postcss-loader')
|
||
|
},
|
||
|
{
|
||
|
test: /\.jsx?$/,
|
||
|
exclude: /node_modules/,
|
||
|
loader: 'babel'
|
||
|
},
|
||
|
{
|
||
|
test: /\.svg$/,
|
||
|
loader: 'file'
|
||
|
}
|
||
|
]
|
||
|
},
|
||
|
|
||
|
plugins: [
|
||
|
new webpack.DefinePlugin({
|
||
|
'process.env': {
|
||
|
'NODE_ENV': JSON.stringify('production')
|
||
|
}
|
||
|
}),
|
||
|
new webpack.optimize.UglifyJsPlugin({
|
||
|
compressor: {
|
||
|
warnings: false
|
||
|
}
|
||
|
})
|
||
|
]
|
||
|
};
|