Fixing Font issue with Parcel
Kehinde Adeleke
Posted on February 7, 2022
I just recently started using the parcel bundler for a project I was working on. I set up the dev and build commands, and set my path to src/index.html
. Unfortunately, all my fonts file in the src/
folder wouldn't show up in the compiled html file in the dist
folder.
how I solved it
I googled around a bit but there weren't that many issues as specific as mine. I read up on github and found out that, one way was to copy the fonts folder from the src
into the dist
folder.
If you want to try this out, make sure the server isn't running by pressing ctrl c
in your terminal. After that, copy the fonts folder to the dist
folder and then run your build command again. In my case it was npx parcel
this is because I had specified my source to be src/index.html
in my package.json
{
"source": "src/index.html",
"scripts": {
"dev": "parcel",
"build": "parcel build"
},
}
And Voila! it worked quite alright.
Posted on February 7, 2022
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.