Open davesmith00000 opened 2 years ago
I'm not going to work on this right now.
I had no luck finding an obvious solution using Parcel, but I did have some success with webpack 5, using the scalajs-friendly-source-map-loader
webpack plugin.
However you can't use it with the dev server because it complains about paths, you have to build it, and run a static server from the dist
folder. Speculate that it might work in webpack 4 maybe? The path warnings seem to be a new thing, but what do I know?
Here is the commit on a branch: https://github.com/PurpleKingdomGames/tyrian/commit/3577283df81391672c468d8718cd9165bf0e3906
In the screenshot below, you can see a tyrian app, running an embedded indigo game, and the profiler is merrily telling us that this bit of the code came from GameLoop.scala:53:4
.
Clicking on the hyperlinked GameLoop.scala:53:4
will show you the real Scala code, and give you the times spent in running the code there.
Webpack is a lot more hassle than Parcel however, and the experience was far from smooth. So it needs another attempt. It may even be worth writing a Parcel plugin?
I suspect all that's happening is that parcel keeps moving things around during the build and the browser can't keep up.
There's some suggestion here that we might be able to tell parcel where to look - but my initial stab at this wasn't very fruitful.
https://parceljs.org/features/targets/#sourcemap