Created
October 6, 2015 02:34
-
-
Save bceskavich/bc48ef7989e4ca634c58 to your computer and use it in GitHub Desktop.
config/webpack.production.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var webpack = require('webpack'); | |
var merge = require('webpack-config-merger'); | |
var ExtractTextPlugin = require('extract-text-webpack-plugin'); | |
var baseConfig = require('./webpack.base.js'); | |
var config = require('config'); | |
var patterns = require('css-patterns'); | |
var path = require('path'); | |
module.exports = merge(baseConfig, { | |
entry: { | |
application: ['./src/js/index.js'] | |
}, | |
module: { | |
loaders: [ | |
{ | |
test: /\.js$/, | |
loaders: ['babel-loader?stage=0'], | |
exclude: [/node_modules/, /config/] | |
}, | |
{ | |
test: /\.?css$/, | |
loader: ExtractTextPlugin.extract( | |
'css!autoprefixer?browsers=last 3 versions!sass?outputStyle=compressed&includePaths[]=' + path.resolve(patterns.includePaths[0]) | |
) | |
} | |
] | |
}, | |
plugins: [ | |
new webpack.optimize.DedupePlugin(), | |
new webpack.optimize.UglifyJsPlugin({ minimize: true }), | |
new ExtractTextPlugin('app.scss', 'app.[contenthash].css') | |
] | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment