Replies: 2 comments 2 replies
-
For what it's worth, I came up with a workaround using sbuild with a custom StyleX plugin that invokes Babel under the hood and surprisingly it works. I haven't tested this thoroughly, but I did use Grok 3 to generate an architecture document to help me how this, help me remember how this works in the future: https://gist.github.com/zaydek/a735433b0a10100ff5675227f46a85f3. |
Beta Was this translation helpful? Give feedback.
-
You're right that the CLI is not great for debugging if you want to see the original code. The thinking is that by generating a folder of files with StyleX transformed away, you can debug by looking at those files instead. In many cases this should also help demystify what StyleX is being transformed into which can help debug styling issues. |
Beta Was this translation helpful? Give feedback.
-
I got the StyleX CLI working, but there's one thing I'm confused about. My understanding is that the CLI wants to take an input directory, apply all the StyleX preprocessing, and then emit a target output directory. But when you emit the output directory, there's no sourcemap, so now the lgos and errors will show you the
.js
file as opposed to the original.tsx
file, and the LOC will often be the wrong one because of inconsistencies with whitespace, formatting, etc. Am I missing something? This doesn't seem optimal for debugging code.I did review https://github.com/facebook/stylex/blob/main/packages/cli/src/options.js and https://babeljs.io/docs/babel-preset-typescript and so far haven't worked out if there's a way to get this behavior by looking more closely at the Babel plugins the CLI invokes. Does the CLI support sourcemaps or something like sourcemaps so you can know the original file and LOC logs and errors are being emitted from?
Here's the configuration file I'm using
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions