build: use api-extractor for type rollup

This commit is contained in:
Evan You
2019-09-03 12:16:22 -04:00
parent 015d5dd0f1
commit b2d269a651
29 changed files with 300 additions and 115 deletions

View File

@@ -81,13 +81,19 @@ function createConfig(output, plugins = []) {
output.name = packageOptions.name
}
const shouldEmitDeclarations =
process.env.TYPES != null &&
process.env.NODE_ENV === 'production' &&
!hasTSChecked
const tsPlugin = ts({
check: process.env.NODE_ENV === 'production' && !hasTSChecked,
tsconfig: path.resolve(__dirname, 'tsconfig.json'),
cacheRoot: path.resolve(__dirname, 'node_modules/.rts2_cache'),
tsconfigOverride: {
compilerOptions: {
declaration: process.env.NODE_ENV === 'production' && !hasTSChecked
declaration: shouldEmitDeclarations,
declarationMap: shouldEmitDeclarations
}
}
})