Skip to content

Instantly share code, notes, and snippets.

@mbriggs
Created January 17, 2016 00:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbriggs/5cfb9c82459a0a75af91 to your computer and use it in GitHub Desktop.
Save mbriggs/5cfb9c82459a0a75af91 to your computer and use it in GitHub Desktop.
production webpack config
var webpack = require('webpack');
var path = require('path');
var ManifestPlugin = require('webpack-manifest-plugin')
function root(fragment){
return path.join(__dirname, "client", fragment);
}
module.exports = {
devtool: 'source-map',
context: __dirname,
entry: [
root('style/manifest.js'),
root('js/manifest.js')
],
output: {
path: 'public/assets',
filename: '[name].[chunkhash].js'
},
plugins: [
new ManifestPlugin()
],
module: {
loaders: [
{test: /\.js$/, loader: 'uglify'},
{test: /\.coffee$/, loader: "uglify!coffee-loader"},
{test: /\.css$/, loader: "style!css"},
{test: /\.scss$/, loader: "style!css?minimize&-autoprefixer!autoprefixer!sass"},
{test: /\.less$/, loader: "style!css?minimize&-autoprefixer!autoprefixer!less"},
{test: /\.(png|gif|eot|woff2|woff|ttf|svg)$/, loader: "url"}
]
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment