Is it possible to set crossorigin="anonymous"
for dynamically-fetched scripts?
#10020
Unanswered
keeganwatkins
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Given the following architecture:
https://a.com
https://b.com
...CORS behavior limits error-tracking unless
crossorigin="anonymous"
is set on the<script />
elements for the assets served fromhttps://b.com
(docs).Setting
crossorigin="anonymous"
on the entry scripts is easy as we're in control of the markup, but I'm wondering if it's possible to setcrossorigin="anonymous"
on the<script />
elements for dynamically-loaded chunks, e.g. anything that is behind a code-split point and loaded via dynamicimport( ... )
? I found this bit of relevant script-loading code, but it's not clear to me how we'd alter/extend it globally.As an example of what I'm hoping is possible, see the
output.crossOriginLoading
option in Webpack.Any help would be appreciated!
Beta Was this translation helpful? Give feedback.
All reactions