-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
feat: support use swc with mfsu #10198
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
Codecov ReportBase: 29.56% // Head: 29.55% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #10198 +/- ##
==========================================
- Coverage 29.56% 29.55% -0.01%
==========================================
Files 433 433
Lines 12483 12521 +38
Branches 3006 3022 +16
==========================================
+ Hits 3690 3701 +11
- Misses 8217 8243 +26
- Partials 576 577 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
我之前也通过 改 transpiler 的方式做过 benchmark ,性能提升没有用现在的 esbuild 直接构建方案的明显(我猜 主要还是 webpack 单个文件 load 拖慢了整体的速度) |
👍🏻👍🏻 |
umi3可以支持么? |
还是 推荐升级到 Umi 4 吧 |
这个 PR 做了几件事
swc 可以与 mfsu 一起使用了:跳过 swc 对 MFSU 使用了 top level await 的 virtual entry 文件处理,因为 swc 不支持 top level await ,在开发时跳过他们没有影响,浏览器是支持的。
使用 rust 插件解 swc 不可用的问题:因为 swc 不再维护 js 插件(目前
1.3.x
的 swc 与 umijs 也是无法一起使用的,js 插件无效),所以解法是使用 rust 写的 auto css modules 插件代替,插件已经移动到了 umijs 组织下( https://github.com/umijs/swc-plugin-auto-css-modules ),考虑到体积,swc 的依赖安装都是按需的。升级 swc 版本,因为插件需要 1.3.x 新的 swc 版本。
支持用户配置 swc 和 esbuild 转译器选项:考虑到 swc 已有众多生态插件,如支持 css in js ,所以需要配置的入口。