I am evaluating javascript
bundled source code in nodejs
using the below code
const javascriptCode = "..."
const javascriptSourceMap = "..."
const wrapper = NativeModule.wrap(javascriptCode);
const script = new vm.Script(wrapper, {
displayErrors: true
});
script.runInNewContext();
When there is an error in the source code I get errors like this because no source maps are provided
ReferenceError: a is not defined
at VueComponent.testSomething (evalmachine.<anonymous>:43112:7)
at VueComponent.testSomethingAgain (evalmachine.<anonymous>:43109:12
How to provide source maps to VM so that I can get proper filenames instead of evalmachine.<anonymous>
?
Thanks in advance
try
then you get