The the M2 docs had a discussion of how to set up an app to run on Cloudfront:
To get Meteor to use the CDN for your Javascript and CSS bundles, call
WebAppInternals.setBundledJsCssPrefix("http://mycdn.com")
on the server. This will also take care of relative image URLs inside your CSS files. If you need to use a dynamic prefix, you can return the prefix from a function passed toWebAppInternals.setBundledJsCssUrlRewriteHook()
I haven’t yet found documention for this, or for the related WebAppInternals.setBundledJsCssUrlRewriteHook() function, in the M3 docs, other than a reference here that it is now an async function.
For example, is this code correct in M3?
if (Meteor.isProduction) {
await WebAppInternals.setBundledJsCssUrlRewriteHook(
url => `https://d2kwqyvya3b342.cloudfront.net${url}&_g_app_v_=${process.env.GALAXY_APP_VERSION_ID}`
);
}