Last active
May 27, 2017 08:06
-
-
Save radi-cho/940a5b3f25592e4b75afa27b68950291 to your computer and use it in GitHub Desktop.
Webpack configuration file template
This file contains 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 debug = process.env.NODE_ENV !== "production"; | |
var webpack = require('webpack'); | |
module.exports = { | |
context: __dirname, | |
devtool: debug ? "inline-sourcemap" : null, | |
entry: "./js/index.js", | |
output: { | |
path: __dirname + "/js", | |
filename: "index.min.js" | |
}, | |
module: { | |
loaders: [ | |
{ test: /\.js$/, exclude: /node_modules/, loader: "babel-loader" } | |
] | |
}, | |
plugins: debug ? [] : [ | |
new webpack.optimize.DedupePlugin(), | |
new webpack.optimize.OccurenceOrderPlugin(), | |
new webpack.optimize.UglifyJsPlugin({ mangle: true, sourcemap: false }), | |
], | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment