Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vite 打包出来的defineAsyncComponent异步加载文件不携带referrer #17692

Open
7 tasks done
sunjianxu opened this issue Jul 16, 2024 · 2 comments
Open
7 tasks done

Comments

@sunjianxu
Copy link

Describe the bug

在使用defineAsyncComponent异步加载文件js时,文件不携带referrer。
生成的代码:<link rel="modulepreload" as="script" crossorigin="" href="/static/js/0854.js">
link 的rel为modulepreload 时不携带referrer,导致防盗链时文件403.我需要怎么做才能携带上referrer?配置nginx方案暂不考虑。
期望:使用defineAsyncComponent异步加载文件js时能携带上referrer。

Reproduction

https://github.com/sunjianxu/vite-bug-report

Steps to reproduce

No response

System Info

system: window10 

vite:"^2.6.14"

浏览器:chrome

Used Package Manager

npm

Logs

No response

Validations

@bluwy
Copy link
Member

bluwy commented Jul 16, 2024

Maybe related #10773 (comment)

@sunjianxu
Copy link
Author

Maybe related #10773 (comment)

Thank you, but it's not very helpful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants