-
-
Save arunvelsriram/453aff4ee41e05194be00dd3dff33bbb to your computer and use it in GitHub Desktop.
Sample Basic Webpack Config
This file contains hidden or 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 HtmlWebpackPlugin = require('html-webpack-plugin'); | |
var debug = process.env.NODE_ENV !== 'production'; | |
var plugins = [ | |
new HtmlWebpackPlugin() | |
]; | |
module.exports = { | |
context: __dirname + '/src', | |
devtool: debug ? 'inline-sourcemap' : false, | |
entry: './js/scripts.js', | |
output: { | |
path: __dirname + '/dist', | |
filename: 'scripts.min.js' | |
}, | |
plugins: debug ? plugins : plugins.concat([ | |
new webpack.optimize.DedupePlugin(), | |
new webpack.optimize.OccurrenceOrderPlugin(), | |
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