2025-03-14 21:59:59 -06:00
|
|
|
# swc
|
|
|
|
|
|
|
|
|
|
> JavaScript and TypeScript compiler written in Rust.
|
2025-12-16 10:20:31 -07:00
|
|
|
> More information: <https://swc.rs/docs/usage/cli>.
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Transpile a specified input file and output to `stdout`:
|
|
|
|
|
|
|
|
|
|
`swc {{path/to/file}}`
|
|
|
|
|
|
|
|
|
|
- Transpile the input file every time it is changed:
|
|
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`swc {{path/to/file}} {{[-w|--watch]}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Transpile a specified input file and output to a specific file:
|
|
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`swc {{path/to/input_file}} {{[-o|--out-file]}} {{path/to/output_file}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Transpile a specified input directory and output to a specific directory:
|
|
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`swc {{path/to/input_directory}} {{[-d|--out-dir]}} {{path/to/output_directory}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Transpile a specified input directory using a specific configuration file:
|
|
|
|
|
|
|
|
|
|
`swc {{path/to/input_directory}} --config-file {{path/to/.swcrc}}`
|
|
|
|
|
|
|
|
|
|
- Ignore files in a directory specified using glob path:
|
|
|
|
|
|
|
|
|
|
`swc {{path/to/input_directory}} --ignore {{path/to/ignored_file1 path/to/ignored_file2 ...}}`
|