Fix JS test cases and other JS build issues caused due to dependabot updates.

This commit is contained in:
Aditya Toshniwal
2023-06-09 18:22:20 +05:30
parent f4ea95da12
commit 745a91393c
9 changed files with 47 additions and 43 deletions

View File

@@ -74,19 +74,6 @@ const copyFiles = new CopyPlugin({
],
});
const imageMinimizer = new ImageMinimizerPlugin({
test: /\.(jpe?g|png|gif)$/i,
minimizerOptions: {
// Lossless optimization with custom option
// Feel free to experiment with options for better result for you
plugins: [
['mozjpeg', { progressive: true }],
['optipng', { optimizationLevel: 7 }],
['pngquant', {quality: [0.75, .9], speed: 3}],
],
},
});
function cssToBeSkiped(curr_path) {
/** Skip all templates **/
if(curr_path.indexOf('template') > -1) {
@@ -577,7 +564,7 @@ module.exports = [{
ignored: /node_modules/,
},
optimization: {
minimizer: [
minimizer: PRODUCTION ? [
new TerserPlugin({
parallel: true,
extractComments: true,
@@ -585,7 +572,21 @@ module.exports = [{
compress: true,
},
}),
],
new ImageMinimizerPlugin({
test: /\.(jpe?g|png|gif)$/i,
minimizer: {
implementation: ImageMinimizerPlugin.imageminMinify,
options: {
plugins: [
'imagemin-gifsicle',
'imagemin-mozjpeg',
'imagemin-pngquant',
'imagemin-svgo',
],
},
},
}),
] : [],
splitChunks: {
cacheGroups: {
vendor_main: {
@@ -645,7 +646,6 @@ module.exports = [{
sourceMapDevToolPlugin,
bundleAnalyzer,
copyFiles,
imageMinimizer,
]: [
extractStyle,
providePlugin,