nuxt/nuxt
Vedi su GitHubAllow setting crossOrigin="use-credentials" for static files served from another domain / CDN (buildAssetsDir/cdnUrl)
Open
Aperta il 21 nov 2024
good first issuenitro🍰 p2-nice-to-have
Descrizione
Describe the feature
Currently, there is no way to set different crossorigin value than "" (anonymous) for static files. This becomes a problem when JS static files are served from CDN and we need to pass cookies in order to work properly in certain conditions - for example when Cloudflare Under Attack Mode is being on.
As a workaround, we created Nitro plugin which uses render:html hook. In that hook we have to parse html head and manually replace crossOrigin value.
I believe there should be an option (nuxt.config?) alongside buildAssetsDir and cdnUrl that could faciliate implementation, especially in large-scale projects.
Additional information
- Would you be willing to help implement this feature?
- Could this feature be implemented as a module?
Final checks
- Read the contribution guide.
- Check existing discussions and issues.