-
Greetings! I'm currently converting from webpacker to Vite and I am loving it so far! I am getting hung up on one portion of it which is finding what the equivalent to referencing a font with Currently, I have fonts in the
And in my However, this does not work when I am using Vite. I see a request made for the font in the network tab as I have tried to add the assets paths in
But that didn't seem to help either. Am I missing some sort of configuration setting to get this all hooked up with vite_ruby? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
To minimize the amount of watched files, the root for Vite is your You can still import or reference files outside the source dir, and adding them to 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 url('@assets/fonts/graphik/Graphik-Medium-Web.woff2') |
Beta Was this translation helpful? Give feedback.
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.