如何削减纯前端版本包依赖?
#1638
Replies: 2 comments
-
初步成果:#1953. |
Beta Was this translation helpful? Give feedback.
0 replies
-
通过支持 Dynamic import 语法,对懒加载内容进行分包 #1996. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
现状
目前基于 OpenSumi 的纯前端页面都普遍存在一个问题,即包大小较大,一定程度上影响了纯前端 IDE 能力在一些系统及页面上面去承载内容及功能。
当前数据,以
ide-startup-lite
的依赖结构为例:打包后非压缩态的依赖大小约为 13.3 MB,GZip 1.61 MB,有着比较大的包大小。
当前的部分优化策略有:
node_modules
中维护打包;opened-editor
等一些可行的方法
1. 通过提供部分非必要模块的 Mock 包
如
@opensumi/ide-debug
中,目前大部分逻辑是没有用到的,但也占了较大比重通过提供该 Lite 版本入口来提供基础的 API 实现,削减相关依赖
相似的模块还有:
这里的 OpenedEditor 模块本身就是可插拔模块(插件进程不依赖),故也可以直接不引入

2. 根据语言类型仅允许需要的语言文件
是否还有其他优化策略,欢迎补充
Beta Was this translation helpful? Give feedback.
All reactions