Munter / subfont

Command line tool to optimize your webfont loading. Aggressive subsetting based on your font use, self-hosting of Google fonts and preloading
MIT License
1.56k stars 29 forks source link

Generating relative paths #135

Closed thewilkybarkid closed 3 years ago

thewilkybarkid commented 3 years ago

Related to #134, is there a way to generate relative paths rather than root-relative?

I'm achieveing the same in Parcel with --public-url ./, but doesn't seem like --canonical-root can support it?

papandreou commented 3 years ago

No, that's not supported. We felt that root-relative paths were the safest default, because of things like <base href=...> and font urls in the JavaScript-based preload polyfill. It'd certainly be possible to add a --prefer-relative switch, but it would come at the expense of some extra complexity.

Could you write a few lines about your use case?

papandreou commented 3 years ago

@thewilkybarkid, turns out it wasn't that much of a complication to implement :sweat_smile:. Could you see if #136 does what you need?

thewilkybarkid commented 3 years ago

Could you write a few lines about your use case?

It's only for local development, where it's not necessarily being served from the root (PhpStorm's built-in server doesn't, likewise loading directly from the filesystem). Easy to work around by using serve or similar.