Rebuilds on any change
1Usage2$ dts watch [options]34Options5-i, --entry Entry module(s)6--target Specify your target environment (default web)7--name Specify name exposed in UMD builds8--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 screen11--onFirstSuccess Run a command on the first successful build12--onSuccess Run a command on a successful build13--onFailure Run a command on a failed build14--noClean Don't clean the dist folder15--transpileOnly Skip type checking16-h, --help Displays this message1718Examples19$ dts watch --entry src/foo.tsx20$ dts watch --target node21$ dts watch --name Foo22$ dts watch --format cjs,esm,umd23$ dts watch --tsconfig ./tsconfig.foo.json24$ dts watch --noClean25$ 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
Build your project once and exit
1Usage2$ dts build [options]34Options5-i, --entry Entry module(s)6--target Specify your target environment (default web)7--name Specify name exposed in UMD builds8--format Specify module format(s) (default cjs,esm)9--extractErrors Opt-in to extracting invariant error codes10--tsconfig Specify your custom tsconfig path (default <root-folder>/tsconfig.json)11--transpileOnly Skip type checking12-h, --help Displays this message1314Examples15$ dts build --entry src/foo.tsx16$ dts build --target node17$ dts build --name Foo18$ dts build --format cjs,esm,umd19$ dts build --extractErrors20$ dts build --tsconfig ./tsconfig.foo.json21$ dts build --transpileOnly
This runs Jest v24.x, forwarding all CLI flags to it. See https://jestjs.io for options. For example, if you would like to run in watch mode, you can run dts test --watch
. So you could set up your package.json
scripts
like:
1{2"scripts": {3"test": "dts test",4"test:watch": "dts test --watch",5"test:coverage": "dts test --coverage"6}7}
Run eslint with Prettier
1Usage2$ dts lint [options]34Options5--fix Fixes fixable errors and warnings6--ignore-pattern Ignore a pattern7--write-file Write the config file locally8--report-file Write JSON report to file locally9-h, --help Displays this message1011Examples12$ dts lint src13$ dts lint src --fix14$ dts lint src test --ignore-pattern test/foo.ts15$ dts lint src --write-file16$ dts lint src --report-file report.json