You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is due to the ImageminPlugin, which I think waits for images to be available in the build directory to optimize them. However with the watch command, no build dir is created, which makes the plugin indefinitely wait for files that will never arrive.
The solution is to only push the plugin into the webpack config in build mode.
A small, related detail with the plugin is that it's being hardcoded to looking inside build which may not be what the user set (depends on the --dest option).
The text was updated successfully, but these errors were encountered:
A small, related detail with the plugin is that it's being hardcoded to looking inside build which may not be what the user set (depends on the --dest option).
This is a great catch.
Immediate fix: in your preact.config.js
module.exports=(config,env)=>{const{ production, ssr }=env;netlifyPlugin(config);production&&!ssr&&config.plugins.push(newImageminPlugin({from: './build/assets/**',pngquant: {quality: '60'},plugins: [imageminMozjpeg({quality: 50,progressive: true})]}));}
This is due to the
ImageminPlugin
, which I think waits for images to be available in the build directory to optimize them. However with the watch command, no build dir is created, which makes the plugin indefinitely wait for files that will never arrive.The solution is to only push the plugin into the webpack config in build mode.
A small, related detail with the plugin is that it's being hardcoded to looking inside
build
which may not be what the user set (depends on the--dest
option).The text was updated successfully, but these errors were encountered: