You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{useRouteProps}from'umi';importyayJpgfrom'../assets/yay.jpg';exportdefaultfunctionHomePage(){constrouteProps=useRouteProps();return(<div><h2>Yay! Welcome to umi!</h2><p><imgsrc={yayJpg}width="388"/></p><p>
To get started, edit <code>pages/index.tsx</code> and save to reload.
</p></div>);}exportconstrouteProps={title: 'false',}
122.82 kB dist\umi.js
679 B dist\p__index.async.js
646 B dist\layouts__index.async.js
530 B dist\p__docs.async.js
100 B dist\layouts__index.chunk.css
Context
Umi Version: 4.4.4
Node Version: v14.18.0
Platform: windows
简单排查问题可能所在
打包生成的routeProps文件直接引入了源文件,如下
// @ts-nocheck// This file is generated by Umi automatically// DO NOT CHANGE IT MANUALLY!import{routePropsasrouteProps_1}from'D:/gitlab/my-app/src/pages/index.tsx';exportdefault{'index': routeProps_1,};
如果把页面内的routeProps代码直接挪过来,而不是引用的方式应该能解决
The text was updated successfully, but these errors were encountered:
What happens?
约定式路由,页面内使用了routeProps导致路由拆分chunk失效
Mini Showcase Repository(REQUIRED)
.umirc.ts
pages/index.tsx // 当前页面讲会被打包进umi.js,而不会有单独的chunk文件
bad case 仓库
How To Reproduce
将上述代码拉下来后直接打包就行
Expected behavior 1. 2.
打包后的文件有dist\p__index.async.js
122.82 kB dist\umi.js
679 B dist\p__index.async.js
646 B dist\layouts__index.async.js
530 B dist\p__docs.async.js
100 B dist\layouts__index.chunk.css
Context
简单排查问题可能所在
打包生成的routeProps文件直接引入了源文件,如下
如果把页面内的routeProps代码直接挪过来,而不是引用的方式应该能解决
The text was updated successfully, but these errors were encountered: