SINTEF-9012 / PruneCluster

Fast and realtime marker clustering for Leaflet
MIT License
551 stars 131 forks source link

Removing the source mapping #146

Closed rhynix closed 7 years ago

rhynix commented 7 years ago

Using PruneCluster results in a request for the source mapping when opening the developer console. Since we don't provide the source mapping on our server, this leads to a 404 error for this request. I don't think the source mapping makes sense in a production environment, especially in our case since we compile all javascript into a single file. I would like to prevent the source mapping from being requested at all.

I was wondering if it would be possible to remove the source mapping url from the distributed javascript. Perhaps there could be separate build process for development that creates a file that is not in version control, that does contain the source mapping url. If there is any other way to prevent the source mapping from being requested, I would love to hear this too.

fungiboletus commented 7 years ago

Hei,

I guess we need to remove the last line of the file. I never had this problem because I minify all the dependencies together.

Could you remove the line on your local installation, or do you need a new release with the line removed ?

rhynix commented 7 years ago

Thank you for your help. Removing it from my local installation would be inconvenient since I use the npm package. That being said, I realised that we minify all the dependencies in production as well, so for me this is nothing more than a slight nuisance in my development environment. I solved that by removing the pragma comment during a processing step before the dependencies are bundled.

I am not sure if it best practice to leave the source mapping in the distributed javascript file and if others have the same issue. If you would like, I could submit a pull request to split the ts:build task into two tasks, one for development which generates the source mapping and one for distribution which does not generate the source mapping, but I am not sure if this is the correct solution.

fungiboletus commented 7 years ago

That would be great if you have time for a pull-request. It's maybe not the perfect solution, but I think it's a good solution, and that's better than nothing.