diff --git a/config/webpack.library.js b/config/webpack.library.js index c6152a7c..297fdd2f 100644 --- a/config/webpack.library.js +++ b/config/webpack.library.js @@ -1,6 +1,6 @@ const path = require("path"); -const UglifyJsPlugin = require("uglifyjs-webpack-plugin"); const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer"); +const UnminifiedWebpackPlugin = require("unminified-webpack-plugin"); module.exports = { mode: "production", @@ -50,26 +50,16 @@ module.exports = { reportFilename: "library-report.html", openAnalyzer: false }), - new UglifyJsPlugin({ - include: /\.min\.js$/, - parallel: true, - uglifyOptions: { - compress: { - // Workaround: https://github.com/mishoo/UglifyJS2/issues/2842 - inline: false - } - } - }) + // Also generate non-minified bundles. + new UnminifiedWebpackPlugin() ], performance: { // We do some crazy shit okay! Don't judge! - maxEntrypointSize: 900000, - maxAssetSize: 900000 + maxEntrypointSize: 9000000, + maxAssetSize: 9000000 }, entry: { - bundle: "./js/webamp.js", "bundle.min": "./js/webamp.js", - "lazy-bundle": "./js/webampLazy.tsx", "lazy-bundle.min": "./js/webampLazy.tsx" }, output: { diff --git a/config/webpack.prod.js b/config/webpack.prod.js index 8770de32..08ace5c2 100644 --- a/config/webpack.prod.js +++ b/config/webpack.prod.js @@ -2,7 +2,6 @@ const webpack = require("webpack"); const merge = require("webpack-merge"); const workboxPlugin = require("workbox-webpack-plugin"); const GitRevisionPlugin = require("git-revision-webpack-plugin"); -const UglifyJsPlugin = require("uglifyjs-webpack-plugin"); const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer"); const common = require("./webpack.common.js"); @@ -24,17 +23,6 @@ const config = merge(common, { ), COMMITHASH: JSON.stringify(gitRevisionPlugin.commithash()) }), - new UglifyJsPlugin({ - // TODO: Is this needed with the devtool setting above? - sourceMap: true, - parallel: true, - uglifyOptions: { - compress: { - // Workaround: https://github.com/mishoo/UglifyJS2/issues/2842 - inline: false - } - } - }), new workboxPlugin.GenerateSW({ swDest: "service-worker.js", // importWorkboxFrom: "local", diff --git a/package.json b/package.json index dff0375a..693e5c78 100644 --- a/package.json +++ b/package.json @@ -121,6 +121,7 @@ "travis-weigh-in": "^1.0.2", "typescript": "^3.0.1", "uglifyjs-webpack-plugin": "^1.2.5", + "unminified-webpack-plugin": "^2.0.0", "url-loader": "^1.1.2", "webpack": "^4.26.0", "webpack-bundle-analyzer": "^3.0.3", diff --git a/yarn.lock b/yarn.lock index 151cee7e..01cada18 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8636,6 +8636,10 @@ universalify@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.1.tgz#fa71badd4437af4c148841e3b3b165f9e9e590b7" +unminified-webpack-plugin@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/unminified-webpack-plugin/-/unminified-webpack-plugin-2.0.0.tgz#9cd9c3f420003e968d6ed5ea365085be5e72df14" + unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec"