Disable removal of the SVG viewBox by default to improve compatibility. See this Discourse thread: https://discourse.roots.io/t/svg-size-change-upon-yarn-build-production/12320
26 lines
666 B
JavaScript
26 lines
666 B
JavaScript
'use strict'; // eslint-disable-line
|
|
|
|
const { default: ImageminPlugin } = require('imagemin-webpack-plugin');
|
|
const imageminMozjpeg = require('imagemin-mozjpeg');
|
|
|
|
const config = require('./config');
|
|
|
|
module.exports = {
|
|
plugins: [
|
|
new ImageminPlugin({
|
|
optipng: { optimizationLevel: 7 },
|
|
gifsicle: { optimizationLevel: 3 },
|
|
pngquant: { quality: '65-90', speed: 4 },
|
|
svgo: {
|
|
plugins: [
|
|
{ removeUnknownsAndDefaults: false },
|
|
{ cleanupIDs: false },
|
|
{ removeViewBox: false }
|
|
],
|
|
},
|
|
plugins: [imageminMozjpeg({ quality: 75 })],
|
|
disable: (config.enabled.watcher),
|
|
}),
|
|
],
|
|
};
|