You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is no way to opt-out of attribute normalization.
The problem is that transforming class=" xyz " to class="xyz" can lead to React hydration errors, and the minifier does not give us any escape hatch option to turn this normalization off.
Of course, it's better to not have such useless whitespace in the markup in the first place, but sometimes that extra whitespace comes from a third-party npm package and you can't easily fix it in userland.
Here's an example I encountered on the Docusaurus website:
Note that @swc/html minifier has such an option already: normalizeAttributes: false,
Version
7.2.0
What browsers are you seeing the problem on?
No response
Link to reproduce
No response
Relevant log output
No response
Willing to submit a PR?
None
The text was updated successfully, but these errors were encountered:
What happened?
There is no way to opt-out of attribute normalization.
The problem is that transforming
class=" xyz "
toclass="xyz"
can lead to React hydration errors, and the minifier does not give us any escape hatch option to turn this normalization off.Of course, it's better to not have such useless whitespace in the markup in the first place, but sometimes that extra whitespace comes from a third-party npm package and you can't easily fix it in userland.
Here's an example I encountered on the Docusaurus website:
Note that
@swc/html
minifier has such an option already:normalizeAttributes: false,
Version
7.2.0
What browsers are you seeing the problem on?
No response
Link to reproduce
No response
Relevant log output
No response
Willing to submit a PR?
None
The text was updated successfully, but these errors were encountered: