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/).
- 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:
process.exit(1)
}
+ output.sourcemap = !!process.env.SOURCE_MAP
output.externalLiveBindings = false
const isProductionBuild =
cacheRoot: path.resolve(__dirname, 'node_modules/.rts2_cache'),
tsconfigOverride: {
compilerOptions: {
+ sourceMap: output.sourcemap,
declaration: shouldEmitDeclarations,
declarationMap: shouldEmitDeclarations
},
const formats = args.formats || args.f
const devOnly = args.devOnly || args.d
const prodOnly = !devOnly && (args.prodOnly || args.p)
+const sourceMap = args.sourcemap || args.s
const isRelease = args.release
const buildTypes = args.t || args.types || isRelease
const buildAllMatching = args.all || args.a
formats ? `FORMATS:${formats}` : ``,
buildTypes ? `TYPES:true` : ``,
prodOnly ? `PROD_ONLY:true` : ``,
- lean ? `LEAN:true` : ``
+ lean ? `LEAN:true` : ``,
+ sourceMap ? `SOURCE_MAP:true` : ``
]
.filter(Boolean)
.join(',')
const args = require('minimist')(process.argv.slice(2))
const target = args._.length ? fuzzyMatchTarget(args._)[0] : 'vue'
const formats = args.formats || args.f
+const sourceMap = args.sourcemap || args.s
const commit = execa.sync('git', ['rev-parse', 'HEAD']).stdout.slice(0, 7)
execa(
[
`COMMIT:${commit}`,
`TARGET:${target}`,
- `FORMATS:${formats || 'global'}`
- ].join(',')
+ `FORMATS:${formats || 'global'}`,
+ sourceMap ? `SOURCE_MAP:true` : ``
+ ]
+ .filter(Boolean)
+ .join(',')
],
{
stdio: 'inherit'