Skip to content

Instantly share code, notes, and snippets.

@neroze
Created December 15, 2016 06:10
Show Gist options
  • Save neroze/d3930379bf2f417a9d1aa4552cc06327 to your computer and use it in GitHub Desktop.
Save neroze/d3930379bf2f417a9d1aa4552cc06327 to your computer and use it in GitHub Desktop.
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;
@neroze
Copy link
Author

neroze commented Dec 15, 2016

webpack config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment