stylify / packages

💎 Monorepository for Stylify packages. Stylify uses CSS-like selectors to generate Extremely optimized utility-first CSS dynamically based on what you write 💎.
https://stylifycss.com
MIT License
424 stars 9 forks source link

Bug with rewriteSelectorsInFiles: true - Badly formatted content #261

Closed micisse closed 1 year ago

micisse commented 1 year ago

Describe the bug

Still in my exploration of stylify. I observed a bug related to "rewriteSelectorsInFiles: true" (See video for better understanding). Another observation is that at build time, the concerned file is also modified and badly formatted. The change in place of the selectors does not seem to work because of a comment like "// ts-ignore ..: <explanation>" or "// eslint-ignore // <explanation>" with chevron for example.

Enlarge the video to see it better

https://github.com/stylify/packages/assets/56940294/eba54163-3dc0-41ea-a5b4-fe86c7af92e6

Without realizing it, with the activation of "rewriteSelectorsInFiles", several files have been impacted by the changes and the final build does not work because the files are modified in the wrong way. Luckily I make a copy of the original files first. These details (bugs) have an impact.

Reproduction

https://stackblitz.com/edit/remix-run-remix-fkre57?file=app%2Froutes%2F_index.tsx,stylify.js,package.json

Logs

No response

System Info

v0.6.0 / @stylify/bundler
Machy8 commented 1 year ago

Hi @micisse , thanks for the submission! I will try to look into it as soon as possible.

Machy8 commented 1 year ago

Hi @micisse , this should be fixed in 0.6.1. I have tested it in the stackblitz you send and it seems to work. Try to update the version.

Could you please try it and let me know?

micisse commented 1 year ago

Hi @Machy8, I've tested it and it's fine for now... I'll go back up if I run into any more problems.