nx/packages/js/docs/library-examples.md
Chau Tran 6b6995a81e
docs(js): library generator examples (#12568)
Co-authored-by: Chau Tran <chautran@10.0.0.9>
2022-10-13 22:50:19 +07:00

36 lines
571 B
Markdown

## Examples
{% tabs %}
{% tab label="Using directory flag" %}
Generate a library named `mylib` and put it under a directory named `myapp` (`libs/myapp/mylib`)
```shell
npx nx g lib mylib --directory=myapp
```
{% /tab %}
{% tab label="Use SWC compiler" %}
Generate a library using [SWC](https://swc.rs) as the compiler
```shell
npx nx g lib mylib --compiler=swc
```
{% /tab %}
{% tab label="Minimal publishing target" %}
Generate a **publishable** library with a minimal publishing target
```shell
npx nx g lib mylib --publishable
```
{% /tab %}
{% /tabs %}