Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parcel loses track of source maps #44

Open
davesmith00000 opened this issue Feb 2, 2022 · 1 comment
Open

Parcel loses track of source maps #44

davesmith00000 opened this issue Feb 2, 2022 · 1 comment

Comments

@davesmith00000
Copy link
Member

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

@davesmith00000
Copy link
Member Author

davesmith00000 commented Feb 3, 2022

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: 3577283

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.

image

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant