File tree Expand file tree Collapse file tree 4 files changed +235
-2306
lines changed Expand file tree Collapse file tree 4 files changed +235
-2306
lines changed Original file line number Diff line number Diff line change @@ -21,27 +21,6 @@ module.exports = {
21
21
type : 'asset/resource' ,
22
22
exclude : / i c o n s / ,
23
23
include : srcPath + '/img' ,
24
- use : [
25
- {
26
- loader : 'image-webpack-loader' ,
27
- options : {
28
- mozjpeg : {
29
- progressive : true ,
30
- quality : 65 ,
31
- } ,
32
- pngquant : {
33
- quality : [ 0.65 , 0.9 ] ,
34
- speed : 4 ,
35
- } ,
36
- gifsicle : {
37
- interlaced : false ,
38
- } ,
39
- webp : {
40
- quality : 75 ,
41
- } ,
42
- } ,
43
- } ,
44
- ] ,
45
24
} ,
46
25
/* JSLoader */ {
47
26
test : / \. j s $ / i,
Original file line number Diff line number Diff line change 1
1
const path = require ( 'path' )
2
2
const entries = require ( './entries' )
3
+ const ImageMinimizerPlugin = require ( 'image-minimizer-webpack-plugin' )
3
4
const TerserPlugin = require ( 'terser-webpack-plugin' )
5
+ const svgoconfig = require ( './svgo.config' )
4
6
5
7
module . exports = {
6
8
entry : entries ,
@@ -12,6 +14,22 @@ module.exports = {
12
14
} ,
13
15
optimization : {
14
16
minimizer : [
17
+ new ImageMinimizerPlugin ( {
18
+ minimizer : {
19
+ implementation : ImageMinimizerPlugin . imageminMinify ,
20
+ options : {
21
+ // Lossless optimization with custom option
22
+ // Feel free to experiment with options for better result for you
23
+ plugins : [
24
+ [ 'gifsicle' , { interlaced : true } ] ,
25
+ [ 'jpegtran' , { progressive : true } ] ,
26
+ [ 'optipng' , { optimizationLevel : 5 } ] ,
27
+ // Svgo configuration here https://github.com/svg/svgo#configuratio
28
+ [ 'svgo' , { svgoconfig } ] ,
29
+ ] ,
30
+ } ,
31
+ } ,
32
+ } ) ,
15
33
new TerserPlugin ( {
16
34
parallel : true ,
17
35
terserOptions : {
Original file line number Diff line number Diff line change 16
16
"dependencies" : {
17
17
"lazysizes" : " ^5.3.2" ,
18
18
"oneloop.js" : " ^5.0.0" ,
19
- "sharp" : " ^0.32.0" ,
20
19
"what-input" : " ^5.2.10"
21
20
},
22
21
"devDependencies" : {
35
34
"eslint-config-prettier" : " ^8.5.0" ,
36
35
"eslint-plugin-prettier" : " ^4.2.1" ,
37
36
"eslint-webpack-plugin" : " ^3.2.0" ,
38
- "image-webpack-loader " : " ^7.0.1 " ,
37
+ "image-minimizer- webpack-plugin " : " ^3.8.2 " ,
39
38
"js-yaml" : " ^4.1.0" ,
40
39
"json2csv" : " ^5.0.6" ,
41
40
"mini-css-extract-plugin" : " ^1.5.0" ,
51
50
"prettier" : " ^2.2.1" ,
52
51
"sass" : " ^1.52.3" ,
53
52
"sass-loader" : " ^11.0.1" ,
53
+ "sharp" : " ^0.32.1" ,
54
54
"style-loader" : " ^2.0.0" ,
55
55
"stylelint" : " ^14.13.0" ,
56
56
"stylelint-config-recess-order" : " ^3.0.0" ,
57
57
"stylelint-scss" : " ^4.3.0" ,
58
58
"stylelint-webpack-plugin" : " ^3.3.0" ,
59
59
"svg-sprite-loader" : " ^6.0.10" ,
60
+ "svgo" : " ^3.0.2" ,
60
61
"svgo-loader" : " ^3.0.0" ,
61
62
"terser-webpack-plugin" : " ^5.3.6" ,
62
63
"webpack" : " ^5.35.0" ,
You can’t perform that action at this time.
0 commit comments