Skip to content

Instantly share code, notes, and snippets.

@SilencerWeb
Created June 9, 2019 04:28
Show Gist options
  • Save SilencerWeb/b533dc466d8d200b06aaad04d4a3f498 to your computer and use it in GitHub Desktop.
Save SilencerWeb/b533dc466d8d200b06aaad04d4a3f498 to your computer and use it in GitHub Desktop.
const path = require('path');
const UglifyJsPlugin = require('uglify-js-plugin');
module.exports = {
target: 'node',
mode: 'production',
entry: {
main: path.join(__dirname, 'src', 'index.js'),
},
output: {
path: path.join(__dirname, 'dist'),
},
module: {
rules: [
{
loader: 'babel-loader',
test: /\.js?$/,
exclude: /node_modules/,
query: { cacheDirectory: true },
},
],
},
optimization: {
minimizer: [
new UglifyJsPlugin({
cache: true,
parallel: true,
sourceMap: true,
}),
],
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment