@modern-js/main-doc 2.69.4 → 2.69.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/en/configure/app/tools/webpack-chain.mdx +4 -0
- package/docs/en/configure/app/tools/webpack.mdx +5 -1
- package/docs/en/guides/concept/builder.mdx +5 -5
- package/docs/en/guides/get-started/quick-start.mdx +9 -7
- package/docs/en/guides/get-started/tech-stack.mdx +4 -2
- package/docs/en/guides/topic-detail/module-federation/usage.mdx +1 -1
- package/docs/zh/configure/app/tools/webpack-chain.mdx +4 -0
- package/docs/zh/configure/app/tools/webpack.mdx +5 -1
- package/docs/zh/guides/concept/builder.mdx +4 -4
- package/docs/zh/guides/get-started/quick-start.mdx +1 -1
- package/docs/zh/guides/get-started/tech-stack.mdx +4 -2
- package/docs/zh/guides/topic-detail/module-federation/usage.mdx +1 -2
- package/package.json +2 -2
|
@@ -17,6 +17,10 @@ Compared with `tools.webpack`, **webpack-chain not only supports chained calls,
|
|
|
17
17
|
|
|
18
18
|
> `tools.webpackChain` is executed earlier than tools.webpack and thus will be overridden by changes in `tools.webpack`.
|
|
19
19
|
|
|
20
|
+
:::tip
|
|
21
|
+
Modern.js has deprecated support for webpack, which will be removed in the next major version. It is recommended to use Rspack as the bundler.
|
|
22
|
+
:::
|
|
23
|
+
|
|
20
24
|
### Utils
|
|
21
25
|
|
|
22
26
|
#### env
|
|
@@ -6,7 +6,7 @@ title: webpack
|
|
|
6
6
|
|
|
7
7
|
import { Badge } from '@theme';
|
|
8
8
|
|
|
9
|
-
<Badge type="danger"
|
|
9
|
+
<Badge type="danger">Webpack Only</Badge>
|
|
10
10
|
|
|
11
11
|
- **Type:** `Object | Function | undefined`
|
|
12
12
|
- **Default:** `undefined`
|
|
@@ -15,6 +15,10 @@ import { Badge } from '@theme';
|
|
|
15
15
|
|
|
16
16
|
> `tools.bundlerChain` is also used to modify the webpack configuration, and the function is more powerful. It is recommended to use `tools.bundlerChain` first.
|
|
17
17
|
|
|
18
|
+
:::tip
|
|
19
|
+
Modern.js has deprecated support for webpack, which will be removed in the next major version. It is recommended to use Rspack as the bundler.
|
|
20
|
+
:::
|
|
21
|
+
|
|
18
22
|
### Object Type
|
|
19
23
|
|
|
20
24
|
`tools.webpack` can be configured as an object to be deep merged with the built-in webpack configuration through [webpack-merge](https://github.com/survivejs/webpack-merge).
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
sidebar_position: 2
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
# Build
|
|
5
|
+
# Build Tool
|
|
6
6
|
|
|
7
|
-
Modern.js internally encapsulates [Rsbuild](https://rsbuild.rs/), and supports seamless switching between
|
|
7
|
+
Modern.js internally encapsulates [Rsbuild](https://rsbuild.rs/), and supports seamless switching between Rspack and webpack.
|
|
8
8
|
|
|
9
|
-
:::
|
|
10
|
-
|
|
9
|
+
:::tip
|
|
10
|
+
Modern.js has deprecated support for webpack, which will be removed in the next major version. It is recommended to use Rspack as the bundler.
|
|
11
11
|
:::
|
|
12
12
|
|
|
13
13
|
## Build Architecture
|
|
@@ -16,7 +16,7 @@ From the building perspective, Modern.js can be divided into three-layers, from
|
|
|
16
16
|
|
|
17
17
|
- Upper-level framework: Modern.js (open source) and EdenX (internal).
|
|
18
18
|
- Build tool: Rsbuild.
|
|
19
|
-
- Bundler:
|
|
19
|
+
- Bundler: Rspack and webpack.
|
|
20
20
|
|
|
21
21
|
<img
|
|
22
22
|
src="https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/build-layers-02193.png"
|
|
@@ -7,7 +7,7 @@ sidebar_position: 2
|
|
|
7
7
|
|
|
8
8
|
## Environment
|
|
9
9
|
|
|
10
|
-
import Prerequisites from
|
|
10
|
+
import Prerequisites from '@site-docs-en/components/prerequisites';
|
|
11
11
|
|
|
12
12
|
<Prerequisites />
|
|
13
13
|
|
|
@@ -30,13 +30,13 @@ npx @modern-js/create@latest myapp
|
|
|
30
30
|
|
|
31
31
|
## Initialize
|
|
32
32
|
|
|
33
|
-
import InitApp from
|
|
33
|
+
import InitApp from '@site-docs-en/components/init-app';
|
|
34
34
|
|
|
35
35
|
<InitApp />
|
|
36
36
|
|
|
37
37
|
## Development
|
|
38
38
|
|
|
39
|
-
import DebugApp from
|
|
39
|
+
import DebugApp from '@site-docs-en/components/debug-app';
|
|
40
40
|
|
|
41
41
|
<DebugApp />
|
|
42
42
|
|
|
@@ -56,9 +56,11 @@ export default defineConfig({
|
|
|
56
56
|
server: {
|
|
57
57
|
ssr: true,
|
|
58
58
|
},
|
|
59
|
-
plugins: [
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
plugins: [
|
|
60
|
+
appTools({
|
|
61
|
+
bundler: 'rspack',
|
|
62
|
+
}),
|
|
63
|
+
],
|
|
62
64
|
});
|
|
63
65
|
```
|
|
64
66
|
|
|
@@ -152,6 +154,6 @@ Open `http://localhost:8080/` in the browser, and the content should be consiste
|
|
|
152
154
|
|
|
153
155
|
## Deployment
|
|
154
156
|
|
|
155
|
-
import Deploy from
|
|
157
|
+
import Deploy from '@site-docs-en/components/deploy';
|
|
156
158
|
|
|
157
159
|
<Deploy />
|
|
@@ -38,9 +38,11 @@ We recommend using pnpm for faster installation speed.
|
|
|
38
38
|
|
|
39
39
|
## Bundler
|
|
40
40
|
|
|
41
|
-
Modern.js uses [
|
|
41
|
+
Modern.js uses [Rspack](https://rspack.rs/) or [webpack 5](https://webpack.js.org/) to bundle your web applications.
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
:::tip
|
|
44
|
+
Modern.js has deprecated support for webpack, which will be removed in the next major version. It is recommended to use Rspack as the bundler.
|
|
45
|
+
:::
|
|
44
46
|
|
|
45
47
|
## Transpiler
|
|
46
48
|
|
|
@@ -6,7 +6,7 @@ title: webpack
|
|
|
6
6
|
|
|
7
7
|
import { Badge } from '@theme';
|
|
8
8
|
|
|
9
|
-
<Badge type="danger"
|
|
9
|
+
<Badge type="danger">仅支持 Webpack</Badge>
|
|
10
10
|
|
|
11
11
|
- **类型:** `Object | Function | undefined`
|
|
12
12
|
- **默认值:** `undefined`
|
|
@@ -15,6 +15,10 @@ import { Badge } from '@theme';
|
|
|
15
15
|
|
|
16
16
|
> `tools.bundlerChain` 同样可以修改 webpack 配置,并且功能更加强大,建议优先使用 `tools.bundlerChain`。
|
|
17
17
|
|
|
18
|
+
:::tip
|
|
19
|
+
Modern.js 对于 webpack 的支持已经废弃,并将在下一个大版本中移除,推荐优先使用 Rspack 作为打包工具。
|
|
20
|
+
:::
|
|
21
|
+
|
|
18
22
|
### Object 类型
|
|
19
23
|
|
|
20
24
|
`tools.webpack` 可以配置为一个对象,这个对象将会和内置的 webpack 配置通过 [webpack-merge](https://github.com/survivejs/webpack-merge) 进行深层合并。
|
|
@@ -4,10 +4,10 @@ sidebar_position: 2
|
|
|
4
4
|
|
|
5
5
|
# 构建工具
|
|
6
6
|
|
|
7
|
-
Modern.js 构建是基于 [Rsbuild](https://rsbuild.rs/) 实现的,并支持在
|
|
7
|
+
Modern.js 构建是基于 [Rsbuild](https://rsbuild.rs/) 实现的,并支持在 Rspack 和 webpack 两种打包工具间无缝切换。
|
|
8
8
|
|
|
9
|
-
:::tip
|
|
10
|
-
|
|
9
|
+
:::tip
|
|
10
|
+
Modern.js 对于 webpack 的支持已经废弃,并将在下一个大版本中移除,推荐优先使用 Rspack 作为打包工具。
|
|
11
11
|
:::
|
|
12
12
|
|
|
13
13
|
## 构建架构
|
|
@@ -16,7 +16,7 @@ Rsbuild 是基于 Rspack 的构建工具,是一个增强版的 Rspack CLI,
|
|
|
16
16
|
|
|
17
17
|
- 研发框架:Modern.js(开源)和 EdenX(内部)。
|
|
18
18
|
- 构建工具:Rsbuild。
|
|
19
|
-
- 打包工具:
|
|
19
|
+
- 打包工具:Rspack 和 webpack。
|
|
20
20
|
|
|
21
21
|
<img
|
|
22
22
|
src="https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/build-layers-02193.png"
|
|
@@ -38,9 +38,11 @@ Modern.js 可以与社区中任意的包管理器搭配使用,比如 [npm](htt
|
|
|
38
38
|
|
|
39
39
|
## 打包工具
|
|
40
40
|
|
|
41
|
-
Modern.js 使用 [
|
|
41
|
+
Modern.js 使用 [Rspack](https://rspack.rs/) 或 [webpack 5](https://webpack.js.org/) 来打包你的 Web 应用。
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
:::tip
|
|
44
|
+
Modern.js 对于 webpack 的支持已经废弃,并将在下一个大版本中移除,推荐优先使用 Rspack 作为打包工具。
|
|
45
|
+
:::
|
|
44
46
|
|
|
45
47
|
## 转译工具
|
|
46
48
|
|
|
@@ -31,7 +31,6 @@ export default defineConfig({
|
|
|
31
31
|
moduleFederationPlugin(),
|
|
32
32
|
],
|
|
33
33
|
});
|
|
34
|
-
|
|
35
34
|
```
|
|
36
35
|
|
|
37
36
|
## 生产者导出模块
|
|
@@ -205,7 +204,7 @@ export default defineConfig({
|
|
|
205
204
|
},
|
|
206
205
|
plugins: [
|
|
207
206
|
appTools({
|
|
208
|
-
bundler: 'rspack',
|
|
207
|
+
bundler: 'rspack',
|
|
209
208
|
}),
|
|
210
209
|
moduleFederationPlugin(),
|
|
211
210
|
],
|
package/package.json
CHANGED
|
@@ -15,14 +15,14 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "2.69.
|
|
18
|
+
"version": "2.69.6",
|
|
19
19
|
"publishConfig": {
|
|
20
20
|
"registry": "https://registry.npmjs.org/",
|
|
21
21
|
"access": "public"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"mermaid": "^11.4.1",
|
|
25
|
-
"@modern-js/sandpack-react": "2.69.
|
|
25
|
+
"@modern-js/sandpack-react": "2.69.6"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@rsbuild/plugin-sass": "1.4.0",
|