-
Notifications
You must be signed in to change notification settings - Fork 97
perf: pre-bundle deps for bundler-vite #440
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/umijs/umi-next/BiiL83VBi6HqqsT7isDoL1DbhM1L |
@@ -0,0 +1,30 @@ | |||
import fs from 'fs'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -0,0 +1 @@ | |||
export * from '@umijs/bundler-utils/compiled/esbuild'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为啥会有 esbuild.d.ts 和 fs-extra.d.ts?这两个文件不像自动打出来的。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是 afterBundleDeps.ts
输出的,为了解类型 external 的问题,在 PR 描述里有做说明
Description
移除不需要的
rollup-plugin-polyfill
,且对 bundler-vite 的以下依赖做预打包:@types/rollup-plugin-visualizer
解决)效果:
未成功打包的依赖:
额外增加
bundler-vite/scripts/afterBundleDeps.ts
做后置任务:@umijs/bundler-utils
和@umijs/utils
中预打包产物的类型映射,解决 bundler-vite 预打包类型声明产物中 external 的包 import 不到的问题