Skip to content

Commit

Permalink
build(templates): image-webpack-loader is not enabled by default ➖
Browse files Browse the repository at this point in the history
  • Loading branch information
wang1212 committed Jan 5, 2022
1 parent 5ebccbe commit 4e3ffe9
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 48 deletions.
47 changes: 24 additions & 23 deletions templates/app/config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,29 +197,30 @@ module.exports = ({ NODE_ENV, SRC_DIR, BUILD_DIR, isEnvDevelopment = NODE_ENV ==
// },
// },
use: [
{
loader: 'image-webpack-loader',
options: {
disable: isEnvDevelopment,
mozjpeg: {
progressive: true,
quality: 65,
},
optipng: {
enabled: false,
},
pngquant: {
quality: [0.65, 0.9],
speed: 4,
},
gifsicle: {
interlaced: false,
},
webp: {
quality: 75,
},
},
},
// install https://github.com/tcoopman/image-webpack-loader#install
// {
// loader: 'image-webpack-loader',
// options: {
// disable: isEnvDevelopment,
// mozjpeg: {
// progressive: true,
// quality: 65,
// },
// optipng: {
// enabled: false,
// },
// pngquant: {
// quality: [0.65, 0.9],
// speed: 4,
// },
// gifsicle: {
// interlaced: false,
// },
// webp: {
// quality: 75,
// },
// },
// },
],
},
],
Expand Down
1 change: 0 additions & 1 deletion templates/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
"html-loader": "^2.1.2",
"html-webpack-plugin": "^5.3.2",
"husky": "^7.0.2",
"image-webpack-loader": "^7.0.1",
"jest": "^27.1.0",
"jsdoc": "^3.6.7",
"jsdoc-babel": "^0.5.0",
Expand Down
47 changes: 24 additions & 23 deletions templates/react-app/config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,29 +199,30 @@ module.exports = ({ NODE_ENV, SRC_DIR, BUILD_DIR, isEnvDevelopment = NODE_ENV ==
// },
// },
use: [
{
loader: 'image-webpack-loader',
options: {
disable: isEnvDevelopment,
mozjpeg: {
progressive: true,
quality: 65,
},
optipng: {
enabled: false,
},
pngquant: {
quality: [0.65, 0.9],
speed: 4,
},
gifsicle: {
interlaced: false,
},
webp: {
quality: 75,
},
},
},
// install https://github.com/tcoopman/image-webpack-loader#install
// {
// loader: 'image-webpack-loader',
// options: {
// disable: isEnvDevelopment,
// mozjpeg: {
// progressive: true,
// quality: 65,
// },
// optipng: {
// enabled: false,
// },
// pngquant: {
// quality: [0.65, 0.9],
// speed: 4,
// },
// gifsicle: {
// interlaced: false,
// },
// webp: {
// quality: 75,
// },
// },
// },
],
},
],
Expand Down
1 change: 0 additions & 1 deletion templates/react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@
"html-loader": "^2.1.2",
"html-webpack-plugin": "^5.3.2",
"husky": "^7.0.2",
"image-webpack-loader": "^7.0.1",
"jest": "^27.1.0",
"jsdoc": "^3.6.7",
"jsdoc-babel": "^0.5.0",
Expand Down

0 comments on commit 4e3ffe9

Please sign in to comment.