This line app.imagemin.svgo.disable();
works fine, but it disable a whole optimization.
If you need, I can send complete theme files for you via PM.
package.json
"devDependencies": {
"@roots/bud": "6.11.0",
"@roots/bud-babel": "6.11.0",
"@roots/bud-esbuild": "6.11.0",
"@roots/bud-eslint": "6.11.0",
"@roots/bud-imagemin": "6.11.0",
"@roots/bud-postcss": "6.11.0",
"@roots/bud-prettier": "6.11.0",
"@roots/bud-sass": "6.11.0",
"@roots/bud-stylelint": "6.11.0",
"@roots/bud-tailwindcss": "6.11.0",
"@roots/eslint-config": "6.11.0",
"@roots/sage": "6.11.0",
"prettier": "^2.8",
"prettier-plugin-tailwindcss": "^0.2",
"tailwindcss": "^3.2"
},
"dependencies": {
"lazysizes": "^5.3",
"stylelint-order": "^6.0",
"swiper": "^8.4"
}
bud.config.js
/**
* Build configuration
*
* @see {@link https://bud.js.org/guides/getting-started/configure}
* @param {import('@roots/bud').Bud} app
*/
export default async (app) => {
/**
* Application entrypoints
* Paths are relative to your resources directory
*/
app.entry({
app: ['@scripts/app', '@styles/app'],
editor: ['@scripts/editor', '@styles/editor'],
other: ['@scripts/other'],
admin: ['@styles/admin'],
// ...(await mappedAssets(app, 'blocks')),
});
/**
* Directory contents to be included in the compilation
*/
app.assets(['images', 'fonts']);
/**
* Matched files trigger a page reload when modified
*/
app.watch(['resources/views/**/*', 'app/**/*']);
/**
* Global external JS scripts.
*/
app.externals({
jQuery: 'window.jquery',
grecaptcha: 'window.grecaptcha',
})
/**
* By default, bud generates a runtime per chunk.
* This fixes HMR for multiple entries.
*/
app.runtime('single')
/**
* Global JS scripts.
*/
// app.provide({
// swiper: 'Swiper',
// })
/**
* Proxy origin (`WP_HOME`)
*/
app.proxy('http://templanet-sage.local');
/**
* Development origin
*/
app.serve('http://templanet-sage.local:3000');
/**
* URI of the `public` directory
*/
app.setPublicPath('/wp-content/themes/sage-10-template/public/');
/**
* Generate WordPress `theme.json`
*
* @note This overwrites `theme.json` on every build.
*/
app.wpjson
.settings({
color: {
custom: false,
customGradient: false,
defaultPalette: false,
defaultGradients: false,
},
custom: {
spacing: {},
typography: {
'font-size': {},
'line-height': {},
},
},
spacing: {
padding: true,
units: ['px', '%', 'em', 'rem', 'vw', 'vh'],
},
typography: {
customFontSize: false,
},
})
.useTailwindColors()
.useTailwindFontFamily()
.useTailwindFontSize()
.enable();
};