facebook / stylex

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

@stylexjs/cli Missing Plugin #624

Closed besSejrani closed 2 months ago

besSejrani commented 3 months ago

Describe the issue

When I try to run the cli on a single .tsx file, I get following error

parser/lib/index.js:10365:23) { code: 'BABEL_PARSE_ERROR', reasonCode: 'MissingOneOfPlugins', loc: Position { line: 16, column: 4, index: 324 }, pos: 324, missingPlugin: [ 'jsx', 'flow', 'typescript' ] }

this is my stylex.json file

{ "input": "./src/Components/ui", "output": "./stylex", "modules_EXPERIMENTAL": ["@stylexjs/open-props"], "styleXBundleName": "stylex_bundle.css" }

One other problem, after installing the cli

I can't just use stylex directly, i need to do npx stylex --config stylex.json or pnpm stylex --config stylex.json

i get following error

zsh: command not found: stylex

Expected behavior

I would expect to be able to use the cli directly, maybe configure the .json file before hand

Steps to reproduce

Test case

No response

Additional comments

No response

nmn commented 3 months ago

Please see the example app using the CLI. You have to use the babelPresets key in the configuration to enable the CLI to understand TS syntax.

We are working on adding more configuration options.

besSejrani commented 2 months ago

Thank you