Skip to content

Commit ff2460b

Browse files
committed
fix(esbuild): don't return empty result in onLoad
1 parent c533d61 commit ff2460b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/esbuild/index.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,12 @@ export function getEsbuildPlugin<UserOptions = Record<string, never>>(
9595
break
9696
}
9797

98-
result = result || {}
99-
10098
for (const { options, onTransformCb } of loaders) {
10199
if (!checkFilter(options))
102100
continue
103101

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

0 commit comments

Comments
 (0)