How can I efficiently preload a custom font in my Rails 6 application using webpack?
Here is the font setup in config/_fonts.scss :
@font-face {
font-family: 'customfont';
src: font-url('customfont.eot?81236734');
src: font-url('customfont.eot?81236734#iefix') format('embedded-opentype'),
font-url('customfont.woff2?81236734') format('woff2'),
font-weight: normal;
font-style: normal;
font-display: swap;
}
To include the font, I import it in my application scss :
@import "config/index";
Now, I'm looking for the best practice to preload this font. What would be the most effective way to achieve this?