diff --git a/packages/webamp/CHANGELOG.md b/packages/webamp/CHANGELOG.md index b82a5afc..705b247b 100644 --- a/packages/webamp/CHANGELOG.md +++ b/packages/webamp/CHANGELOG.md @@ -7,6 +7,7 @@ ### Bug Fixes - Fix a number of edge cases where the close and minimize buttons in the equalizer window could render the wrong sprite [#1046](https://github.com/captbaritone/webamp/pull/1046) +- Fix a bug where unminified bundle was accidentally minified. ## 1.4.2 diff --git a/packages/webamp/config/webpack.library.js b/packages/webamp/config/webpack.library.js index 7eeb1538..70f0bad1 100644 --- a/packages/webamp/config/webpack.library.js +++ b/packages/webamp/config/webpack.library.js @@ -1,5 +1,6 @@ const path = require("path"); const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer"); +const TerserPlugin = require("terser-webpack-plugin"); module.exports = { devtool: "source-map", @@ -51,6 +52,15 @@ module.exports = { maxEntrypointSize: 9000000, maxAssetSize: 9000000, }, + optimization: { + minimize: true, + minimizer: [ + new TerserPlugin({ + // This allows us to produce both minfied and unminified files. + test: /\.min\.js$/i, + }), + ], + }, entry: { bundle: "./js/webamp.js", "bundle.min": "./js/webamp.js", diff --git a/packages/webamp/package.json b/packages/webamp/package.json index 9f7c1ca7..ecda9076 100644 --- a/packages/webamp/package.json +++ b/packages/webamp/package.json @@ -127,6 +127,7 @@ "reselect": "^3.0.1", "screenfull": "^4.0.0", "style-loader": "^0.23.1", + "terser-webpack-plugin": "^1.4.3", "tinyqueue": "^1.2.3", "typescript": "^3.7.2", "url-loader": "^1.1.2",