Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Sample Basic Webpack Config
var debug = process.env.NODE_ENV !== "production";
var webpack = require('webpack');
var path = require('path');
module.exports = {
context: __dirname,
devtool: debug ? "inline-sourcemap" : null,
entry: "./js/scripts.js",
output: {
path: path.join(__dirname, "/js"),
filename: "scripts.min.js"
},
plugins: debug ? [
// Development plugins
] : [
// Production plugins
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