Skip to content

Commit

Permalink
Fixed undefined issue
Browse files Browse the repository at this point in the history
- check if options.extensions is defined before calling find
  • Loading branch information
high1 committed Jan 3, 2022
1 parent 2e07b2b commit ea2724e
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 @@ -351,8 +351,8 @@ export default function solidPlugin(options: Partial<Options> = {}): Plugin {

if (
id.includes('tsx') ||
options.extensions.find((ext) =>
typeof ext === 'string' ? ext === extension : ext[0] === extension && ext[1].typescript,
options.extensions?.find(
(ext) => typeof ext !== 'string' && ext[0] === extension && ext[1].typescript,
)
) {
opts.presets.push([ts, options.typescript || {}]);
Expand Down

0 comments on commit ea2724e

Please sign in to comment.