Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Load govuk-frontend Sass with NodePackageImporter
There's [a bug in the way Vite's inbuilt sass importing works](vitejs/vite#19196) that means some of our assets don't build properly if we import the govuk-frontend styles using the @GOVUK alias. We can get around this by using Sass's builtin NodePackageImporter to import the govuk-frontend styles. This bypasses the Vite import code that causes the issue. It's also better for a couple of other reasons. It makes it clear that this import is coming from an npm package (which was obscured slightly when we were using the alias). It also makes us resilient to structure changes in the govuk-frontend package (NodePackageImporter uses the 'sass' field in govuk-frontend's package.json to determine the file to import, so we no longer need to point to a specific file which could change).
- Loading branch information