Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -388,14 +388,16 @@ Options
--format Specify module format(s) (default cjs,esm)
--tsconfig Specify your custom tsconfig path (default <root-folder>/tsconfig.json)
--verbose Keep outdated console output in watch mode instead of clearing the screen
--noClean Don't clean the dist folder
-h, --help Displays this message

Examples
$ tsdx watch --entry src/foo.tsx
$ tsdx watch --target node
$ tsdx watch --name Foo
$ tsdx watch --format cjs,esm,umd
$ tsdx build --tsconfig ./tsconfig.foo.json
$ tsdx watch --tsconfig ./tsconfig.foo.json
$ tsdx watch --noClean
```

### `tsdx build`
Expand Down Expand Up @@ -478,4 +480,4 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d

<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
6 changes: 5 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,14 +354,18 @@ prog
'Keep outdated console output in watch mode instead of clearing the screen'
)
.example('watch --verbose')
.option('--noClean', "Don't clean the dist folder")
.example('watch --noClean')
.option('--tsconfig', 'Specify custom tsconfig path')
.example('watch --tsconfig ./tsconfig.foo.json')
.option('--extractErrors', 'Extract invariant errors to ./errors/codes.json.')
.example('build --extractErrors')
.action(async (dirtyOpts: any) => {
const opts = await normalizeOpts(dirtyOpts);
const buildConfigs = createBuildConfigs(opts);
await cleanDistFolder();
if (!opts.noClean) {
await cleanDistFolder();
}
await ensureDistFolder();
if (opts.format.includes('cjs')) {
await writeCjsEntryFile(opts.name);
Expand Down