-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@parcel/transformer-svg and @parcel/transformer-css clashing over CSS inline styles #7479
Comments
It might be a naive question but can I ask why you're using |
As I mentioned, without Maybe I'm doing something else wrong, but this seems like a bug (somewhere) to me. |
Indeed, I did not read the "Context" part of your description - my mistake. I can confirm that parcel nightly does not process image references in SVG elements, tested using <svg width="200" height="200" xmlns="http://www.w3.org/2000/svg">
<image href="images/image.jpg?width=200&quality=40" height="200" width="200" />
</svg> When served or built using parcel without |
Running So |
In collecting HTML dependencies, it supports the Simply it is a tiny fix, only to add "image" to (By the way, the href of the image tag is supported when collecting the dependencies in svg) |
🐛 bug report
Applying
@parcel/transformer-svg
on an HTML-file with inline styles breaks a subsequent@parcel/transformer-css
call.🎛 Configuration (.babelrc, package.json, cli command)
I tried to find an MVE on the issue and so far reduced to this
package.json
.parcelrc
test.html
CLI command
🤔 Expected Behavior
Both the image as well as the inline CSS are processed and optimized.
😯 Current Behavior
Instead the above example result in the following error message - no output being generated.
💁 Possible Solution
Not a solution, but an observation:
@parcel/transformer-svg
seems to already move inline CSS to a separate asset in order to optimize. The specific occurrence is replaced with a key to later substitute again for the optimized CSS (I guess).@parcel/transformer-css
tries to do the same, but this time only retrieves the previous key, which then fails once it is passed topostcss
for parsing.🔦 Context
I'm trying to package an HTML file with quite mixed content (actually derived from a reveal.js presentation).
If I remove
@parcel/transformer-svg
from the.parcelrc
the inline-style works just fine, but the image is not processed.Adding
@parcel/transformer-svg
and removing the inline style works just fine and the image is processed as expected.But the combination of both (adding
@parcel/transformer-svg
and using inline style) breaks parcel it seems.💻 Code Sample
All necessary code is attached above.
🌍 Your Environment
The text was updated successfully, but these errors were encountered: