From 790194cca8c09746d63b6a13db4564f2627338f6 Mon Sep 17 00:00:00 2001 From: Abner Soares Alves Junior Date: Sat, 27 Jan 2024 21:15:55 -0500 Subject: [PATCH] feat: updates CLI docs adding new `strip-leading-paths` parameter (#235) Update cli.mdx Related to [this PR](https://github.com/swc-project/cli/pull/283) This PR introduces the `strip-leading-paths` command to the `cli`. This was a recent change and was undocumented in the docs, but very important. --- pages/docs/usage/cli.mdx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pages/docs/usage/cli.mdx b/pages/docs/usage/cli.mdx index e826880a..0a7f083a 100644 --- a/pages/docs/usage/cli.mdx +++ b/pages/docs/usage/cli.mdx @@ -194,3 +194,11 @@ npx swc input.js --log-watch-compilation ### --extensions Use specific extensions. + +### --strip-leading-paths + +Remove the leading directory (including all parent relative paths) when building the final output path. As an example it compiles all modules under `src` folder to `dist` folder, without create the `src` folder inside of `dist`. + +```sh +npx swc src -d dist --strip-leading-paths +```