Skip to content
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

HTML visible="false" gets minified to visible with no assigned value #62

Closed
dsinni opened this issue Sep 8, 2018 · 10 comments
Closed
Labels

Comments

@dsinni
Copy link

dsinni commented Sep 8, 2018

I'm using ParcelJS 1.9.7 with htmlnano to bundle my A-Frame/WebVR/XR apps, and I've noticed some weird behavior with my apps after bundling the production build.

I discovered that this is because visible="false" in HTML is getting minified to visible with no assigned value, rendering the attribute ineffective. visible is a valid attribute for A-Frame, so I need it to get minified with the correct value.

I've tried overriding the documented options in .htmlnanorc, but none of them seems to fix the issue.

How can I avoid this? Any help would be appreciated.

Thanks.

@maltsev
Copy link
Member

maltsev commented Sep 9, 2018

Thanks for submitting the bug report!

While I'm trying to figure out how to fix it I'd suggest you disabling the following minification in your config until the fix will be released:

collapseBooleanAttributes: false

I've tried overriding the documented options in .htmlnanorc

htmlnano doesn't support .htmlnanorc yet. I've opened issue #63 for implementing it.

@maltsev maltsev added the bug label Sep 9, 2018
@dsinni
Copy link
Author

dsinni commented Sep 9, 2018

Thanks, @maltsev! That did the trick, at least until you release a more robust solution, if necessary.

I didn't see collapseBooleanAttributes in the documentation, however. Am I missing something?

htmlnano doesn't support .htmlnanorc yet. I've opened issue #63 for implementing it.

That's odd, because it's actually working for me. I'm using Parcel, but it worked automatically after installing htmlnano 0.1.10 as a dev dependency. Maybe it's actually Parcel that supports .htmlnanorc?

@maltsev
Copy link
Member

maltsev commented Sep 12, 2018

I didn't see collapseBooleanAttributes in the documentation, however. Am I missing something?

Seems like you are :-) Here is the link to that section.

@dsinni
Copy link
Author

dsinni commented Sep 12, 2018

Ah, not sure how I missed that. Thanks, @maltsev!

@maltsev
Copy link
Member

maltsev commented Sep 13, 2018

The bug has been fixed. The fix will be released in 0.2.0 version (I think next week).

@maltsev maltsev closed this as completed Sep 13, 2018
@maltsev
Copy link
Member

maltsev commented Sep 14, 2018

Released: 0.2.0.

@dsinni
Copy link
Author

dsinni commented Sep 14, 2018

Awesome! Thanks, @maltsev!

Was the issue specific to visible, or may other attributes have the same issue? If so, does this fix that as well?

Thanks again.

@maltsev
Copy link
Member

maltsev commented Sep 14, 2018

Was the issue specific to visible, or may other attributes have the same issue?

I checked the A-Frame docs and it seems that visible is the only attribute the module collapses. No there shouldn't be any other issues with this module.

@dsinni
Copy link
Author

dsinni commented Sep 14, 2018

Excellent! Thank you, sir.

When do you expect the new release will be available via npm?

@dsinni
Copy link
Author

dsinni commented Sep 14, 2018

Scratch that last comment. Got confused with Parcel for a second. Thanks for everything!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants