-
-
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
🐛"build" breaks dependencies detection in <svg><use/> #1019
Labels
Comments
Interim solution: create a {
minifySvg: false
} |
After some investigating it appears htmlnano transforms svg's ast into a minified content string: {
"tag": "svg",
"attrs": {
"xmlns:xlink": "http://www.w3.org/1999/xlink"
},
"content": [
"\n ",
{
"tag": "use",
"attrs": {
"xlink:href": "./file.svg#all"
}
},
"\n "
]
} After HTMLnano {
"tag": false,
"attrs": {},
"content": "<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\"><use xlink:href=\"./file.svg#all\"/></svg>"
} Not sure how to get past this from within parcel, as htmlnano executes before the ast walker |
Thank you! |
rishubil
added a commit
to rishubil/TrickyTowersUtils
that referenced
this issue
Mar 3, 2019
toreylittlefield
added a commit
to toreylittlefield/Drag-Drop-Vanilla-JavaScript
that referenced
this issue
Aug 5, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Choose one: is this a 🐛 bug report or 🙋 feature request?
🐛Bug
SVG files linked with
<use>
are detected correctly withparcel watch
but they're left untouched when usingparcel build
.🎛 Configuration (.babelrc, package.json, cli command)
No config
🤔 Expected Behavior
The linked SVG is detected and processed.
So two files should be generated.
This works correctly in
parcel watch
😯 Current Behavior
The
use
tag in theindex.html
is left untouched:And only one file is generated:
$ ./node_modules/.bin/parcel build --no-cache ✨ Built in 1.06s. dist/e4746ad4854ea1f42b9990e63012fe62.html 102 B 1.00s $ tree dist dist └── e4746ad4854ea1f42b9990e63012fe62.html 0 directories, 1 file
💻 Code Sample
🌍 Your Environment
The text was updated successfully, but these errors were encountered: