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

🐛 [BUG]通过npm run build生成的index.html入口文件中,使用了绝对地址. #11211

Open
windqyoung opened this issue Apr 15, 2024 · 0 comments

Comments

@windqyoung
Copy link

🐛 bug 描述

在文件config/config.tx中设置 publicPath: process.env.NODE_ENV === 'production' ? './' : '/',
执行 npm run build 后, index.html文件中, 有一行代码是 <script async src="/scripts/loading.js"></script> , 在非根目录部署的情况下, 无法加载这个文件

📷 复现步骤 | Recurrence steps

同bug描述, 直接build就是结果.

🏞 期望结果 | Expected results

index.html中应该是 <script async src="./scripts/loading.js"></script>

💻 复现代码 | Recurrence code

© 版本信息

  • Ant Design Pro 版本: [e.g. 4.0.0]
  • umi 版本
  • 浏览器环境
  • 开发环境 [e.g. mac OS]

🚑 其他信息

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

No branches or pull requests

1 participant