You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm writing a plugin that uses a custom typescript transformer and outputs js with some extra types metadata. this is a similar scenario to an svelte plugin.
The problem is the sourceMaps are broken, esBuild support adding the source map as inlined sourcemaps, example here. But bun is not reading these source maps.
It would also be useful to be able to pass the sourcemap directly, alongside contents, not just inlined.
Note that this should also work for loaders stacktraces, not just the bundler.
What version of Bun is running?
1.0.1
What platform is your computer?
Darwin 21.6.0 x86_64 i386
What steps can reproduce the bug?
I'm writing a plugin that uses a custom typescript transformer and outputs js with some extra types metadata. this is a similar scenario to an svelte plugin.
The problem is the sourceMaps are broken, esBuild support adding the source map as inlined sourcemaps, example here. But bun is not reading these source maps.
here is an example of the loader
here is an example of an small size original TS file:
and here is an example of the transformed JS code returned by
builder.onLoad
(see the inline sourceMap)So when there are any errors bun is ignoring the inlined sourceMap and referencing the transformed code instead the original file.
What is the expected behavior?
bun to use the inlined sourceMap and prints valid errors that reference the original file instead the transformed code.
What do you see instead?
No response
Additional information
plugin loader and unit tests here: https://github.com/MionKit/mion/tree/ad-support-for-bun.sh/packages/bun/loader
The text was updated successfully, but these errors were encountered: