A Command Line Interface (CLI) to pre-compile StyleX usage in a folder of files and generate folder of files with a separate CSS file that can then be bundled with exotic setups.
Simply install the CLI to start using it
npm install --save-dev @stylexjs/cli
stylex -i [input_directory] -o [output_directory]
The input directories to compile with StyleX
alias: -i
type: array
required: true
Name of the StyleX output directories.
alias: -o
type: array
required: true
The name of the compiled css file StyleX generates
alias: -b
type: string
required: false
default: stylex_bundle.css
Flag to enable automatic recompiling of files in the input directory on change. Currently only supports usage with a single input/output directory
alias: -w
type: boolean
required: false
default: false
A list of node modules to also compile with StyleX. Used to include compiling
dependencies that contain .stylex.js
files. Has optional "ignore"
functionality that allows ignoring specific directories in the compiled output
module.
alias: -m
type: array
required: false
default: []
example: [['@stylexjs/open-props', { ignore: ['src'] }]]
path of a .json (or .json5) config file
You can create a .json
or .json5
config file and pass it to the CLI.
{
"input": "./source",
"output": "./src",
"modules_EXPERIMENTAL": ["@stylexjs/open-props"],
"styleXBundleName": "stylex_bundle.css",
"watch": true
}