Created
March 30, 2016 04:59
-
-
Save GreenGeorge/5a8f34eed60aff642cf9a1b293382845 to your computer and use it in GitHub Desktop.
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 debug = process.env.NODE_ENV !== 'production'; | |
var webpack = require('webpack'); | |
module.exports = { | |
context : __dirname + '/src', | |
devtool : debug ? "inline-sourcemap" : null, | |
entry : './js/client.js', | |
module : { | |
loaders: [ | |
{ | |
test : /\.js?$/, | |
exclude : /(node_modules|bower_components)/, | |
loader : 'babel-loader', | |
query : { | |
presets : ['react', 'es2015', 'stage-0'], | |
plugins : ['react-html-attrs', 'transform-class-properties', 'transform-decorators-legacy'] | |
} | |
} | |
] | |
}, | |
output : { | |
path : __dirname + '/src/', | |
filename : 'client.min.js' | |
}, | |
plugins : debug ? [] : [ | |
new webpack.optimize.DedupePlugin(), | |
new webpack.optimize.OccurenceOrderPlugin(), | |
new webpack.optimize.UglifyJsPlugin({ mangle: false, sourcemap: false }), | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment