nanoc compile: Do not build frontend if nothing has changed
So, using nanoc live
or nanoc compile
, frontend should not be built from scratch if we only edit Markdown files. It shouldn't take two minutes to preview a Markdown change. I'm not sure there's a way to determine that, but it would be nice to have.
We define out own custom nanoc frontend
command that is used in a postprocess when building the site.
I tried to skip the frontend
command step by defining the following in Rules
postprocess do
next if ENV['SKIP_FRONTEND'] == 'true'
raise "Failed to copy GitLab fonts. Run 'yarn install' and try again." unless system('make add-gitlab-fonts')
raise "postprocessing error" unless system('nanoc frontend')
end
and then run Nanoc:
SKIP_FRONTEND=true bundle exec nanoc live
For this to work, you have to build frontend at least once, so the following would do it:
bundle exec nanoc frontend
The thing is that the JS files get deleted for some reason. Is this Nanoc cleaning things up? Not sure where that comes from:
delete /home/axil/devel/gitlab/gdk/gitlab-docs/public/assets/images/icons.svg
delete /home/axil/devel/gitlab/gdk/gitlab-docs/public/assets/javascripts/lunr.min.js
delete /home/axil/devel/gitlab/gdk/gitlab-docs/public/assets/javascripts/vendor/mermaid.min.js
delete /home/axil/devel/gitlab/gdk/gitlab-docs/public/assets/javascripts/vendor/mermaid.min.js.map
delete /home/axil/devel/gitlab/gdk/gitlab-docs/public/frontend/search/docsearch.css
delete /home/axil/devel/gitlab/gdk/gitlab-docs/public/frontend/search/instantsearch.css
delete /home/axil/devel/gitlab/gdk/gitlab-docs/public/frontend/shared/global_imports.css
delete /home/axil/devel/gitlab/gdk/gitlab-docs/public/frontend/shared/index.css.map
delete /home/axil/devel/gitlab/gdk/gitlab-docs/public/frontend/shared/utility_classes.css.map
delete /home/axil/devel/gitlab/gdk/gitlab-docs/public/assets/javascripts/vendor
update [0.29s] public/ee/administration/object_storage.html
Edited by Achilleas Pipinellis