matchboxdesigngroup / kindling

A WordPress theme that supports the Full Site Editing features.
MIT License
3 stars 0 forks source link

Kindling: (build bug) - file-loader in our webpack config is corrupting images #32

Open sync-by-unito[bot] opened 9 months ago

sync-by-unito[bot] commented 9 months ago

I am working on STL Sports and used a PNG as a background image in the scss. On build it processed the image and copied it to kindling/build/images but the image was corrupted.

As a temporary fix I commented out the following lines in:

kindling/webpack.config.js

{

test: /.(png|jpe?g|gif)$/i,

use: [

'file-loader',

{

loader: 'image-webpack-loader',

options: {

mozjpeg: {

progressive: true,

quality: 65,

},

pngquant: {

enabled: false,

},

gifsicle: {

interlaced: false,

},

webp: {

quality: 75,

},

},

},

],

},

This effects how pngs, gifs, and jpegs are processed. Honestly I don't know if I've used these image types yet. We've been using SVGs for background images. So maybe this never worked properly. And it's overriding the build-in WordPress webpack config so we might not even need these settings.

┆Issue is synchronized with this Asana task

sync-by-unito[bot] commented 9 months ago

➤ Steve Struemph commented:

My quick fix was to remove these but we should explore if there's benefit to having them... also get to know the default rules that comes with the wordpress config

sync-by-unito[bot] commented 8 months ago

➤ Cullen commented:

The thought here is that we should be including optimized images within the theme.

I vote to remove this from the build.