Skip to content

Instantly share code, notes, and snippets.

@davehax
Created March 22, 2018 23:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davehax/96a6c3fbafeee43e0b272ed2c77b064b to your computer and use it in GitHub Desktop.
Save davehax/96a6c3fbafeee43e0b272ed2c77b064b to your computer and use it in GitHub Desktop.
const webpack = require("webpack");
const merge = require('webpack-merge');
const UglifyJSPlugin = require("uglifyjs-webpack-plugin");
const common = require('./webpack.common.js');
module.exports = merge(common, {
devtool: "source-map",
plugins: [
new UglifyJSPlugin({
sourceMap: true
}),
new webpack.DefinePlugin({
"process.env.NODE_ENV": JSON.stringify("production")
})
],
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: ['babel-preset-env']
}
}
}
]
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment