Skip to content

Commit

Permalink
chore(deps): replace uglifyjs with terser (#90)
Browse files Browse the repository at this point in the history
new builtin module for webpack v5.
  • Loading branch information
alubbock authored Sep 4, 2024
1 parent b2cb69c commit 5d61e98
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
1 change: 0 additions & 1 deletion thunorweb/webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
"sass": "^1.33.0",
"sass-loader": "^16.0.0",
"style-loader": "^4.0.0",
"uglifyjs-webpack-plugin": "^2.1.1",
"webpack": "^5.94.0",
"webpack-cli": "^5.0.0",
"webpack-bundle-tracker": "^3.0.0"
Expand Down
16 changes: 8 additions & 8 deletions thunorweb/webpack/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
const path = require("path");
const fs = require('fs');
const BundleTracker = require("webpack-bundle-tracker");
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
const TerserPlugin = require("terser-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const CssMinimizerPlugin = require("css-minimizer-webpack-plugin");
const glob = require("glob");
const isDebug = (process.env.DJANGO_DEBUG === undefined ? false : process.env.DJANGO_DEBUG.toLowerCase() === "true");
const faviconRoot = './thunor/favicons/'

var config = {
context: __dirname,

mode: isDebug ? 'development' : 'production',

entry: {
favicons: glob.sync("./thunor/favicons/*"),
favions: fs.readdirSync(faviconRoot, {withFileTypes: true})
.filter(item => !item.isDirectory())
.map(item => faviconRoot + item.name),
app: ["expose-loader?exposes=pyHTS!./thunor/js/pyhts",
"./thunor/css/fonts.css",
"./thunor/css/pyhts.css"],
Expand Down Expand Up @@ -116,12 +119,9 @@ var config = {
},

optimization: {
minimize: !isDebug,
minimizer: [
new UglifyJsPlugin({
cache: true,
parallel: true,
sourceMap: true // set to true if you want JS source maps
}),
new TerserPlugin(),
new CssMinimizerPlugin({})
]
}
Expand Down

0 comments on commit 5d61e98

Please sign in to comment.