runtime loading of source maps?
michaelAtCoalesce opened this issue · 1 comments
is there a way to load source maps at runtime?
i'd like to store my source maps in a specific location on my webserver, say build/sourcemaps/
- but i don't want to embed them with the sourceMappingURL comment so that customers can see it.
i'd like to, only when i need it, somehow configure the stacktrace.js to only pull the sourcemaps at the moment that i need them from this hidden location on my webserver - is this possible?
In a browser environment, I think this would only defer the loading and those customers could see it in their network requests effectively making it theatre.
But, you should be able to generate your bundles with a sourceMappingURL
targeting a remote source (i.e. some path on your webserver) and stacktrace.js
will fetch it on demand (assuming offline
is not true
). Probably need some sort of auth/firewall on that endpoint since you're concerned about the maps being public. Using sourceCache
would let you fetch the resources yourself as well.