Closed timfish closed 5 months ago
There are probably still some improvements to be had with the css regex since the output still has some unnessary spaces:
The css regex in transform-fragments.js
actually needs a minor addition. It doesn't strip leading whitespace and needs an additional ^\s+
.
So it would become:
/(?:\s*\/\*(?:[\s\S])+?\*\/\s*)|(?:;)\s+(?=\})|\s+(?=\{)|(?<=:)\s+|\s*([{};,])\s*|^\s+/g
Shall I create a PR for that first?
Pull Request
📖 Description
I found that the suggested Rollup config results in corrupted html:
In the output bundle you can see the missing space:
I tied these regexes and they fix the issue: https://github.com/microsoft/fast/blob/50dba9c58b1bc6ac0c8b948f68dd0cfb6485460b/build/transform-fragments.js
$ yarn change