build: support source map in build and dev scripts

This commit is contained in:
Evan You
2020-01-28 10:28:40 -05:00
parent 827fd05644
commit 78beed2574
4 changed files with 18 additions and 4 deletions

View File

@@ -106,9 +106,13 @@ Multiple formats can be specified as a comma-separated list:
yarn build runtime-core -f esm,cjs
```
#### Build with Source Maps
Use the `--sourcemap` or `-s` flag to build with source maps. Note this will make the build much slower.
#### Build with Type Declarations
The `--types` flag will generate type declarations during the build and in addition:
The `--types` or `-t` flag will generate type declarations during the build and in addition:
- Roll the declarations into a single `.dts` file for each package;
- Generate an API report in `<projectRoot>/temp/<packageName>.api.md`. This report contains potential warnings emitted by [api-extractor](https://api-extractor.com/).
@@ -129,6 +133,8 @@ $ yarn dev
- The `dev` script supports specifying build format via the `-f` flag just like the `build` script.
- The `dev` script also supports the `-s` flag for generating source maps, but it will make rebuilds slower.
### `yarn test`
The `yarn test` script simply calls the `jest` binary, so all [Jest CLI Options](https://jestjs.io/docs/en/cli) can be used. Some examples: