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]qiankun中import-html-entry对于dynamicImport资源的处理 #2835

Open
AkiSong opened this issue Dec 5, 2023 · 0 comments
Open

[Bug]qiankun中import-html-entry对于dynamicImport资源的处理 #2835

AkiSong opened this issue Dec 5, 2023 · 0 comments

Comments

@AkiSong
Copy link

AkiSong commented Dec 5, 2023

What happens?

看到一个相似的问题,但是没解决方案 #915

(公司规定代码不能暴露,我就贴个本地的服务模拟CDN)

开启了umi配置dynamicImport, 代码自动拆分为如下形式
image

配置publicPath为CDN地址,html script标签引入的资源可以正常加载, 加载路径为CDN地址
image

项目使用了token校验,访问服务器上资源需要在请求头加上token, 所以将静态资源上传到CDN访问规避token校验,子项目单独访问publicPath都正确
image

但是子项目在主项目内加载的时候,异步资源不使用子项目内配置的publicPath加载,使用了entry的地址
image

start里fetch方法只能重写html里script标签的请求
image
image
image

excludeAssetFilter方法返回true之后js加载就异常了,这个配置也不能开
image
image

看了编译后的代码后发现问题了
image
image

请问这个assetPublicPath能自定义么, 如不能,这种情况怎么处理

相关环境信息

  • qiankun 版本
  • umi 3.5.37
  • qiankun 2.10.12
  • import-html-entry 1.15.0
  • 浏览器版本
  • 操作系统
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