@modern-js/main-doc 0.0.0-next-1685418932858 → 0.0.0-next-1685455730674
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/CHANGELOG.md +9 -4
- package/docs/en/apis/app/commands.mdx +5 -5
- package/docs/en/apis/app/runtime/web-server/hook.mdx +2 -2
- package/docs/en/apis/app/runtime/web-server/middleware.mdx +2 -2
- package/docs/en/components/init-app.mdx +3 -3
- package/docs/en/components/init-rspack-app.mdx +4 -4
- package/docs/en/components/ua-polyfill.mdx +2 -2
- package/docs/en/configure/app/tools/swc.mdx +2 -2
- package/docs/en/guides/advanced-features/rspack-start.mdx +2 -2
- package/docs/en/guides/advanced-features/ssg.mdx +2 -2
- package/docs/en/guides/advanced-features/testing.mdx +2 -2
- package/docs/en/guides/advanced-features/web-server.mdx +2 -2
- package/docs/en/guides/basic-features/css.mdx +2 -2
- package/docs/en/guides/concept/entries.mdx +3 -3
- package/docs/en/guides/topic-detail/generator/codesmith/develop.mdx +3 -3
- package/docs/en/guides/topic-detail/generator/plugin/develop.mdx +13 -13
- package/docs/en/guides/topic-detail/micro-frontend/c02-development.mdx +8 -8
- package/docs/en/tutorials/first-app/c03-css.mdx +2 -2
- package/docs/en/tutorials/first-app/c08-entries.mdx +3 -3
- package/docs/zh/apis/app/commands.mdx +3 -3
- package/docs/zh/components/ua-polyfill.mdx +1 -1
- package/docs/zh/configure/app/tools/swc.mdx +2 -2
- package/docs/zh/guides/advanced-features/rspack-start.mdx +2 -2
- package/docs/zh/guides/advanced-features/ssg.mdx +1 -1
- package/docs/zh/guides/advanced-features/testing.mdx +2 -2
- package/docs/zh/guides/advanced-features/web-server.mdx +1 -1
- package/docs/zh/guides/basic-features/css.mdx +1 -1
- package/docs/zh/guides/concept/entries.mdx +3 -3
- package/docs/zh/guides/topic-detail/generator/plugin/develop.mdx +14 -14
- package/docs/zh/guides/topic-detail/micro-frontend/c02-development.mdx +4 -4
- package/docs/zh/guides/topic-detail/model/test-model.mdx +1 -1
- package/docs/zh/tutorials/first-app/c03-css.mdx +1 -1
- package/docs/zh/tutorials/first-app/c08-entries.mdx +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
# @modern-js/main-doc
|
|
2
2
|
|
|
3
|
-
## 0.0.0-next-
|
|
3
|
+
## 0.0.0-next-1685455730674
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
7
|
+
- 7d1b96e5a: feat(changeset): optimize release note display
|
|
8
8
|
|
|
9
9
|
feat(changeset): 优化生成 Release Note 文案
|
|
10
10
|
|
|
11
11
|
### Patch Changes
|
|
12
12
|
|
|
13
|
-
-
|
|
14
|
-
|
|
13
|
+
- 3c3d1e268: docs: update project creation and new command text.
|
|
14
|
+
|
|
15
|
+
docs: 更新生成器创建项目和 new 命令文案。
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [850cde667]
|
|
18
|
+
- Updated dependencies [e7a5f9443]
|
|
19
|
+
- @modern-js/builder-doc@0.0.0-next-1685455730674
|
|
15
20
|
|
|
16
21
|
## 2.21.1
|
|
17
22
|
|
|
@@ -125,9 +125,9 @@ In the project, execute the `new` command to add entries as follows:
|
|
|
125
125
|
|
|
126
126
|
```bash
|
|
127
127
|
$ npx modern new
|
|
128
|
-
?
|
|
129
|
-
?
|
|
130
|
-
?
|
|
128
|
+
? Please select the operation you want: Create Element
|
|
129
|
+
? Please select the type of element to create: New "entry"
|
|
130
|
+
? Please fill in the entry name: entry
|
|
131
131
|
```
|
|
132
132
|
|
|
133
133
|
### Enable Features
|
|
@@ -136,8 +136,8 @@ In the project, execute the `new` command to enable features as follows:
|
|
|
136
136
|
|
|
137
137
|
```bash
|
|
138
138
|
$ npx modern new
|
|
139
|
-
?
|
|
140
|
-
?
|
|
139
|
+
? Please select the operation you want: Enable features
|
|
140
|
+
? Please select the feature name: (Use arrow keys)
|
|
141
141
|
❯ Enable Tailwind CSS
|
|
142
142
|
Enable BFF
|
|
143
143
|
Enable SSG
|
|
@@ -24,8 +24,8 @@ Before using this API, please execute `pnpm run new` to create a new "Custom Web
|
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
26
|
pnpm run new
|
|
27
|
-
?
|
|
28
|
-
? New "Custom Web Server" source code directory
|
|
27
|
+
? Please select the operation you want: Create Elements
|
|
28
|
+
? Please select the type of element to create: New "Custom Web Server" source code directory
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
:::
|
|
@@ -27,8 +27,8 @@ Before using this API, please execute `pnpm run new` to create a new "Custom Web
|
|
|
27
27
|
|
|
28
28
|
```bash
|
|
29
29
|
pnpm run new
|
|
30
|
-
?
|
|
31
|
-
? New "Custom Web Server" source code directory
|
|
30
|
+
? Please select the operation you want: Create Element
|
|
31
|
+
? Please select the type of element to create: New "Custom Web Server" source code directory
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
:::
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Modern.js generator will provide an interactive Q & A interface, initialization items according to the result, according to the default selection:
|
|
2
2
|
|
|
3
3
|
```bash
|
|
4
|
-
? Please select the
|
|
5
|
-
?
|
|
6
|
-
?
|
|
4
|
+
? Please select the type of project you want to create: Web App
|
|
5
|
+
? Please select the programming language: TS
|
|
6
|
+
? Please select the package manager: pnpm
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
After create the project, Modern.js automatically installs dependency and creates a git repository.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
```bash
|
|
2
2
|
$ npx @modern-js/create@latest myapp
|
|
3
|
-
? Please select the
|
|
4
|
-
?
|
|
5
|
-
?
|
|
6
|
-
?
|
|
3
|
+
? Please select the type of project you want to create: Web App
|
|
4
|
+
? Please select the programming language: TS
|
|
5
|
+
? Please select the package manager: pnpm
|
|
6
|
+
? Please select the bundler: Rspack
|
|
7
7
|
```
|
|
@@ -9,8 +9,8 @@ Modern.js also provides a runtime Polyfill solution based on browser [UA](https:
|
|
|
9
9
|
exec `pnpm run new` to enable this features:
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
?
|
|
13
|
-
?
|
|
12
|
+
? Please select the operation you want: Enable features
|
|
13
|
+
? Please select the feature name: Enable UA-based Polyfill Feature
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
After executing the command, register the Polyfill plugin in `modern.config.ts`:
|
|
@@ -22,8 +22,8 @@ When using Rspack as the bundler, SWC will be used for transpiling and compressi
|
|
|
22
22
|
First, you need to execute `pnpm run new` to enable the SWC compile:
|
|
23
23
|
|
|
24
24
|
```bash
|
|
25
|
-
?
|
|
26
|
-
?
|
|
25
|
+
? Please select the operation you want: Enable features
|
|
26
|
+
? Please select the feature name: Enable SWC Compile
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
After the installation, please register the SWC plugin in the `modern.config.ts` file, then the SWC compilation and compression will be enabled.
|
|
@@ -36,8 +36,8 @@ You can enable Rspack build by running `pnpm run new`:
|
|
|
36
36
|
|
|
37
37
|
```bash
|
|
38
38
|
$ pnpm run new
|
|
39
|
-
?
|
|
40
|
-
?
|
|
39
|
+
? Please select the operation you want: Enable features
|
|
40
|
+
? Please select the feature name: Enable Rspack Build
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
After executing the command, enable the Rspack build in `modern.config.ts`:
|
|
@@ -9,8 +9,8 @@ Static Site Generation is a solution for rendering complete static web pages at
|
|
|
9
9
|
First need to execute `pnpm run new` to enable the SSG features:
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
?
|
|
13
|
-
?
|
|
12
|
+
? Please select the operation you want: Enable features
|
|
13
|
+
? Please select the feature name: Enable SSG
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
After execute script, register SSG plugin in `modern.config.ts`:
|
|
@@ -9,8 +9,8 @@ Modern.js integrates the testing capabilities of [Jest](https://jestjs.io/) by d
|
|
|
9
9
|
First need to execute `pnpm run new` enable [unit test/integration test] features:
|
|
10
10
|
|
|
11
11
|
```
|
|
12
|
-
?
|
|
13
|
-
?
|
|
12
|
+
? Please select the operation you want: Enable features
|
|
13
|
+
? Please select the feature name: Enable Unit Test / Integration Test
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
After executing the above command, the `"test": "modern test"` command will be automatically generated in package.json.
|
|
@@ -27,8 +27,8 @@ Because the full web server cannot be controlled this way, and the extension log
|
|
|
27
27
|
You can execute the'pnpm run new 'command in the project root directory to enable the "Custom Web Serve" function:
|
|
28
28
|
|
|
29
29
|
```bash
|
|
30
|
-
?
|
|
31
|
-
? New "Custom Web Server" source code directory
|
|
30
|
+
? Please select the operation you want: Create Element
|
|
31
|
+
? Please select the type of element to create: New "Custom Web Server" source code directory
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
After executing the command, register the `@modern-js/plugin-server` plugin in `modern.config.ts`:
|
|
@@ -66,8 +66,8 @@ If you need to use other CSS-in-JS libraries such as [styled-jsx](https://www.np
|
|
|
66
66
|
Follow the steps below to make a selection:
|
|
67
67
|
|
|
68
68
|
```bash
|
|
69
|
-
?
|
|
70
|
-
?
|
|
69
|
+
? Please select the operation you want: Enable features
|
|
70
|
+
? Please select the feature name: Enable Tailwind CSS
|
|
71
71
|
```
|
|
72
72
|
|
|
73
73
|
Register the Tailwind plugin in `modern.config.ts`:
|
|
@@ -33,9 +33,9 @@ The project initialized by Modern.js is single-entry (SPA), and the project stru
|
|
|
33
33
|
Modern.js can easily switch from single entry to multiple entry. You can execute `pnpm run new` under the project to create entry through generator:
|
|
34
34
|
|
|
35
35
|
```bash
|
|
36
|
-
?
|
|
37
|
-
?
|
|
38
|
-
?
|
|
36
|
+
? Please select the operation you want: Create Element
|
|
37
|
+
? Please select the type of element to create: New "entry"
|
|
38
|
+
? Please fill in the entry name: new-entry
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
After execution, Modern.js will automatically generate a new entry directory, and you can see that the `src/` directory has the following structure:
|
|
@@ -12,9 +12,9 @@ Modern.js provides a microgenerator to create a microgenerator project, you can
|
|
|
12
12
|
$ mkdir <projectDir>
|
|
13
13
|
$ npx @modern-js/codesmith-cli @modern-js/generator-generator
|
|
14
14
|
|
|
15
|
-
?
|
|
16
|
-
?
|
|
17
|
-
?
|
|
15
|
+
? Please fill in the project name: <generatorName>
|
|
16
|
+
? Please select the package manager: pnpm
|
|
17
|
+
? Please select the programming language: TS
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
## Add template file
|
|
@@ -17,25 +17,25 @@ Different plugin types will ask different questions. You can choose the plugin t
|
|
|
17
17
|
### Extension type
|
|
18
18
|
|
|
19
19
|
```
|
|
20
|
-
? Please select the
|
|
21
|
-
? Please select the
|
|
22
|
-
?
|
|
23
|
-
?
|
|
24
|
-
?
|
|
25
|
-
?
|
|
26
|
-
?
|
|
20
|
+
? Please select the type of project you want to create: Npm Module
|
|
21
|
+
? Please select the project scenario: Generator Plugin
|
|
22
|
+
? Please fill in the package name of the generator plugin: plugin
|
|
23
|
+
? Please select the programming language: TS
|
|
24
|
+
? Please select the package manager: pnpm
|
|
25
|
+
? Please select the type of plugin: extend
|
|
26
|
+
? Please select the base type of the plugin: Web App
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
### Customized type
|
|
30
30
|
|
|
31
31
|
```
|
|
32
32
|
? Plugin Package Name: plugin
|
|
33
|
-
?
|
|
34
|
-
?
|
|
35
|
-
?
|
|
36
|
-
?
|
|
37
|
-
?
|
|
38
|
-
?
|
|
33
|
+
? Please select the programming language: TS
|
|
34
|
+
? Please select the package manager: pnpm
|
|
35
|
+
? Please fill in the plugin keyword: custom
|
|
36
|
+
? Please fill in the plugin keyword: mobile-app
|
|
37
|
+
? Please fill in the display name of the plugin: Mobile App
|
|
38
|
+
? Please select the base type of the plugin: Web App
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
After the execution of the create project command is completed, a project for developing the generator plugin will be generated accordingly, and the `meta` information will also be generated according to your selection in the `package.json`.
|
|
@@ -33,8 +33,8 @@ npx @modern-js/create@latest
|
|
|
33
33
|
After the project is created, we can enable the `micro frontend` through `pnpm run new`:
|
|
34
34
|
|
|
35
35
|
```bash
|
|
36
|
-
?
|
|
37
|
-
?
|
|
36
|
+
? Please select the operation you want: Enable features
|
|
37
|
+
? Please select the feature name: Enable Micro Front-end Feature
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
Next, let's register the micro frontend plugin and add the main micro frontend app and add the list of sub-apps:
|
|
@@ -115,8 +115,8 @@ npx @modern-js/create@latest
|
|
|
115
115
|
After the project is created, we can enable the `micro frontend` function through `pnpm run new`:
|
|
116
116
|
|
|
117
117
|
```bash
|
|
118
|
-
?
|
|
119
|
-
?
|
|
118
|
+
? Please select the operation you want: Enable features
|
|
119
|
+
? Please select the feature name: Enable Micro Front-end Feature
|
|
120
120
|
```
|
|
121
121
|
|
|
122
122
|
Next, let's register the micro frontend plugin and add the main micro frontend app and add the list of sub-apps:
|
|
@@ -143,8 +143,8 @@ npx @modern-js/create@latest
|
|
|
143
143
|
After create sub-app. We execute `pnpm run new` to enable the `micro frontend` function:
|
|
144
144
|
|
|
145
145
|
```bash
|
|
146
|
-
?
|
|
147
|
-
?
|
|
146
|
+
? Please select the operation you want: Enable features
|
|
147
|
+
? Please select the feature name: Enable Micro Front-end Feature
|
|
148
148
|
```
|
|
149
149
|
|
|
150
150
|
Next, let's register the micro frontend plugin and modify `modern.config.ts` to add the configuration of the micro frontend sub-app `deploy.microFrontend`:
|
|
@@ -192,8 +192,8 @@ npx @modern-js/create@latest
|
|
|
192
192
|
After create sub-app. We execute `pnpm run new` to enable the `micro frontend` function:
|
|
193
193
|
|
|
194
194
|
```bash
|
|
195
|
-
?
|
|
196
|
-
?
|
|
195
|
+
? Please select the operation you want: Enable features
|
|
196
|
+
? Please select the feature name: Enable Micro Front-end Feature
|
|
197
197
|
```
|
|
198
198
|
|
|
199
199
|
Next, let's register the micro frontend plugin and modify `modern.config.ts` to add the configuration of the micro frontend sub-app `deploy.microFrontend`:
|
|
@@ -114,8 +114,8 @@ Modern.js integrates the mainstream, light, general-purpose Utility Class librar
|
|
|
114
114
|
Execute `pnpm run new` and select the following to start Tailwind CSS:
|
|
115
115
|
|
|
116
116
|
```bash
|
|
117
|
-
?
|
|
118
|
-
?
|
|
117
|
+
? Please select the operation you want: Enable features
|
|
118
|
+
? Please select the feature name: Enable Tailwind CSS
|
|
119
119
|
```
|
|
120
120
|
|
|
121
121
|
Register the Tailwind plugin in `modern.config.ts`:
|
|
@@ -14,9 +14,9 @@ A complete project may require multiple entries, Modern.js supports the automati
|
|
|
14
14
|
We can also use it to create new project elements and execute `pnpm run new` in the project root directory:
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
|
-
?
|
|
18
|
-
?
|
|
19
|
-
?
|
|
17
|
+
? Please select the operation you want: Create Element
|
|
18
|
+
? Please select the type of element to create: New "entry"
|
|
19
|
+
? Please fill in the entry name: landing-page
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
When created, the project will look like this:
|
|
@@ -126,7 +126,7 @@ Options:
|
|
|
126
126
|
```bash
|
|
127
127
|
$ npx modern new
|
|
128
128
|
? 请选择你想要的操作 创建工程元素
|
|
129
|
-
?
|
|
129
|
+
? 请选择创建元素类型 新建「应用入口」
|
|
130
130
|
? 请填写入口名称 entry
|
|
131
131
|
```
|
|
132
132
|
|
|
@@ -137,8 +137,8 @@ $ npx modern new
|
|
|
137
137
|
```bash
|
|
138
138
|
$ npx modern new
|
|
139
139
|
? 请选择你想要的操作 启用可选功能
|
|
140
|
-
?
|
|
141
|
-
❯ 启用 Tailwind CSS 支持
|
|
140
|
+
? 请选择功能名称 (Use arrow keys)
|
|
141
|
+
❯ 启用 「Tailwind CSS」 支持
|
|
142
142
|
启用「BFF」功能
|
|
143
143
|
启用「微前端」模式
|
|
144
144
|
启用「单元测试 / 集成测试」功能
|
|
@@ -22,8 +22,8 @@ import SWC from '@modern-js/builder-doc/docs/zh/shared/swc.md';
|
|
|
22
22
|
首先,你需要执行 `pnpm run new` 启用 SWC 编译:
|
|
23
23
|
|
|
24
24
|
```bash
|
|
25
|
-
?
|
|
26
|
-
?
|
|
25
|
+
? 请选择你想要的操作 启用可选功能
|
|
26
|
+
? 请选择功能名称 启用「SWC 编译」
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
执行完成后,你只需在 `modern.config.ts` 文件中注册 SWC 插件,即可启用 SWC 编译和压缩能力。
|
|
@@ -37,8 +37,8 @@ import InitRspackApp from '@site-docs/components/init-rspack-app';
|
|
|
37
37
|
|
|
38
38
|
```bash
|
|
39
39
|
$ pnpm run new
|
|
40
|
-
?
|
|
41
|
-
?
|
|
40
|
+
? 请选择你想要的操作 启用可选功能
|
|
41
|
+
? 请选择功能名称 启用「Rspack 构建」
|
|
42
42
|
```
|
|
43
43
|
|
|
44
44
|
执行以上命令后,在 `modern.config.ts` 中添加 Rspack 相关配置即可:
|
|
@@ -9,8 +9,8 @@ Modern.js 默认集成了 [Jest](https://jestjs.io/) 的测试能力。
|
|
|
9
9
|
我们首先需要执行 `pnpm run new` 启用「单元测试 / 集成测试」功能:
|
|
10
10
|
|
|
11
11
|
```
|
|
12
|
-
?
|
|
13
|
-
?
|
|
12
|
+
? 请选择你想要的操作 启用可选功能
|
|
13
|
+
? 请选择功能名称 启用「单元测试 / 集成测试」功能
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
执行上述命令后,`package.json` 中将会自动生成 `"test": "modern test"` 命令。
|
|
@@ -33,9 +33,9 @@ Modern.js 初始化的项目是单入口的(SPA),项目结构如下:
|
|
|
33
33
|
在 Modern.js 项目中,你可以很方便的将单入口切换成多入口,直接在项目下执行 `pnpm run new`,通过生成器创建入口即可:
|
|
34
34
|
|
|
35
35
|
```bash
|
|
36
|
-
?
|
|
37
|
-
?
|
|
38
|
-
?
|
|
36
|
+
? 请选择你想要的操作 创建工程元素
|
|
37
|
+
? 请选择创建元素类型 新建「应用入口」
|
|
38
|
+
? 请填写入口名称 new-entry
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
执行后,Modern.js 会自动生成一个新的入口目录,此时可以看到 `src/` 目录变成如下结构:
|
|
@@ -17,13 +17,13 @@ npx @modern-js/create@latest plugin --plugin @modern-js/generator-plugin-plugin
|
|
|
17
17
|
### 扩展工程方案
|
|
18
18
|
|
|
19
19
|
```
|
|
20
|
-
?
|
|
21
|
-
?
|
|
22
|
-
?
|
|
23
|
-
?
|
|
24
|
-
?
|
|
25
|
-
?
|
|
26
|
-
?
|
|
20
|
+
? 请选择你想创建的工程类型 Npm 模块
|
|
21
|
+
? 请选择项目场景 生成器插件
|
|
22
|
+
? 请输入生成器插件插件包名 plugin
|
|
23
|
+
? 请选择开发语言 TS
|
|
24
|
+
? 请选择包管理工具 pnpm
|
|
25
|
+
? 请选择插件类型 扩展
|
|
26
|
+
? 请选择插件基础类型 应用
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
### 创建工程方案场景
|
|
@@ -31,13 +31,13 @@ npx @modern-js/create@latest plugin --plugin @modern-js/generator-plugin-plugin
|
|
|
31
31
|
```
|
|
32
32
|
? 请选择你想创建的工程类型:Npm 模块
|
|
33
33
|
? 请选择项目场景:生成器插件
|
|
34
|
-
?
|
|
35
|
-
?
|
|
36
|
-
?
|
|
37
|
-
?
|
|
38
|
-
?
|
|
39
|
-
?
|
|
40
|
-
?
|
|
34
|
+
? 请输入生成器插件插件包名 plugin
|
|
35
|
+
? 请选择开发语言 TS
|
|
36
|
+
? 请选择包管理工具 pnpm
|
|
37
|
+
? 请选择插件类型 自定义
|
|
38
|
+
? 请输入插件关键字 mobile-app
|
|
39
|
+
? 请输入插件展示名称 移动应用
|
|
40
|
+
? 请选择插件基础类型 应用
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
创建项目命令执行完成后,会对应的生成一个开发生成器插件的项目,`package.json` 中也会根据你的选择对应的生成 `meta` 信息。
|
|
@@ -35,7 +35,7 @@ import DefaultMWAGenerate from "@site-docs/components/default-mwa-generate";
|
|
|
35
35
|
|
|
36
36
|
```bash
|
|
37
37
|
? 请选择你想要的操作 启用可选功能
|
|
38
|
-
?
|
|
38
|
+
? 请选择功能名称 启用「微前端」模式
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
接下来,让我们注册微前端插件并添加开启微前端主应用,并增加子应用列表:
|
|
@@ -115,7 +115,7 @@ npx @modern-js/create@latest
|
|
|
115
115
|
|
|
116
116
|
```bash
|
|
117
117
|
? 请选择你想要的操作 启用可选功能
|
|
118
|
-
?
|
|
118
|
+
? 请选择功能名称 启用「微前端」模式
|
|
119
119
|
```
|
|
120
120
|
|
|
121
121
|
接下来,让我们注册微前端插件并添加开启微前端主应用,并增加子应用列表:
|
|
@@ -145,7 +145,7 @@ npx @modern-js/create@latest
|
|
|
145
145
|
|
|
146
146
|
```bash
|
|
147
147
|
? 请选择你想要的操作 启用可选功能
|
|
148
|
-
?
|
|
148
|
+
? 请选择功能名称 启用「微前端」模式
|
|
149
149
|
```
|
|
150
150
|
|
|
151
151
|
接下来,让我们注册微前端插件并修改 `modern.config.ts`,添加微前端子应用的配置 `deploy.microFrontend`:
|
|
@@ -197,7 +197,7 @@ npx @modern-js/create@latest
|
|
|
197
197
|
|
|
198
198
|
```bash
|
|
199
199
|
? 请选择你想要的操作 启用可选功能
|
|
200
|
-
?
|
|
200
|
+
? 请选择功能名称 启用「微前端」模式
|
|
201
201
|
```
|
|
202
202
|
|
|
203
203
|
接下来,让我们注册微前端插件并修改 `modern.config.ts`,添加微前端子应用的配置 `deploy.microFrontend`:
|
package/package.json
CHANGED
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "0.0.0-next-
|
|
18
|
+
"version": "0.0.0-next-1685455730674",
|
|
19
19
|
"publishConfig": {
|
|
20
20
|
"registry": "https://registry.npmjs.org/",
|
|
21
21
|
"access": "public"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"@modern-js/builder-doc": "0.0.0-next-
|
|
24
|
+
"@modern-js/builder-doc": "0.0.0-next-1685455730674"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"classnames": "^2",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"fs-extra": "^10",
|
|
34
34
|
"@types/node": "^16",
|
|
35
35
|
"@types/fs-extra": "^9",
|
|
36
|
-
"@modern-js/builder-doc": "0.0.0-next-
|
|
37
|
-
"@modern-js/doc-tools": "0.0.0-next-
|
|
38
|
-
"@modern-js/doc-plugin-auto-sidebar": "0.0.0-next-
|
|
36
|
+
"@modern-js/builder-doc": "0.0.0-next-1685455730674",
|
|
37
|
+
"@modern-js/doc-tools": "0.0.0-next-1685455730674",
|
|
38
|
+
"@modern-js/doc-plugin-auto-sidebar": "0.0.0-next-1685455730674"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
41
|
"dev": "modern dev",
|