Skip unneeded search bundles when compiling JavaScript
What does this MR do and why?
The site only runs one search backend at once, as determined by the SEARCH_BACKEND environment variable. By dropping files related to the unused search backend, we can reduce compile time on CI by a few minutes.
Closes #1597 (closed)
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
-
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 with Lunr: SEARCH_BACKEND="lunr" make compile
-
In the Yarn output, right after INFO: Compiling JavaScript...
, you should seelunrsearch.js
, but notgoogle.js
,google_results.js
, orgoogle_search_api.js
-
View the site and verify Lunr search works as expected: bundle exec nanoc view
-
Compile the site with Google: make compile
-
Check the Yarn output and verify the google*.js
files are processed, but notlunrsearch.js
-
View the site and verify Google search works as expected: bundle exec nanoc view
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.
Closes #1597 (closed)
Edited by Sarah German