Skip to content

Commit

Permalink
fix: Don't console.error if importing ts fails
Browse files Browse the repository at this point in the history
  • Loading branch information
bebraw committed May 24, 2021
1 parent c1f61e4 commit 96267e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ class EmptyPlugin {

let plugin: DocgenPluginType;

// It should be possible to use the plugin without TypeScript.
// In that case using it is a no-op.
try {
require.resolve("typescript");
plugin = require("./plugin").default;
} catch (error) {
console.error(error);

plugin = EmptyPlugin as any;
}

Expand Down

0 comments on commit 96267e5

Please sign in to comment.