-
Notifications
You must be signed in to change notification settings - Fork 80
Description
Please provide your feature request
I was excited to see Cloudwatch RUM get support for unminification with source maps: #231 However, looking at the user guide for the feature, I realized that it would be challenging to set up for my application, which has no existing notion of a release_id.
For context, I'm using Next.js, which follows the popular convention across many JavaScript frameworks of:
- Using hashes to generate a unique name for each
.jschunk (based on its contents), and - Emitting
.jsand.js.mapfiles as siblings (if enabled).
I upload all of those assets to S3, so that e.g. a request for /_next/static/chunks/f8ca1dff67f056a5.js would go to /.next/static/chunks/f8ca1dff67f056a5.js in my bucket, and its corresponding source map would be located at /.next/static/chunks/f8ca1dff67f056a5.js.map in my bucket.
What would really be convenient would be to have a way to tell RUM how to perform that mapping from .js filename to .js.map filename. I'd suggest configuration parameters along the lines of routePrefix and bucketPrefix: In my case, I'd specify routePrefix: "/_next/static/chunks" and bucketPrefix: "/.next/static/chunks". Then RUM could look up the source map for any requested .js file by subtracting the routePrefix, adding the bucketPrefix, and changing the file extension from .js to .js.map.