nomaed / dts-builder

Builds a single d.ts file library from generated d.ts sources
MIT License
12 stars 4 forks source link

dts-builder won't create a directory provided by the `destDir` option and throw "ENOENT: no such file or directory" error if it doesn't exist #1

Closed artyil closed 7 years ago

artyil commented 7 years ago

my config:

const dtsBuilder = require('dts-builder');
const projectRoot = 'pathtomyproject';
dtsBuilder.generateBundles([{
  name: 'types',
  alias: 'alias',
  sourceDir: `${projectRoot}/built`,
  destDir: `${projectRoot}/dist/types`,
  externals: [
    `${projectRoot}/src/my.d.ts`,
  ]
}])

Expected behavior: dts-builder should create the _MY_PROJECTPATH/dist/types/ directory if it doesn't exist.

Actual behavior: Error is thrown: console output:

MY_PROJECT_PATH/node_modules/dts-builder/dist/index.js:168 throw new Error(err.message); ^

Error: ENOENT: no such file or directory, open 'MY_PROJECT_PATH/dist/types/my.d.ts'

nomaed commented 7 years ago

Should be fixed with Commit 72f8cc23ae091d234dd9bbe155e13c58feb1700e