Created
December 15, 2016 06:10
-
-
Save neroze/d3930379bf2f417a9d1aa4552cc06327 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 webpack = require('webpack'); | |
var path = require('path'); | |
var BUILD_DIR = path.resolve(__dirname, 'src/client/public/'); | |
var APP_DIR = path.resolve(__dirname, 'src/client/app'); | |
var config = { | |
entry: APP_DIR + '/index.js', | |
output: { | |
path: BUILD_DIR, | |
filename: 'bundle.js' | |
}, | |
module : { | |
loaders : [ | |
{ | |
test : /\.jsx?/, | |
include : APP_DIR, | |
loader : 'babel' | |
} | |
] | |
}, | |
plugins: [ | |
new webpack.DefinePlugin({ | |
'process.env': { | |
NODE_ENV: JSON.stringify('production') | |
} | |
}), | |
new webpack.HotModuleReplacementPlugin(), | |
new webpack.NoErrorsPlugin(), | |
new webpack.optimize.UglifyJsPlugin({ | |
minimize: true, | |
compress: { | |
warnings: false | |
} | |
}) | |
] | |
}; | |
module.exports = config; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
webpack config