We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
某些场景,例如 app 本地h5包,会直接用file协议打开html入口。然后安卓低端机,目前测试结果是 android <=11,会因为跨域问题加载不出脚本,也不会被@vitejs/plugin-legacy 捕捉错误去加载 legacy脚本。建议是加上 type="module"导致的跨域判断[doge]
我自己fork下来,将__vite_is_modern_browser暂时写死为false, const detectModernBrowserCode = ${detectModernBrowserDetector}window.${detectModernBrowserVarName}=false;` 建议跟判断是否支持esm一样,判断跨域错误的场景才去加载 legacy 咯
const detectModernBrowserCode =
No response
The text was updated successfully, but these errors were encountered:
If you mean that you're trying to use plugin-legacy with the file protocol, there's a PR to support it: #2574, but it's quite outdated.
Sorry, something went wrong.
How to solve this problem in the end also bothers me.
Successfully merging a pull request may close this issue.
Description
某些场景,例如 app 本地h5包,会直接用file协议打开html入口。然后安卓低端机,目前测试结果是 android <=11,会因为跨域问题加载不出脚本,也不会被@vitejs/plugin-legacy 捕捉错误去加载 legacy脚本。建议是加上 type="module"导致的跨域判断[doge]
Suggested solution
我自己fork下来,将__vite_is_modern_browser暂时写死为false,
const detectModernBrowserCode =
${detectModernBrowserDetector}window.${detectModernBrowserVarName}=false;`建议跟判断是否支持esm一样,判断跨域错误的场景才去加载 legacy 咯
Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: