How to use ESBuild to load font files for Bootstrap Icons

Опубликовано: 27 Август 2026
на канале: Winston Codes On
1,051
15

A look at the copy and file loaders for ESBuild to load a font file to get Bootstrap Icons to work with Rails 7. The solution is surprisingly simple!

0:00 Bootstrap Icons font file dilemma
2:09 ESBuild setup with my Rails 7
3:39 Look at CSS in the ESBuild output
4:44 ESBuild file vs copy loader
6:28 ESBuild copy loader (attempt 1 ❌)
9:20 Modify Rails asset pipeline include path (attempt 2 ❌)
12:02 ESBuild precompile to rewrite the font file URL (attempt 3 ❌)
14:32 Change the font URL in Bootstrap's SCSS defaults 🎉

Resources:
How to include SCSS in your ESBuild JS deliverable with Rails 7:    • How to include SCSS in your ESBuild Javasc...  
How to upgrade to Rails 7 with ESBuild:    • Webpacker is dead! Upgrading to Rails 7 wi...  

Outtro Music:
CO.AG - Escape the Apex
   • Escape the Apex -  Futuristic Sci-fi Elect...