diff --git a/src/index.js b/src/index.js index b83c007f..ba5d10d0 100644 --- a/src/index.js +++ b/src/index.js @@ -227,6 +227,14 @@ async function getOutput({ cwd, output, pkgMain, pkgName }) { } function getDeclarationDir({ options, pkg }) { + try { + const tsconfig = JSON.parse(fs.readFileSync(options.tsconfig || "tsconfig.json", 'utf-8')) + + if (tsconfig && tsconfig.compilerOptions && tsconfig.compilerOptions.declaration === false) { + return undefined; + } + } catch(err) {} + const { cwd, output } = options; let result = output;