Enable Source Mapping

Is it possible to use something like source mapping when building with webpack? Sometimes the error messages in the XD Dev Console are ambiguous, referring to a line from the bundled main.js, not the true source file.

-Thanks!

1 Like

The build process compiles your code into one single main.js file which is the only file XD looks at other than manifest.json. I can’t think of a good wait to map it back to the source code. anyone?

1 Like

@stevekwak
There is a standard for source maps (in JS), which could (and for this would have to get parsed) by XD. Cf. https://www.html5rocks.com/en/tutorials/developertools/sourcemaps/. With it (which can get generated for basically all build processes, may that be from TypeScript, a simple webpack JS to JS compilation or whatever else), it is possible to trace back the “original” file location.

1 Like