Webpack configuration that bundles and uglifies javascript files.
const webpack = require("webpack");
const path = require("path");
const UglifyJSPlugin = require("uglifyjs-webpack-plugin");
module.exports = {
entry: './src/index.js',
output: {
filename: '[name].bundle.js',
path: path.resolve(__dirname, 'dist')
},
module: {
rules: []
},
plugins: [new UglifyJSPlugin({sourceMap: true})]
};
"scripts": {
"run:webpack": "./node_modules/.bin/webpack --watch --mode=development --devtool source-map",
}