@modern-js/main-doc 0.0.0-next-1687238377232 → 0.0.0-next-1687258834440

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 CHANGED
@@ -1,10 +1,10 @@
1
1
  # @modern-js/main-doc
2
2
 
3
- ## 0.0.0-next-1687238377232
3
+ ## 0.0.0-next-1687258834440
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - @modern-js/builder-doc@0.0.0-next-1687238377232
7
+ - @modern-js/builder-doc@0.0.0-next-1687258834440
8
8
 
9
9
  ## 2.23.1
10
10
 
@@ -0,0 +1,28 @@
1
+ ---
2
+ sidebar_label: mainEntryName
3
+ ---
4
+
5
+ # source.mainEntryName
6
+
7
+ - **Type:** `string`
8
+ - **Default value:** `main`
9
+
10
+ This option is used to configure the main entry name of Modern.js.
11
+
12
+ By default, the default main entry name of Modern.js is `main`. When using a single entry or the entry name is the same as the `name` field in `package.json`, the corresponding entry will be used as the main entry. This configuration can be used to modify the name of the main entry.
13
+
14
+ For example, change the main entry name to index:
15
+
16
+ ```ts title="modern.config.ts"
17
+ export default defineConfig({
18
+ source: {
19
+ mainEntryName: 'index',
20
+ },
21
+ });
22
+ ```
23
+
24
+ After building, the corresponding HTML output path will be changed to `dist/html/index/index.html`.
25
+
26
+ :::info
27
+ When the main entry name is modified, other `**ByEntries` configurations also need to be adjusted to use the modified entry name.
28
+ :::
@@ -0,0 +1,28 @@
1
+ ---
2
+ sidebar_label: mainEntryName
3
+ ---
4
+
5
+ # source.mainEntryName
6
+
7
+ - **类型:** `string`
8
+ - **默认值:** `main`
9
+
10
+ 该选项用于配置 Modern.js 的主入口名称。
11
+
12
+ 默认情况下,Modern.js 的默认主入口名称为 `main`,当使用单入口或者入口名称和 `package.json` 中 name 字段一致时,会将对应入口作为主入口,通过该配置可以修改主入口的名称。
13
+
14
+ 比如将主入口名称改为 index:
15
+
16
+ ```ts title="modern.config.ts"
17
+ export default defineConfig({
18
+ source: {
19
+ mainEntryName: 'index',
20
+ },
21
+ });
22
+ ```
23
+
24
+ 构建之后,对应 html 产物路径将会变为 `dist/html/index/index.html`。
25
+
26
+ :::info
27
+ 当修改主入口名称后,其他 `**ByEntries` 的配置也需要对应调整使用修改后的入口名称。
28
+ :::
@@ -171,7 +171,7 @@ export default () => {
171
171
 
172
172
  ### 动态可选路由
173
173
 
174
- 通过 `[$]` 命名的文件目录,生成的路由会作为动态路由。例如以下文件目录:
174
+ 通过 `[$]` 命名的文件目录,生成的路由会作为动态可选路由。例如以下文件目录:
175
175
 
176
176
  ```bash
177
177
  └── routes
package/package.json CHANGED
@@ -15,14 +15,14 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "0.0.0-next-1687238377232",
18
+ "version": "0.0.0-next-1687258834440",
19
19
  "publishConfig": {
20
20
  "registry": "https://registry.npmjs.org/",
21
21
  "access": "public",
22
22
  "provenance": true
23
23
  },
24
24
  "peerDependencies": {
25
- "@modern-js/builder-doc": "0.0.0-next-1687238377232"
25
+ "@modern-js/builder-doc": "0.0.0-next-1687258834440"
26
26
  },
27
27
  "devDependencies": {
28
28
  "classnames": "^2",
@@ -34,9 +34,9 @@
34
34
  "fs-extra": "^10",
35
35
  "@types/node": "^16",
36
36
  "@types/fs-extra": "^9",
37
- "@modern-js/builder-doc": "0.0.0-next-1687238377232",
38
- "@modern-js/doc-tools": "0.0.0-next-1687238377232",
39
- "@modern-js/doc-plugin-auto-sidebar": "0.0.0-next-1687238377232"
37
+ "@modern-js/builder-doc": "0.0.0-next-1687258834440",
38
+ "@modern-js/doc-plugin-auto-sidebar": "0.0.0-next-1687258834440",
39
+ "@modern-js/doc-tools": "0.0.0-next-1687258834440"
40
40
  },
41
41
  "scripts": {
42
42
  "dev": "modern dev",