Our Jekyll site now takes nearly a minute to build. Is there a way (plugin or otherwise) to just build specific pages when developing?
(limit doesn’t work as only a small part of the site is posts)
Our Jekyll site now takes nearly a minute to build. Is there a way (plugin or otherwise) to just build specific pages when developing?
(limit doesn’t work as only a small part of the site is posts)
When you use the --incremental
CLI switch (e.g. bundle exec jekyll build --incremental
or bundle exec jekyll serve --incremental
) or have incremental: true
in your config file, Jekyll will first build the entire site. Consequent build invocations will only process and render those pages that have changed since the previous build invocation.
Thanks - I’m finding --incremental
does reduce build time by about 20 seconds, but even for a simple markdown change to just one page it’s still taking around 40 seconds to build.
It may not be building just the one page then.
Incremental build doesn’t take plugins into consideration. So if you have 10 pages generated by a plugin, then all those 10 pages will be regenerated on every cycle.
So, I’m guessing that this perf issue is because of some plugin…
If possible, post a link to your repository if it is public or try debugging yourselves by using the --verbose
and --profile
CLI switches:
bundle exec jekyll build --incremental --verbose --profile
Unfortunately it’s not public, but i’ve gone ahead and run verbose and profile.
Even though i’m only making a change to one individual markdown file or layout, that aren’t part of any collection:
Writing Metadata: .jekyll-metadata
. In fact that steps taking ~ 30 seconds.Thanks again for your help.
You could try disabling the jekyll-paginate-v2
plugin (by commenting out the gem in the config file and Gemfile) and check how long the build time is…
Thanks! Some progress: It turns out we were using extra plugins i wasn’t aware of
Removing autoprefixer seems to have made the biggest difference. It’s reduced build time with incremental to about 10-15 seconds (so down about 30 seconds).
The profile table is still showing high counts - e.g the default.html layout is invoked 99 times even when only changing a layout used on one other page.
if you move the asset processing to Gulp or some other task runner you can speed stuff up quite a bit. Gulp can process sass almost instantly, so if you are just working on css then that is much easier - but it also removes that step from jekyll so it makes the rest of what jekyll does faster. Gulp can also move the images which is another thing that takes time for jekyll to do. I have my site so that jekyll mainly handles the page creation/layouts/includes. Gulp handles sass, js and images.
Check this post for info on what I did and also info from MM on how he does it. It can be a little complicated if you are not familiar with Gulp, which I was not, but I got the hang of it.