Replies: 1 comment 2 replies
-
This already exists: parcel/packages/transformers/image/src/ImageTransformer.js Lines 19 to 24 in 069a2b1 import image from 'url:./image.jpg?height=200';
import image from 'url:./image.webp?height=200&width=300';
import image from 'url:./image.png?width=300'; |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to write a Parcel v2 transformer that edits font files down to a given subset of glyphs.
Each font file should have its glyph subset defined independently, and I also want to be able to embed the resulting font directly into the CSS referencing it with a
data:
URL. My first thought was to use query parameters in the URL that Parcel resolves: something likeurl('path/to/source/font.woff2?subset=<glyphs to include>')
, with an optionaldata-url:
at the front if I want to embed the resulting font. However, starting down this path, myTransformer
gets called but thequery
property on the asset is undefined.Is there another way to get the query parameters of an asset from a transformer? Or, perhaps more importantly, does Parcel want me to provide per-asset configuration like this in some other way, a way which hopefully is also compatible with using a named pipeline like
data-url:
?Beta Was this translation helpful? Give feedback.
All reactions