From 4c93c0be9448631fc3fec14d877e0c5cdaaf8878 Mon Sep 17 00:00:00 2001 From: Mike Bloy Date: Sat, 11 May 2024 19:35:16 -0500 Subject: [PATCH] adding webpack --- webpack.config.js | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 webpack.config.js diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000..1ab1f0f --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,33 @@ +const path = require("path"); +const TerserPlugin = require("terser-webpack-plugin"); + +module.exports = { + entry: "./scripts/module.js", + output: { + filename: "./index.js", + path: path.resolve(__dirname), + }, + mode: "production", + devtool: "source-map", + optimization: { + minimizer: [ + new TerserPlugin({ + terserOptions: { + keep_classnames: true, + keep_fnames: true, + }, + }), + ], + }, + module: { + rules: [ + { + test: /\.js$/, + exclude: /node_modules/, + use: { + loader: "babel-loader", + }, + }, + ], + }, +};