Permalink
be83467 Dec 26, 2017
22 lines (18 sloc) 503 Bytes
const dts = require('dts-bundle')
const { join } = require('path')
const cwd = process.cwd()
const pkgJSON = require(join(cwd, 'package.json'))
if (pkgJSON.name === 'nerv-redux') {
return
}
try {
const name = pkgJSON.name === 'nervjs' ? 'nerv' : pkgJSON.name
dts.bundle({
main: join(__dirname, 'lib', 'packages', name, 'src/index.d.ts'),
name: pkgJSON.name,
out: join(cwd, 'dist/index.d.ts')
})
console.log(`${pkgJSON.name} in typings is DONE`)
} catch (e) {
throw Error(e)
}