Fixing Font issue with Parcel

adeleke5140

Kehinde Adeleke

Posted on February 7, 2022

Fixing Font issue with Parcel

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"
  },
}
Enter fullscreen mode Exit fullscreen mode

And Voila! it worked quite alright.

💖 💪 🙅 🚩
adeleke5140
Kehinde Adeleke

Posted on February 7, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Fixing Font issue with Parcel
javascript Fixing Font issue with Parcel

February 7, 2022