umijs / umi

A framework in react community ✨
https://umijs.org
MIT License
15.32k stars 2.65k forks source link

umijs 怎么打包配置多个页面呢? #12402

Closed cangsnage closed 4 months ago

cangsnage commented 4 months ago

Background

umijs打包配置一个index.html和index2.html文件,我想问下这个应该用entry来配置入口文件么,因为我这边看文档并么有?

Proposal

我希望的打包后index.html打开的文件菜单是a菜单,index2.html菜单是b菜单 image image 显示不同菜单应该怎么做呢

Additional context

Add any other context or screenshots about the feature request here.

fz6m commented 4 months ago

通常情况下,umi 打包不了多个页面,因为 umi 是个 SPA 的框架,产物只有一个 index.html ,所有的请求都要 fallback 到这个 html 上,在 nginx 里的配置是 try_files ,所以就不需要多个 html 了。

按 SPA 的规范,访问路径上不应该有 html ,你可以根据路径判断初次要切换到的 tab 。