Taritsyn / JavaScriptEngineSwitcher

JavaScript Engine Switcher determines unified interface for access to the basic features of popular JavaScript engines. This library allows you to quickly and easily switch to using of another JavaScript engine.
Apache License 2.0
446 stars 49 forks source link

Loading of sourcemaps from webpack compiled scripts #93

Closed magnusottosson closed 3 years ago

magnusottosson commented 3 years ago

Hi,

I'm using the ReactJS.NET (https://github.com/reactjs/React.NET) package to server side render react components. I pre-compile the scripts using webpack. ReactJS.NET is using this package for JS engines and I'm using the V8 Engine from Microsoft.ClearScript

Is it possible to load pre-compiled sourcemaps (.map) files?

I see that ClearScript has a DocumentInfo where you can add the Uri of the source map but that is not exposed correct?

Taritsyn commented 3 years ago

Hello, Magnus!

Is it possible to load pre-compiled sourcemaps (.map) files?

No.

I see that ClearScript has a DocumentInfo where you can add the Uri of the source map but that is not exposed correct?

Yes, this functionality is not supported. JavaScript Engine Switcher is focused only on supporting the basic features of JS engines. If similar functionality appears in other JS engines, then I will start considering variants for adding it to API.

magnusottosson commented 3 years ago

Thanks for the reply. I ended up using https://github.com/sleeuwen/sourcemaps to enrich the stacktrace outside of the JS-engine which works just as good!