feat: config img-opttimize-loader

This commit is contained in:
gaoyang.lamb 2020-08-04 12:16:07 +08:00
parent 5102111100
commit a14a94cbef
2 changed files with 2 additions and 13 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

@ -274,12 +274,10 @@ 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]',
outputPath: 'img/',
publicPath: '../img/',
compress: {
@ -292,15 +290,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/',
},
},
],
},