Skip to content

Commit

Permalink
fix(esbuild): don't return empty result in onLoad
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Mar 6, 2024
1 parent c533d61 commit ff2460b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/esbuild/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,12 @@ export function getEsbuildPlugin<UserOptions = Record<string, never>>(
break
}

result = result || {}

for (const { options, onTransformCb } of loaders) {
if (!checkFilter(options))
continue

if (onTransformCb) {
result = result || {}
// caution: 'utf8' assumes the input file is not in binary.
// if you want your plugin handle binary files, make sure to
// `plugin.load()` them first.
Expand Down

0 comments on commit ff2460b

Please sign in to comment.