Skip to content

Commit

Permalink
fix: don't break if other plugin is added
Browse files Browse the repository at this point in the history
For example the next plugin doesn't use ts-patch and when defined will result in an error
  • Loading branch information
UnderKoen authored and nonara committed Jan 10, 2024
1 parent 272d16a commit f2b591e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion projects/patch/src/plugin/plugin-creator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@ namespace tsp {
const { resolveBaseDir } = options;

/* Create plugins */
this.plugins = configs.map(config => new TspPlugin(config, { resolveBaseDir }));
this.plugins = configs
.filter(config => config.transform !== undefined)
.map(config => new TspPlugin(config, { resolveBaseDir }));

/* Check if we need to parse all JSDoc comments */
this.needsTscJsDocParsing = this.plugins.some(plugin => plugin.packageConfig?.tscOptions?.parseAllJsDoc === true);
Expand Down

0 comments on commit f2b591e

Please sign in to comment.