Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript includeNodeModules option #79

Merged
merged 2 commits into from
Jan 8, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
typescript includeNodeModules option
  • Loading branch information
Gilad Gray committed Dec 6, 2018
commit 40f075acab369dc3155e0023aac018ad7e7a7e8c
16 changes: 16 additions & 0 deletions src/plugins/typescript/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,19 @@ export interface ITypescriptPluginOptions {
*/
includeDeclarations?: boolean;

/**
* Whether files in `node_modules` should be included in the TypeScript
* compilation context. This is disabled by default because it typically
* results in an explosion of data size due to including all types from _all
* installed packages_, the vast majority of which is not useful for
* documenting your own APIs.
*
* Enable at your own risk, and consider using the `excludeNames` and
* `excludePaths` options above to filter the output data.
* @default false
*/
includeNodeModules?: boolean;

/**
* Whether `private` fields should be included in the data.
* This is disabled by default as `private` fields typically do not need to be publicly documented.
Expand Down Expand Up @@ -79,6 +92,9 @@ export class TypescriptPlugin implements IPlugin<ITypescriptPluginData> {
logger: verbose ? console.log : "none",
mode: "modules",
};
if (options.includeNodeModules) {
delete typedocOptions.exclude;
}
if (options.tsconfigPath != null) {
// typedoc complains if given `undefined`, so only set if necessary
typedocOptions.tsconfig = tsconfigPath;
Expand Down