Component generator
Main Trecli feature is component generator.
#
Generator commandTo generate component run default command:
or use full command
or use alias
#
Generator optionsTrecli ships with a handful of customizable options, usable in both the CLI and configuration file.
#
Index File GenerationSpecify if component contain index.ts
file.
Default | CLI option | CLI alias | Configuration file |
---|---|---|---|
false | --index | --idx | index: <boolean> |
#
Styles SolutionsValid options:
"css"
- Basic CSS stylesheet"css-modules"
- CSS Modules stylesheet"material-ui"
- Material-UI styles hook
Default | CLI option | CLI alias | Configuration file |
---|---|---|---|
false | --styles=<"css"∣"css-modules"∣"material-ui"> | -s | styles: <"css"∣"css-modules"∣"material-ui"∣false> |
note
If you have styles
value specified in your configuration file you can still generate component without style by adding --no-styles
or --no-s
option to command.
#
Lazy LoadedSpecify if component will be exporting named of default export. Default export is necessary if you are going to import component with React.lazy
.
Default | CLI option | CLI alias | Configuration file |
---|---|---|---|
false | --lazy-loaded | -l | lazyLoaded: <boolean> |
More information about React.lazy
and exports is available in official react documentation