Add option to skip frontend compilation
What does this MR do and why?
When nanoc compile
runs, all the JavaScript files under
content/frontend/
are compiled as well. This action is
not idempotent, so the JavaScript files are built every time Nanoc compiles
the site, regardless if a change has been made to one of those files.
This means that even for a small Markdown file change like a typo, you have to wait almost two minutes for the frontend files to finish compiling so that you can preview your change locally.
If you skip compiling the frontend files, it takes around 30 seconds.
Closes #1594 (closed).
How to set up and validate locally
-
Configure a local GitLab Docs environment: https://gitlab.com/gitlab-org/gitlab-docs/-/blob/main/doc/setup.md.
-
Check out this branch.
-
Compile the site:
make compile
-
Make a Markdown change in one of the repositories, for example
gitlab
. -
Compile the site again. You'll notice that the frontend files are compiled again although no relevant change has been made.
-
Compile the site but this time with the variable set. No frontend files should be compiled.
NANOC_ENV=skip_frontend make compile
-
Make a Markdown change again and compile once more with the variable set. No frontend files are compiled.
Note: You can follow the same steps by using make live
instead of make compile
as well.
Merge request acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this merge request.