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] umi4升级启动项目超长 每次卡住Bundling... #12739

Open
Yokee-X opened this issue Oct 16, 2024 · 4 comments
Open

[Bug] umi4升级启动项目超长 每次卡住Bundling... #12739

Yokee-X opened this issue Oct 16, 2024 · 4 comments

Comments

@Yokee-X
Copy link

Yokee-X commented Oct 16, 2024

What happens?

max dev 每次启动都卡住在首屏,什么原因,哪怕第一次打包后,第二次启动也需要很久,每次启动都要十几分钟。看样子加载大量的js,每个js也不大,但加载特别久。

image

//config配置
export default defineConfig({
proxy: {
'/api': {
target: 'https://127.0.0.1:850',
changeOrigin: true,
pathRewrite: { '^/api': '' },
logLevel: 'debug',
secure: false
}
},
devtool: false,
// add for transfer to umi
legacy: {
nodeModulesTransform: false
},
request: {},
mock: false,
antd: {
configProvider: {}
},
dva: {},
model: {},
locale: {
default: 'zh-CN', // default zh-CN
antd: true,
baseNavigator: false // default true, when it is true, will use navigator.language overwrite default
},
// dynamicImport: {
// loading: '@/components/PageLoading/index'
// },
define: {
APP_TYPE: process.env.APP_TYPE || '',
APP_METADATA
},
mfsu: false,
// chainWebpack: webpackplugin,
targets: { ie: 11 },
fastRefresh: true,
// 路由配置
routes: pageRoutes,
history: { type: 'browser' },
hash: true,
base: APP_METADATA.baseUrl,
publicPath: APP_METADATA.baseUrl,
title: false,
ignoreMomentLocale: false,
lessLoader: {
javascriptEnabled: true,
globalVars: {
theme: 'true;@import "~antd/lib/style/themes/variable.less"'
}
},
reactRouter5Compat: {},
});

Context

  • @umijs/max:^4.0.0
  • Node Version:v16.20.2
  • react:^18.2.0
@Yokee-X
Copy link
Author

Yokee-X commented Oct 16, 2024

1729048677017
构建了20分钟。。。有个threejs也不至于这么久吧,umi3都没有要这么久时间

@stormslowly
Copy link
Member

升级下 node 试试看

@Yokee-X
Copy link
Author

Yokee-X commented Oct 16, 2024

最小复现仓库
https://github.com/Yokee-X/update_umi4_demo
删了很多页面还是需要将近400s
电脑i5-10400 + 24G

@Yokee-X
Copy link
Author

Yokee-X commented Oct 16, 2024

升级下 node 试试看

升级到18还是慢

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

2 participants