diff --git a/src/esbuild/index.ts b/src/esbuild/index.ts index 092a91ee..d7b415e5 100644 --- a/src/esbuild/index.ts +++ b/src/esbuild/index.ts @@ -95,13 +95,12 @@ export function getEsbuildPlugin>( 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.