Skip to content

Conversation

cspotcode
Copy link
Contributor

Fixes #4.

By using require.resolve to locate typedoc's package.json, we can reliably find the root directory of typedoc. Then we ascend up a directory, descend into .bin, and we've found typedoc's executable.

…ated

- `require.resolve('<module name>/package.json')` will properly locate the path to an npm module
- we must find `package.json` specifically because it is guaranteed to
  exist in the module's root.  It's possible that a
  module's `package.json` declares `"main": "lib/subdir/index.js"`
@pellekrogholt
Copy link

+100 to get this merged in

vvakame added a commit that referenced this pull request Mar 29, 2015
Fixes the method by which the location of typedoc's executable is locate...
@vvakame vvakame merged commit 853eace into TypeStrong:master Mar 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

wrong typedoc path when loading grunt-typedoc a npm module
3 participants