For production builds, this library loads an additional analytics script from /_vercel/insights/script.js on the current domain. For development builds, this library loads an analytics script from https://va.vercel-scripts.com/v1/script.debug.js.
|
export const DEV_SCRIPT_URL = |
|
'https://va.vercel-scripts.com/v1/script.debug.js'; |
|
export const PROD_SCRIPT_URL = '/_vercel/insights/script.js'; |
This has a few implications:
- The latter URL (on
va.vercel-scripts.com) needs to be added to the content security policy, but only applies in development mode
- The analytics script can be updated at any time without changes to the application
It would be nice if the scripts themselves could be bundled in the npm package, so that everything is upgraded reproducibly.