-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade to 0.12.1 is causing performance issues while building #370
Comments
Hmmm that's bad. Image optimization was added for 0.12 (
|
Thanks Kyle for the quick response. I downgraded to 0.11.7 which works perfectly. What do you think about moving the image optimization to a pre-build step? Whenever I add an image, I just run a script and add the optimized images to the git repo. Would be great if you could drop me a line on how to add that default image loader. No rush though. Thanks again for Gatsby :) |
I also hit a perf issue with image-webpack-loader and ended up using it only for production builds:
exports.modifyWebpackConfig = function (config, env) {
if (env === 'develop') {
imageLoader = 'url-loader?limit=10000'
}
else {
imageLoader = 'url-loader?limit=10000!image-webpack'
}
config.removeLoader('images')
config.loader('images', {
test: /\.(jpe?g|png|gif|svg)$/i,
loader: imageLoader,
})
return config
} However, in the end, I removed it entirely and started running any new images through ImageOptim once manually to make both dev and prod builds much faster. 😉 *edited to match latest gatsby source. |
Thanks tribou. I use this in my gatsby-node.js file:
And optimize my images manually with something like this:
@KyleAMathews Please, feel free to close the issue. Cheers. |
Besides number of images, we're also running into long compile times for larger images. Between the marketing department and designers we're stuck with using large pngs for a current project. :( |
hmmm... looks like this feature was a flop :-) I'll remove it in the next minor breaking release. I'm planning on adding a plugin system (finally) soon so image optimization being added to Webpack would be a great plugin (with the caveat in the README that it's not optimal if you have a lot of images). |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically closed due to inactivity. |
I just updated my project to use the latest Gatsby version 0.12.1 (0.12.2 has the same prob).
My project has over 180 images. When I do
gatsby develop
my whole computer becomes very slow. There are over 30 optipng (sometimes pngquant) processes in the process list.It takes several minutes until I see the first webpack build message in the console:
I have no special setup regarding images in my
gatsby-node.js
file.The normal build is also causing the same issue. I would be very grateful for any hints on how to resolve the issue.
The text was updated successfully, but these errors were encountered: