Skip to content

Commit 1af2c8a

Browse files
authored
feat: add zephyr to docs (#4046)
1 parent 639a83b commit 1af2c8a

File tree

7 files changed

+100
-2
lines changed

7 files changed

+100
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</a>
1717
</p>
1818

19-
You can consider the module federation capabilities provided by this repository as "module federation 2.0". "Module Federation 2.0" differs from the "Module Federation" built into Webpack 5 by offering not only the core features of module export, loading, and dependency sharing but also additional dynamic type hinting, a "Manifest", a "Federation Runtime", and a "Runtime Plugin System". These features make "Module Federation" more suitable for use as a micro-frontend architecture in large-scale web applications.
19+
You can consider the module federation capabilities provided by this repository as "module federation 2.0". "Module Federation 2.0" differs from the "Module Federation" built into webpack 5 by offering not only the core features of module export, loading, and dependency sharing but also additional dynamic type hinting, a "Manifest", a "Federation Runtime", and a "Runtime Plugin System". These features make "Module Federation" more suitable for use as a micro-frontend architecture in large-scale web applications.
2020

2121
## 💡 What is Module Federation?
2222

@@ -48,7 +48,7 @@ Come and chat with us on [Discussions](https://github.com/module-federation/univ
4848
4949
Please read the [Contributing Guide](https://github.com/module-federation/core/blob/main/CONTRIBUTING.md).
5050

51-
![Alt](https://repobeats.axiom.co/api/embed/856dc1d4a6965d225232b1bd2da5d54549dc169e.svg "Repobeats analytics image")
51+
![Alt](https://repobeats.axiom.co/api/embed/856dc1d4a6965d225232b1bd2da5d54549dc169e.svg 'Repobeats analytics image')
5252

5353
## 🙌 Code of Conduct
5454

apps/website-new/docs/en/guide/_meta.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
"name": "framework",
1515
"label": "Frameworks"
1616
},
17+
{
18+
"type": "dir",
19+
"name": "deployment",
20+
"label": "Deployment"
21+
},
1722
{
1823
"type": "dir",
1924
"name": "debug",
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[
2+
"zephyr"
3+
]
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Deploy with Zephyr Cloud
2+
3+
[Zephyr Cloud](https://zephyr-cloud.io) is a zero-config deployment platform that integrates directly into your build process and provides global edge distribution for Module Federation applications.
4+
5+
#### How to deploy
6+
7+
1. Install the Zephyr plugin for your bundler (supports Webpack, Rspack, Vite, etc...):
8+
9+
import InstallKit from '@components/common/install-kit';
10+
11+
<InstallKit
12+
pkgName="zephyr-webpack-plugin"
13+
/>
14+
15+
2. Add the plugin to your webpack configuration:
16+
17+
```javascript title='webpack.config.js'
18+
import { withZephyr } from 'zephyr-webpack-plugin';
19+
const {
20+
ModuleFederationPlugin,
21+
} = require('@module-federation/enhanced/webpack');
22+
const mfConfig = require('./module-federation.config');
23+
24+
module.exports = withZephyr()({
25+
devServer: {
26+
port: 2000,
27+
},
28+
output: {
29+
publicPath: 'http://localhost:2000/',
30+
},
31+
plugins: [new ModuleFederationPlugin(mfConfig)],
32+
});
33+
```
34+
35+
3. Build your project as usual:
36+
37+
```bash
38+
npm run build
39+
```
40+
41+
During the build process, your Module Federation application will be automatically deployed to Zephyr's global edge network and you'll receive a deployment URL. Zephyr Cloud handles asset optimization, dependency resolution, and provides automatic rollback capabilities for your micro-frontend applications.

apps/website-new/docs/zh/guide/_meta.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
"name": "framework",
1515
"label": "框架"
1616
},
17+
{
18+
"type": "dir",
19+
"name": "deployment",
20+
"label": "部署"
21+
},
1722
{
1823
"type":"dir",
1924
"name":"debug",
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[
2+
"zephyr"
3+
]
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# 使用 Zephyr Cloud 部署
2+
3+
[Zephyr Cloud](https://zephyr-cloud.io) 是一个零配置部署平台,直接集成到您的构建流程中,为模块联邦应用程序提供全球边缘分发。
4+
5+
#### 如何部署
6+
7+
1. 为您的打包工具安装 Zephyr 插件(支持 Webpack、Rspack、Vite 等):
8+
9+
import InstallKit from '@components/common/install-kit';
10+
11+
<InstallKit
12+
pkgName="zephyr-webpack-plugin"
13+
/>
14+
15+
2. 将插件添加到您的 webpack 配置中:
16+
17+
```javascript title='webpack.config.js'
18+
import { withZephyr } from 'zephyr-webpack-plugin';
19+
const {
20+
ModuleFederationPlugin,
21+
} = require('@module-federation/enhanced/webpack');
22+
const mfConfig = require('./module-federation.config');
23+
24+
module.exports = withZephyr()({
25+
devServer: {
26+
port: 2000,
27+
},
28+
output: {
29+
publicPath: 'http://localhost:2000/',
30+
},
31+
plugins: [new ModuleFederationPlugin(mfConfig)],
32+
});
33+
```
34+
35+
3. 像往常一样构建您的项目:
36+
37+
```bash
38+
npm run build
39+
```
40+
41+
在构建过程中,您的模块联邦应用程序将自动部署到 Zephyr 的全球边缘网络,您将收到一个部署 URL。Zephyr Cloud 处理资源优化、依赖解析,并为您的微前端应用程序提供自动回滚功能。

0 commit comments

Comments
 (0)