Created
January 17, 2016 00:52
-
-
Save mbriggs/5cfb9c82459a0a75af91 to your computer and use it in GitHub Desktop.
production webpack config
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 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