DEV Community

Kehinde Adeleke
Kehinde Adeleke

Posted on

4 2

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.

SurveyJS custom survey software

Simplify data collection in your JS app with a fully integrated form management platform. Includes support for custom question types, skip logic, integrated CCS editor, PDF export, real-time analytics & more. Integrates with any backend system, giving you full control over your data and no user limits.

Learn more

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more