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

使用 SWC 插件 #10

Open
SyMind opened this issue Sep 26, 2022 · 2 comments
Open

使用 SWC 插件 #10

SyMind opened this issue Sep 26, 2022 · 2 comments

Comments

@SyMind
Copy link
Member

SyMind commented Sep 26, 2022

目前项目通过 babel 插件在 Next.js 编译时适配 Taro 代码,导致 Next.js 在编译时无法使用 SWC 来提升编译速度。现在 SWC 已经支持插件,可以将这些 babel 插件转为 SWC 插件,让 Next.js 能够使用 SWC 来加速编译。

SWC 文档:https://swc.rs/docs/plugin/ecmascript/getting-started
Next.js 文档:https://nextjs.org/docs/advanced-features/compiler#swc-plugins-experimental

@SyMind
Copy link
Member Author

SyMind commented Sep 28, 2022

@swc/plugin-transform-imports 可以代替 taro-import-plugin

@SyMind
Copy link
Member Author

SyMind commented Sep 28, 2022

参照 next_ssg 编写 taro-ssg-plugin。

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

1 participant