Is your proposal related to a problem?
I am using CRA for a website, which serve its script via CDN, by set PUBLIC_URL to CDN host , everthing works fine . But soon I realized its imposiible for sentry-like tools to get Error detail for the crossOrigin attribute is not 'annoymous' in script tag.
Describe the solution you'd like
Just like what we do with PUBLIC_URL , maybe it is convient to provide a ENV key like 'SCRIPT_ACCROSS_ORIGIN' ?
Or maybe more convinent is to detect whether the PUBLIC_URL is an absolute path , and if does ,automatically generate scipt tag with acrossorigin="annoymous" ?
Describe alternatives you've considered
I have to turn my project into a react-app-rewired or craco version to modify webpack config to achieve my goal;
Or write some ugly script to parse and modify my generated index.html after build;
1条答案
按热度按时间kcrjzv8t1#
有一个same issue,但很快就关闭了,没有解决方案。