Merge pull request #6 from GaoYYYang/master

Replacing  imagemin-webpack with img-opttimize-loader
This commit is contained in:
Tony Air 2020-08-04 21:19:18 +07:00 committed by GitHub
commit f6815674b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 16 deletions

View File

@ -43,7 +43,7 @@
"exif-js": "^2.3.0",
"font-awesome": "^4.7.0",
"hammerjs": "^2.0.8",
"img-optimize-loader": "^1.0.6",
"img-optimize-loader": "^1.0.7",
"inputmask": "^5.0.3",
"jquery": "^3.5.1",
"jquery-hammerjs": "^2.0.0",

View File

@ -17,7 +17,7 @@ const FaviconsWebpackPlugin = require('favicons-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');
const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const ImageminPlugin = require('imagemin-webpack');
//const ImageminPlugin = require('imagemin-webpack');
//const ImageSpritePlugin = require('@a2nt/image-sprite-webpack-plugin');
const COMPRESS = true;
@ -81,7 +81,7 @@ let plugins = [
windows: true,
},
}),
new ImageminPlugin({
/*new ImageminPlugin({
bail: false, // Ignore errors on corrupted images
cache: true,
maxConcurrency: 3,
@ -107,7 +107,7 @@ let plugins = [
['webp', { quality: 100 }],
],
},
}),
}),*/
/*new ImageSpritePlugin({
exclude: /exclude|original|default-|icons|sprite/,
commentOrigin: false,
@ -274,12 +274,11 @@ module.exports = merge(common, {
},
],
},
/*{
{
test: /\.(png|webp|jpg|jpeg|gif|svg)$/,
loader: 'img-optimize-loader',
options: {
//name: '[path][name].[ext]', //'[path][name]-[contenthash].[ext]'
name: conf['webp'] ? '[path][name].webp' : '[path][name].[ext]',
name: '[name].[ext]',
outputPath: 'img/',
publicPath: '../img/',
compress: {
@ -292,15 +291,6 @@ module.exports = merge(common, {
limit: 1,
},
},
},*/
{
test: /\.(png|webp|jpg|jpeg|gif|svg)$/,
loader: 'file-loader',
options: {
name: conf['webp'] ? '[name].webp' : '[name].[ext]',
outputPath: 'img/',
publicPath: '../img/',
},
},
],
},