Skip to content

perf: enable Docusaurus Faster (Rspack + SWC + Lightning CSS + SSG )#106

Open
xingwangzhe wants to merge 2 commits into
IppClub:mainfrom
xingwangzhe:fast-build-docs
Open

perf: enable Docusaurus Faster (Rspack + SWC + Lightning CSS + SSG )#106
xingwangzhe wants to merge 2 commits into
IppClub:mainfrom
xingwangzhe:fast-build-docs

Conversation

@xingwangzhe

Copy link
Copy Markdown
Contributor

提高文档构建速度

  • 添加 @docusaurus/faster 依赖,使用基于 Rust 的 Rspack 打包器
  • 启用 swcJsLoader(SWC JavaScript 加载器)、swcJsMinimizer(SWC JavaScript 压缩器)、lightningCssMinimizer(Lightning CSS 压缩器)
  • 启用 rspackBundler(Rspack 替代 Webpack)
  • 启用 mdxCrossCompilerCache(MDX 跨编译器缓存,同时为两种环境只编译一次 MDX)
  • 启用 ssgWorkerThreads(静态站点生成工作线程,多核页面渲染)
  • 跳过 swcHtmlMinimizer(SWC HTML 压缩器),因为内容中存在自闭合标签警告

本地构建

image

机器

截图 2026-06-04 20-24-51

本地构建时间 1min左右,极大加快构建速度

Copilot AI review requested due to automatic review settings June 5, 2026 08:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Enables Docusaurus “Faster” build pipeline settings for the Docs site to improve build performance and modernize the toolchain configuration.

Changes:

  • Add @docusaurus/faster to Docs devDependencies.
  • Configure future.v4 and future.faster options in docusaurus.config.js.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
Docs/package.json Adds the @docusaurus/faster dev dependency needed for the new build pipeline.
Docs/docusaurus.config.js Enables Docusaurus Faster options (Rspack/SWC/Lightning CSS/SSG threads) under future.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Docs/docusaurus.config.js
Comment thread Docs/docusaurus.config.js
…reads)

- Add @docusaurus/faster dependency for Rust-based Rspack bundler
- Enable swcJsLoader, swcJsMinimizer, lightningCssMinimizer
- Enable rspackBundler (Rspack replaces Webpack)
- Enable mdxCrossCompilerCache (compile MDX once for both envs)
- Enable ssgWorkerThreads (multi-core page rendering)
- Skip swcHtmlMinimizer due to self-closing tag warnings in content

Signed-off-by: 王兴家 <xingwangzhe@outlook.com>
Signed-off-by: 王兴家 <xingwangzhe@outlook.com>
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

Successfully merging this pull request may close these issues.

2 participants