Skip to content

Instantly share code, notes, and snippets.

@learncodeacademy
Created January 8, 2016 03:55
Show Gist options
  • Save learncodeacademy/25092d8f1daf5e4a6fd3 to your computer and use it in GitHub Desktop.
Save learncodeacademy/25092d8f1daf5e4a6fd3 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" : null,
entry: "./js/scripts.js",
output: {
path: __dirname + "/js",
filename: "scripts.min.js"
},
plugins: debug ? [] : [
new webpack.optimize.DedupePlugin(),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.UglifyJsPlugin({ mangle: false, sourcemap: false }),
],
};
@ianjbark3r
Copy link

Extremely helpful! Thank you!

@bharasagarn
Copy link

It should be inline-source-map (notice the extra dash) I guess. Thanks for the gist!

Life saver!

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