Skip to content

css/sass Vite equivalent for font-url #144

Answered by ElMassimo
judocode asked this question in Q&A
Discussion options

You must be logged in to vote

To minimize the amount of watched files, the root for Vite is your sourceCodeDir.

You can still import or reference files outside the source dir, and adding them to watchAdditionalPaths ensures Vite Ruby will trigger a build if any of those files change.

The part that's missing in your example, is that you need either a relative reference (error-prone) or an absolute reference.

It's recommended that you configure a custom alias (such as @assets), and use that in your .scss file.

url('@assets/fonts/graphik/Graphik-Medium-Web.woff2')

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@judocode
Comment options

Answer selected by ElMassimo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants