Skip to content

Instantly share code, notes, and snippets.

@nguyenthanhxuan
Forked from learncodeacademy/webpack.config.js
Last active November 24, 2017 09:15
Show Gist options
  • Save nguyenthanhxuan/af58c3ba5c42dbc34b64e68e732c5e8c to your computer and use it in GitHub Desktop.
Save nguyenthanhxuan/af58c3ba5c42dbc34b64e68e732c5e8c to your computer and use it in GitHub Desktop.
Sample Basic Webpack Config
var debug = process.env.NODE_ENV !== "production";
var webpack = require('webpack');
module.exports = {
context: __dirname,
devtool: debug ? "inline-sourcemap" : '',
entry: "./js/scripts.js",
output: {
path: __dirname + "/js",
filename: "scripts.min.js"
},
plugins: debug ? [] : [
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