wooorm / xdm

Just a *really* good MDX compiler. No runtime. With esbuild, Rollup, and webpack plugins
http://wooorm.com/xdm/
MIT License
594 stars 18 forks source link

esbuild: fix empty string for `pluginData.contents` #58

Closed Arcath closed 3 years ago

Arcath commented 3 years ago

This is a minor bug fix for something that was reported to me by a mdx-bundler user.

Passing an empty string through the pluginData.contents system is falsey which causes the plugin to fallback on reading the file directly. This of course throws an error for us as the file path doesn't exist.

This solution checks if its not undefined instead of it being truthy.

wooorm commented 3 years ago

Thanks @Arcath, released in 1.11.1!