I updated bud 5.7.7 to 6.2.0.
Previously I was able to load fonts as follows:
src: url('~@fonts/monotype-dinnextltpro-bold.woff2') format('woff2'),
This still works fine in dev mode, but not when I build for production.
These are the kind of errors I get:
downloadable font: download failed [..] source: https://mydomain.com/fonts/monotype-dinnextltpro-bold.ea9f5b.woff2
Did something change since Bud 5.7.7 that causes this?
Ok, I think adding
to bud.config.js solved my problem
This particular issue is resolved in 6.3.0, but it can be resolved in any version by just setting the public path. What is the rationale for being so averse to it?
is a reason are reasons why it is a near universal requirement of all major popular frameworks. See 6.3.0 release notes for more on this:
The only case where a public path should be an issue is if you are distributing a theme (since you can’t control the public path of the wordpress that is using it). If you’re distributing a theme you have earned a pardon.
To re-iterate what @kellymears said, the proper solution to this is to set the public path. This is now a requirement moving forward in Sage 10, and was always required in Sage 9. See the PR or the latest Bud config in Sage 10 for an example.
* URI of the `public` directory
Thanks for adding .setPublicPath to the newest Sage release as default. That will definitely help new users.