How to get unique asset id for font preloading #8575
Replies: 2 comments
-
That's not really possible.
Not sure if that's what you're asking, but you could write a Parcel reporter that has access to this information (e.g. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your response! - I think the route we will need to take is upgrading to Parcel 2 and using a namer plugin to turn the hash completely off |
Beta Was this translation helpful? Give feedback.
-
Hi there, we have self hosted fonts in which are compiled in the scss and given unique id's added to the final asset. The ids added are different from the local dev environment and the build process for production,
ex.
#fontname_bold.e303dc32.woff2 (local environment)
#fontname_bold.5718894f.woff2 (production, with build process)
The project is wordpress and I am trying to generate font preload links in the enqueue.php file, wondering if its possible to get the path in the php file that will point to the uniquely generated font file asset(s) in local and in production.
Would the solution be to have the local build / production build create the same named assets(with ids), or would it be to somehow get the correct path for both local/production in the php file?
Thank you,
Beta Was this translation helpful? Give feedback.
All reactions