I have a situation where I need to know the filename that Meteor will use when bundling up an app and sending it up to Galaxy. I’m using Rollbar for logging, and it supports using source maps to show cleaner looking errors, but it needs to know my app’s minified JS URL, which changes every time Meteor bundles up an app.
So I have a Meteor deploy script I run when deploying to Galaxy, which ends in a call to Rollbar to report the deployment:
You could call WebAppInternals.setBundledJsCssUrlRewriteHook which takes a function that lets you rewrite the JS url. Essentially it’s a more configurable WebAppInternals.setBundledJsCssPrefix. You could presumably take the url that gets passed into that function and then persist it somewhere you could then access it from.
Indeed I wonder where MongoInternals and WebAppInternals are documented…
@ffxsam I’d be extra careful with setting the js name myself because you will then need to make sure it changes (and rollbar notified of) across deployments so that it does not end up cached in your users’ browsers.
Perhaps another even more one-heck-of-a-hacky, but a write-once-and-forget way would be to create a server side route (/app.js) which parses your site’s own root url and extracts the actual js name, requests that and then streams it to rollbar.