facebook / stylex

StyleX is the styling system for ambitious user interfaces.
https://stylexjs.com
MIT License
8.22k stars 303 forks source link

CSS Properties don't get written (esbuild) #492

Closed jonnitto closed 3 months ago

jonnitto commented 3 months ago

Describe the issue

I use esbuild togehter with stylex.defineVars. Sometimes the custom properties in :root get's written, but most of the time, the will not appear in the css file. Even when I run it with the build command, without a watcher.

I've got no clue, why this does this happen. No error in the cli, nothing.

Expected behavior

The custom properties gets written every time

Steps to reproduce

  1. Start using stylex.defineVars in a esbuild project. After some time, event without a change on the styles, to custom properties doesn't appear anymore.

Test case

No response

Additional comments

I don't know if this has something to do with #363

nedjulius commented 3 months ago

This seems to be a duplicate of #454. It's already fixed, but the fix is not published yet. In the meantime, you can try manually setting treeshakeCompensation option to true in the StyleX esbuild plugin options.