pistolshrimpgames / ProceduralPlanet

Procedural planets with Three.js
Do What The F*ck You Want To Public License
7 stars 4 forks source link

[Webpack] Font pathing issue on pistolshrimpgames.com #14

Closed pebbywebby closed 1 year ago

pebbywebby commented 1 year ago

Currently, the webpack rules create javascript which looks for fonts in a relative path like: src: url(\'assets/fonts/UQM-3DOMenuLabels.ttf\')

I currently hand-edit after building to hardcode those paths to include the full path, like so: src: url(\'https://pistolshrimpgames.com/planets/assets/fonts/UQM-3DOMenuLabels.ttf\')

This seems unnecessary, but I get different results in different web browsers using various flavors of relative paths when looking for fonts in a relative path. How do we, either:

  1. Create a relative path which plays nice on all browsers for font loading on that server? (might be beyond the scope of this issue and a server config issue - help welcome here)
  2. Create some webpack build target which knows how to do those edits for me, to make build & deploy less painful?