Skip to content

Resolve "Clean up unresolved asset warnings from frontend build"

Sarah German requested to merge 72-vite-css-warnings into main

What does this MR do and why?

Closes #72 (closed)

Fixes warnings that are coming up from build tools:

  • [x] didn't resolve at build time, it will remain unchanged to be resolved at runtime warnings from Vite
  • make lint-go sometimes fails due to changes in node_modules ("ERRO [linters_context] typechecking error: pattern ./...: open /Users/sarahg/dev/gdh/gitlab-docs-hugo/node_modules/vite-plugin-static-copy: no such file or directory"). We can just ignore this directory for Go lint

The Vite warnings are due to how we reference assets (SVGs, fonts) from CSS. We need to reference these in a way that works for the Hugo build, but this doesn't align with where Vite expects them to be.

There is probably a better way to avoid this problem than listing all the assets as external, but this does resolve the issue, and I don't expect to need to reference many assets like this going forward.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Configure a local GitLab Docs environment: https://gitlab.com/gitlab-org/technical-writing-group/gitlab-docs-hugo/-/blob/main/doc/setup.md.
  2. make clean
  3. make view

Expected behavior: no warnings from Vite about unresolved assets in main.css.

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.

Merge request reports