API Reference#

dts watch#

sh
1
Usage
2
$ dts watch [options]
3
4
Options
5
-i, --entry Entry module(s)
6
--target Specify your target environment (default web)
7
--name Specify name exposed in UMD builds
8
--format Specify module format(s) (default cjs,esm)
9
--tsconfig Specify your custom tsconfig path (default <root-folder>/tsconfig.json)
10
--verbose Keep outdated console output in watch mode instead of clearing the screen
11
--onFirstSuccess Run a command on the first successful build
12
--onSuccess Run a command on a successful build
13
--onFailure Run a command on a failed build
14
--noClean Don't clean the dist folder
15
--transpileOnly Skip type checking
16
-h, --help Displays this message
17
18
Examples
19
$ dts watch --entry src/foo.tsx
20
$ dts watch --target node
21
$ dts watch --name Foo
22
$ dts watch --format cjs,esm,umd
23
$ dts watch --tsconfig ./tsconfig.foo.json
24
$ dts watch --noClean
25
$ dts watch --onFirstSuccess "echo The first successful build!"
26
$ dts watch --onSuccess "echo Successful build!"
27
$ dts watch --onFailure "echo The build failed!"
28
$ dts watch --transpileOnly

dts build#

sh
1
Usage
2
$ dts build [options]
3
4
Options
5
-i, --entry Entry module(s)
6
--target Specify your target environment (default web)
7
--name Specify name exposed in UMD builds
8
--format Specify module format(s) (default cjs,esm)
9
--extractErrors Opt-in to extracting invariant error codes
10
--tsconfig Specify your custom tsconfig path (default <root-folder>/tsconfig.json)
11
--transpileOnly Skip type checking
12
-h, --help Displays this message
13
14
Examples
15
$ dts build --entry src/foo.tsx
16
$ dts build --target node
17
$ dts build --name Foo
18
$ dts build --format cjs,esm,umd
19
$ dts build --extractErrors
20
$ dts build --tsconfig ./tsconfig.foo.json
21
$ dts build --transpileOnly

dts test#

json
1
{
2
"scripts": {
3
"test": "dts test",
4
"test:watch": "dts test --watch",
5
"test:coverage": "dts test --coverage"
6
}
7
}

dts lint#

sh
1
Usage
2
$ dts lint [options]
3
4
Options
5
--fix Fixes fixable errors and warnings
6
--ignore-pattern Ignore a pattern
7
--write-file Write the config file locally
8
--report-file Write JSON report to file locally
9
-h, --help Displays this message
10
11
Examples
12
$ dts lint src
13
$ dts lint src --fix
14
$ dts lint src test --ignore-pattern test/foo.ts
15
$ dts lint src --write-file
16
$ dts lint src --report-file report.json
API Reference