@modern-js/module-tools-docs 2.0.1 → 2.0.2

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.
Files changed (192) hide show
  1. package/doc_build/html/main/index.html +16 -0
  2. package/doc_build/route.json +10 -0
  3. package/doc_build/static/css/main.css +3370 -0
  4. package/doc_build/static/css/main.css.map +1 -0
  5. package/doc_build/static/css/vendors-node_modules_pnpm_remix-run_router_1_2_0_node_modules_remix-run_router_dist_router_js-9d5e9c.css +85 -0
  6. package/doc_build/static/css/vendors-node_modules_pnpm_remix-run_router_1_2_0_node_modules_remix-run_router_dist_router_js-9d5e9c.css.map +1 -0
  7. package/doc_build/static/js/async/api_.js +56 -0
  8. package/doc_build/static/js/async/api_.js.map +1 -0
  9. package/doc_build/static/js/async/api_config_build-config.js +11309 -0
  10. package/doc_build/static/js/async/api_config_build-config.js.map +1 -0
  11. package/doc_build/static/js/async/api_config_build-preset.js +7849 -0
  12. package/doc_build/static/js/async/api_config_build-preset.js.map +1 -0
  13. package/doc_build/static/js/async/api_config_design-system.js +48708 -0
  14. package/doc_build/static/js/async/api_config_design-system.js.map +1 -0
  15. package/doc_build/static/js/async/api_config_plugins.js +1492 -0
  16. package/doc_build/static/js/async/api_config_plugins.js.map +1 -0
  17. package/doc_build/static/js/async/api_config_testing.js +2130 -0
  18. package/doc_build/static/js/async/api_config_testing.js.map +1 -0
  19. package/doc_build/static/js/async/api_plugin-api_plugin-hooks.js +14394 -0
  20. package/doc_build/static/js/async/api_plugin-api_plugin-hooks.js.map +1 -0
  21. package/doc_build/static/js/async/en_.js +85 -0
  22. package/doc_build/static/js/async/en_.js.map +1 -0
  23. package/doc_build/static/js/async/en_api_.js +55 -0
  24. package/doc_build/static/js/async/en_api_.js.map +1 -0
  25. package/doc_build/static/js/async/en_api_config_build-config.js +8363 -0
  26. package/doc_build/static/js/async/en_api_config_build-config.js.map +1 -0
  27. package/doc_build/static/js/async/en_api_config_build-preset.js +7845 -0
  28. package/doc_build/static/js/async/en_api_config_build-preset.js.map +1 -0
  29. package/doc_build/static/js/async/en_api_config_design-system.js +16345 -0
  30. package/doc_build/static/js/async/en_api_config_design-system.js.map +1 -0
  31. package/doc_build/static/js/async/en_api_config_plugins.js +1492 -0
  32. package/doc_build/static/js/async/en_api_config_plugins.js.map +1 -0
  33. package/doc_build/static/js/async/en_api_config_testing.js +2137 -0
  34. package/doc_build/static/js/async/en_api_config_testing.js.map +1 -0
  35. package/doc_build/static/js/async/en_api_plugin-api_plugin-hooks.js +14362 -0
  36. package/doc_build/static/js/async/en_api_plugin-api_plugin-hooks.js.map +1 -0
  37. package/doc_build/static/js/async/en_guide_advance_asset.js +3997 -0
  38. package/doc_build/static/js/async/en_guide_advance_asset.js.map +1 -0
  39. package/doc_build/static/js/async/en_guide_advance_build-umd.js +9861 -0
  40. package/doc_build/static/js/async/en_guide_advance_build-umd.js.map +1 -0
  41. package/doc_build/static/js/async/en_guide_advance_copy.js +6539 -0
  42. package/doc_build/static/js/async/en_guide_advance_copy.js.map +1 -0
  43. package/doc_build/static/js/async/en_guide_advance_external-dependency.js +3810 -0
  44. package/doc_build/static/js/async/en_guide_advance_external-dependency.js.map +1 -0
  45. package/doc_build/static/js/async/en_guide_advance_in-depth-about-build.js +5046 -0
  46. package/doc_build/static/js/async/en_guide_advance_in-depth-about-build.js.map +1 -0
  47. package/doc_build/static/js/async/en_guide_advance_in-depth-about-dev-command.js +150 -0
  48. package/doc_build/static/js/async/en_guide_advance_in-depth-about-dev-command.js.map +1 -0
  49. package/doc_build/static/js/async/en_guide_advance_theme-config.js +2484 -0
  50. package/doc_build/static/js/async/en_guide_advance_theme-config.js.map +1 -0
  51. package/doc_build/static/js/async/en_guide_basic_before-getting-started.js +3671 -0
  52. package/doc_build/static/js/async/en_guide_basic_before-getting-started.js.map +1 -0
  53. package/doc_build/static/js/async/en_guide_basic_command-preview.js +3961 -0
  54. package/doc_build/static/js/async/en_guide_basic_command-preview.js.map +1 -0
  55. package/doc_build/static/js/async/en_guide_basic_modify-output-product.js +2970 -0
  56. package/doc_build/static/js/async/en_guide_basic_modify-output-product.js.map +1 -0
  57. package/doc_build/static/js/async/en_guide_basic_publish-your-project.js +2182 -0
  58. package/doc_build/static/js/async/en_guide_basic_publish-your-project.js.map +1 -0
  59. package/doc_build/static/js/async/en_guide_basic_test-your-project.js +3892 -0
  60. package/doc_build/static/js/async/en_guide_basic_test-your-project.js.map +1 -0
  61. package/doc_build/static/js/async/en_guide_basic_use-micro-generator.js +168 -0
  62. package/doc_build/static/js/async/en_guide_basic_use-micro-generator.js.map +1 -0
  63. package/doc_build/static/js/async/en_guide_basic_using-storybook.js +4762 -0
  64. package/doc_build/static/js/async/en_guide_basic_using-storybook.js.map +1 -0
  65. package/doc_build/static/js/async/en_guide_best-practices_components.js +21388 -0
  66. package/doc_build/static/js/async/en_guide_best-practices_components.js.map +1 -0
  67. package/doc_build/static/js/async/en_guide_intro_getting-started.js +1906 -0
  68. package/doc_build/static/js/async/en_guide_intro_getting-started.js.map +1 -0
  69. package/doc_build/static/js/async/en_guide_intro_welcome.js +148 -0
  70. package/doc_build/static/js/async/en_guide_intro_welcome.js.map +1 -0
  71. package/doc_build/static/js/async/en_guide_intro_why-module-engineering-solution.js +92 -0
  72. package/doc_build/static/js/async/en_guide_intro_why-module-engineering-solution.js.map +1 -0
  73. package/doc_build/static/js/async/en_plugins_guide_getting-started.js +2560 -0
  74. package/doc_build/static/js/async/en_plugins_guide_getting-started.js.map +1 -0
  75. package/doc_build/static/js/async/en_plugins_guide_plugin-object.js +4177 -0
  76. package/doc_build/static/js/async/en_plugins_guide_plugin-object.js.map +1 -0
  77. package/doc_build/static/js/async/en_plugins_guide_setup-function.js +3819 -0
  78. package/doc_build/static/js/async/en_plugins_guide_setup-function.js.map +1 -0
  79. package/doc_build/static/js/async/en_plugins_official-list_overview.js +70 -0
  80. package/doc_build/static/js/async/en_plugins_official-list_overview.js.map +1 -0
  81. package/doc_build/static/js/async/guide_advance_asset.js +3997 -0
  82. package/doc_build/static/js/async/guide_advance_asset.js.map +1 -0
  83. package/doc_build/static/js/async/guide_advance_build-umd.js +9863 -0
  84. package/doc_build/static/js/async/guide_advance_build-umd.js.map +1 -0
  85. package/doc_build/static/js/async/guide_advance_copy.js +6539 -0
  86. package/doc_build/static/js/async/guide_advance_copy.js.map +1 -0
  87. package/doc_build/static/js/async/guide_advance_external-dependency.js +3812 -0
  88. package/doc_build/static/js/async/guide_advance_external-dependency.js.map +1 -0
  89. package/doc_build/static/js/async/guide_advance_in-depth-about-build.js +5046 -0
  90. package/doc_build/static/js/async/guide_advance_in-depth-about-build.js.map +1 -0
  91. package/doc_build/static/js/async/guide_advance_in-depth-about-dev-command.js +152 -0
  92. package/doc_build/static/js/async/guide_advance_in-depth-about-dev-command.js.map +1 -0
  93. package/doc_build/static/js/async/guide_advance_theme-config.js +2475 -0
  94. package/doc_build/static/js/async/guide_advance_theme-config.js.map +1 -0
  95. package/doc_build/static/js/async/guide_basic_before-getting-started.js +3662 -0
  96. package/doc_build/static/js/async/guide_basic_before-getting-started.js.map +1 -0
  97. package/doc_build/static/js/async/guide_basic_command-preview.js +3793 -0
  98. package/doc_build/static/js/async/guide_basic_command-preview.js.map +1 -0
  99. package/doc_build/static/js/async/guide_basic_modify-output-product.js +2949 -0
  100. package/doc_build/static/js/async/guide_basic_modify-output-product.js.map +1 -0
  101. package/doc_build/static/js/async/guide_basic_publish-your-project.js +2243 -0
  102. package/doc_build/static/js/async/guide_basic_publish-your-project.js.map +1 -0
  103. package/doc_build/static/js/async/guide_basic_test-your-project.js +3892 -0
  104. package/doc_build/static/js/async/guide_basic_test-your-project.js.map +1 -0
  105. package/doc_build/static/js/async/guide_basic_use-micro-generator.js +172 -0
  106. package/doc_build/static/js/async/guide_basic_use-micro-generator.js.map +1 -0
  107. package/doc_build/static/js/async/guide_basic_using-storybook.js +4762 -0
  108. package/doc_build/static/js/async/guide_basic_using-storybook.js.map +1 -0
  109. package/doc_build/static/js/async/guide_best-practices_components.js +21088 -0
  110. package/doc_build/static/js/async/guide_best-practices_components.js.map +1 -0
  111. package/doc_build/static/js/async/guide_intro_getting-started.js +1782 -0
  112. package/doc_build/static/js/async/guide_intro_getting-started.js.map +1 -0
  113. package/doc_build/static/js/async/guide_intro_welcome.js +148 -0
  114. package/doc_build/static/js/async/guide_intro_welcome.js.map +1 -0
  115. package/doc_build/static/js/async/guide_intro_why-module-engineering-solution.js +92 -0
  116. package/doc_build/static/js/async/guide_intro_why-module-engineering-solution.js.map +1 -0
  117. package/doc_build/static/js/async/index.js +85 -0
  118. package/doc_build/static/js/async/index.js.map +1 -0
  119. package/doc_build/static/js/async/packages_cli_doc-core_src_theme-default_components_Search_logic_search_ts.js +447 -0
  120. package/doc_build/static/js/async/packages_cli_doc-core_src_theme-default_components_Search_logic_search_ts.js.map +1 -0
  121. package/doc_build/static/js/async/plugins_guide_getting-started.js +2608 -0
  122. package/doc_build/static/js/async/plugins_guide_getting-started.js.map +1 -0
  123. package/doc_build/static/js/async/plugins_guide_plugin-object.js +4173 -0
  124. package/doc_build/static/js/async/plugins_guide_plugin-object.js.map +1 -0
  125. package/doc_build/static/js/async/plugins_guide_setup-function.js +3819 -0
  126. package/doc_build/static/js/async/plugins_guide_setup-function.js.map +1 -0
  127. package/doc_build/static/js/async/plugins_official-list_overview.js +70 -0
  128. package/doc_build/static/js/async/plugins_official-list_overview.js.map +1 -0
  129. package/doc_build/static/js/async/vendors-node_modules_pnpm_code-hike_mdx_0_7_4_react_18_2_0_node_modules_code-hike_mdx_dist_co-06dd41.js +6656 -0
  130. package/doc_build/static/js/async/vendors-node_modules_pnpm_code-hike_mdx_0_7_4_react_18_2_0_node_modules_code-hike_mdx_dist_co-06dd41.js.map +1 -0
  131. package/doc_build/static/js/async/vendors-node_modules_pnpm_flexsearch_0_6_32_node_modules_flexsearch_dist_flexsearch_min_js.js +54 -0
  132. package/doc_build/static/js/async/vendors-node_modules_pnpm_flexsearch_0_6_32_node_modules_flexsearch_dist_flexsearch_min_js.js.map +1 -0
  133. package/doc_build/static/js/builder-runtime.js +1375 -0
  134. package/doc_build/static/js/builder-runtime.js.map +1 -0
  135. package/doc_build/static/js/lib-lodash.js +4907 -0
  136. package/doc_build/static/js/lib-lodash.js.map +1 -0
  137. package/doc_build/static/js/lib-polyfill.js +24769 -0
  138. package/doc_build/static/js/lib-polyfill.js.map +1 -0
  139. package/doc_build/static/js/lib-react.js +39510 -0
  140. package/doc_build/static/js/lib-react.js.map +1 -0
  141. package/doc_build/static/js/main.js +9237 -0
  142. package/doc_build/static/js/main.js.map +1 -0
  143. package/doc_build/static/js/vendors-node_modules_pnpm_remix-run_router_1_2_0_node_modules_remix-run_router_dist_router_js-9d5e9c.js +8532 -0
  144. package/doc_build/static/js/vendors-node_modules_pnpm_remix-run_router_1_2_0_node_modules_remix-run_router_dist_router_js-9d5e9c.js.map +1 -0
  145. package/docs/en/api/config/build-config.md +5 -5
  146. package/docs/en/api/plugin-api/plugin-hooks.md +1 -1
  147. package/docs/en/guide/advance/asset.mdx +1 -1
  148. package/docs/en/guide/advance/build-umd.mdx +3 -3
  149. package/docs/en/guide/advance/copy.md +5 -5
  150. package/docs/en/guide/advance/external-dependency.mdx +2 -2
  151. package/docs/en/guide/advance/in-depth-about-build.md +7 -7
  152. package/docs/en/guide/advance/in-depth-about-dev-command.md +1 -1
  153. package/docs/en/guide/advance/theme-config.mdx +2 -2
  154. package/docs/en/guide/basic/before-getting-started.md +1 -1
  155. package/docs/en/guide/basic/command-preview.md +2 -2
  156. package/docs/en/guide/basic/modify-output-product.md +23 -22
  157. package/docs/en/guide/basic/publish-your-project.md +4 -4
  158. package/docs/en/guide/basic/test-your-project.mdx +5 -3
  159. package/docs/en/guide/basic/use-micro-generator.md +9 -5
  160. package/docs/en/guide/basic/using-storybook.mdx +6 -4
  161. package/docs/en/guide/best-practices/components.mdx +103 -97
  162. package/docs/en/guide/intro/getting-started.md +2 -2
  163. package/docs/en/index.md +14 -17
  164. package/docs/en/plugins/guide/getting-started.mdx +2 -2
  165. package/docs/en/plugins/guide/setup-function.mdx +2 -2
  166. package/docs/zh/api/config/_category_.json +1 -1
  167. package/docs/zh/api/config/build-config.md +16 -5
  168. package/docs/zh/api/config/plugins.md +1 -1
  169. package/docs/zh/api/index.md +1 -0
  170. package/docs/zh/api/plugin-api/_category_.json +1 -1
  171. package/docs/zh/api/plugin-api/plugin-hooks.md +56 -55
  172. package/docs/zh/guide/advance/asset.mdx +1 -1
  173. package/docs/zh/guide/advance/build-umd.mdx +3 -3
  174. package/docs/zh/guide/advance/copy.md +5 -5
  175. package/docs/zh/guide/advance/external-dependency.mdx +3 -3
  176. package/docs/zh/guide/advance/in-depth-about-build.md +7 -7
  177. package/docs/zh/guide/advance/in-depth-about-dev-command.md +1 -1
  178. package/docs/zh/guide/advance/theme-config.mdx +2 -2
  179. package/docs/zh/guide/basic/before-getting-started.md +1 -1
  180. package/docs/zh/guide/basic/command-preview.md +2 -2
  181. package/docs/zh/guide/basic/modify-output-product.md +30 -30
  182. package/docs/zh/guide/basic/publish-your-project.md +4 -4
  183. package/docs/zh/guide/basic/test-your-project.mdx +5 -3
  184. package/docs/zh/guide/basic/use-micro-generator.md +5 -5
  185. package/docs/zh/guide/basic/using-storybook.mdx +6 -4
  186. package/docs/zh/guide/best-practices/components.mdx +10 -10
  187. package/docs/zh/guide/intro/getting-started.md +2 -2
  188. package/docs/zh/index.md +1 -1
  189. package/docs/zh/plugins/guide/getting-started.mdx +3 -3
  190. package/docs/zh/plugins/guide/setup-function.mdx +2 -2
  191. package/modern.config.ts +4 -3
  192. package/package.json +3 -3
@@ -4,7 +4,7 @@ sidebar_position: 1
4
4
 
5
5
  # BuildConfig
6
6
 
7
- This section describes all the configuration of Module tools for building
7
+ This section describes all the configuration of Module Tools for building
8
8
 
9
9
  ## alias
10
10
 
@@ -12,7 +12,7 @@ This section describes all the configuration of Module tools for building
12
12
  - default: `{'@': 'src',}`
13
13
 
14
14
  :::tip
15
- For TypeScript projects, you only need to configure [compilerOptions.paths](https://www.typescriptlang.org/tsconfig#paths) in `tsconfig.json`, Module tools will automatically recognize the alias in `tsconfig.json`, so there is no need to configure the `alias` field additionally.
15
+ For TypeScript projects, you only need to configure [compilerOptions.paths](https://www.typescriptlang.org/tsconfig#paths) in `tsconfig.json`, Module Tools will automatically recognize the alias in `tsconfig.json`, so there is no need to configure the `alias` field additionally.
16
16
  :::
17
17
 
18
18
  ```js modern.config.ts
@@ -57,7 +57,7 @@ export default {
57
57
 
58
58
  ### path
59
59
 
60
- Static resource output path, will be based on [outDir](/zh/api/build-config/#outDir)
60
+ Static resource output path, will be based on [outDir](/api/config/build-config#outDir)
61
61
 
62
62
  - type: `string`
63
63
  - default: `assets`
@@ -196,7 +196,7 @@ Path to the tsconfig file
196
196
 
197
197
  ### distPath
198
198
 
199
- The output path of the dts file, based on [outDir](/zh/api/build-config/#outDir)
199
+ The output path of the dts file, based on [outDir](/api/config/build-config#outDir)
200
200
 
201
201
  - type: `string`
202
202
  - default: `. /types`
@@ -522,7 +522,7 @@ When the value is of type `Object`, it is merged with the default configuration
522
522
 
523
523
  When the value is of type `Function`, the object returned by the function is merged with the default configuration via `Object.assign`.
524
524
 
525
- The `theme` property is not allowed, otherwise the build will fail, using [`designSystem`](/zh/api/design-system) as the `Tailwind CSS Theme` configuration.
525
+ The `theme` property is not allowed, otherwise the build will fail, using [`designSystem`](/api/config/design-system) as the `Tailwind CSS Theme` configuration.
526
526
 
527
527
  The rest of the usage is the same as Tailwind CSS: [Quick Portal](https://tailwindcss.com/docs/configuration).
528
528
 
@@ -56,7 +56,7 @@ type Return = BuildConfig;
56
56
 
57
57
  ### `beforeBuildTask`
58
58
 
59
- Based on the build configuration, module tools will split the overall build into multiple sub-build tasks. The Hook will be triggered before each build subtask.
59
+ Based on the build configuration, Module Tools will split the overall build into multiple sub-build tasks. The Hook will be triggered before each build subtask.
60
60
 
61
61
  ``` ts
62
62
  export default (): CliPlugin<ModuleTools> => ({
@@ -4,7 +4,7 @@ sidebar_position: 6
4
4
 
5
5
  # Handle static resource files
6
6
 
7
- The module project will handle static resources used in the code. If configuration is required, then the [`buildConfig.asset`](/en/api/build-config#asset) API can be used.
7
+ The module project will handle static resources used in the code. If configuration is required, then the [`buildConfig.asset`](/en/api/config/build-config#asset) API can be used.
8
8
 
9
9
  ## Default behavior
10
10
 
@@ -22,7 +22,7 @@ export default defineConfig({
22
22
 
23
23
  ## Third-party dependency handling for umd products
24
24
 
25
- In the [[How to handle third-party dependencies]](/en/guide/advance/external-dependency) chapter, we know that we can control whether or not the project packages third-party dependencies via the [`autoExternals`](/en/api/build-config#autoexternal) and [`externals`](/en/api/build-config#externals) APIs.
25
+ In the [[How to handle third-party dependencies]](/en/guide/advance/external-dependency) chapter, we know that we can control whether or not the project packages third-party dependencies via the [`autoExternals`](/en/api/config/build-config#autoexternal) and [`externals`](/en/api/config/build-config#externals) APIs.
26
26
  So when building umd products, we can also use it like this:
27
27
 
28
28
  <CH.Spotlight>
@@ -110,7 +110,7 @@ We know from the above example that when using the `autoExternal` and `externals
110
110
  - In a Node.js environment, you can get the react dependency with `require('react')`.
111
111
  - In a browser environment, you can get the react dependency via `global.react`.
112
112
 
113
- However, in the browser environment, when getting third-party dependencies, **global variable names are not necessarily identical to the dependency names**, so you have to use the [`buildConfig.umdGlobals`](/en/api/build-config#umdglobals) API.
113
+ However, in the browser environment, when getting third-party dependencies, **global variable names are not necessarily identical to the dependency names**, so you have to use the [`buildConfig.umdGlobals`](/en/api/config/build-config#umdglobals) API.
114
114
 
115
115
  Again using the previous example, when the `react` dependency exists in the browser environment as a `windows.React` or `global.React` global variable, then:
116
116
 
@@ -218,7 +218,7 @@ export default () => {
218
218
  });
219
219
  ```
220
220
 
221
- If you need to modify it, you need to use the [`buildConfig.umdModuleName`](/en/api/build-config#umdmodulename) API.
221
+ If you need to modify it, you need to use the [`buildConfig.umdModuleName`](/en/api/config/build-config#umdmodulename) API.
222
222
 
223
223
  When this API is used:
224
224
 
@@ -8,10 +8,10 @@ The Module Project provides the Copy utility for copying already existing indivi
8
8
 
9
9
  ## Understanding the Copy API
10
10
 
11
- We can use the Copy tool via the [`buildConfig.copy`](/en/api/build-config#copy) API, which contains the following two main configurations.
11
+ We can use the Copy tool via the [`buildConfig.copy`](/en/api/config/build-config#copy) API, which contains the following two main configurations.
12
12
 
13
- - [`patterns`](/en/api/build-config#copypatterns)
14
- - [`options`](/en/api/build-config#copyoptions)
13
+ - [`patterns`](/en/api/config/build-config#copypatterns)
14
+ - [`options`](/en/api/config/build-config#copyoptions)
15
15
 
16
16
  It is recommended to spend some time getting to know them before you start learning.
17
17
 
@@ -34,7 +34,7 @@ export default defineConfig({
34
34
  });
35
35
  ```
36
36
 
37
- `patterns.context` 一般和 `patterns.from` 配合使用,默认情况下它的值与 [`buildConfig.sourceDir`](/zh/api/build-config#sourcedir) 相同,因此我们可以按照如下方式指定 `src/data.json` 文件为要复制的文件:
37
+ `patterns.context` 一般和 `patterns.from` 配合使用,默认情况下它的值与 [`buildConfig.sourceDir`](/api/config/build-config#sourcedir) 相同,因此我们可以按照如下方式指定 `src/data.json` 文件为要复制的文件:
38
38
 
39
39
  > 默认情况下,`buildConfig.sourceDir` 为 `src`
40
40
 
@@ -70,7 +70,7 @@ export default defineConfig({
70
70
  });
71
71
  ```
72
72
 
73
- `patterns.to` 用于指定复制文件的输出路径,默认情况下它的值为 [`buildConfig.outDir`](zh/api/build-config#outDir)对应的值。因此我们按照如下方式将 `src/index.html` 复制到 `dist` 目录下:
73
+ `patterns.to` 用于指定复制文件的输出路径,默认情况下它的值为 [`buildConfig.outDir`](/api/config/build-config#outDir)对应的值。因此我们按照如下方式将 `src/index.html` 复制到 `dist` 目录下:
74
74
 
75
75
  ```ts
76
76
  export default defineConfig({
@@ -81,8 +81,8 @@ So how do you enable the packaging of third-party dependencies in your module pr
81
81
 
82
82
  The following APIs are provided in the build configuration to handle third-party dependencies:
83
83
 
84
- - [`buildConfig.autoExternal`](/en/api/build-config#autoexternal)
85
- - [`buildConfig.externals`](/en/api/build-config#externals)
84
+ - [`buildConfig.autoExternal`](/en/api/config/build-config#autoexternal)
85
+ - [`buildConfig.externals`](/en/api/config/build-config#externals)
86
86
 
87
87
  ### Turn off default behavior
88
88
 
@@ -9,7 +9,7 @@ In the [Basic Usage] section, we already knew that you can modify the output pro
9
9
  :::tip{title=notes}
10
10
  If you are not sure what `buildConfig` is, it is recommended to take some time to understand it by following this link.
11
11
 
12
- - [[modify-output-product](/en/guide/modify-output-product)]
12
+ - [[modify-output-product](/en/guide/basic/modify-output-product)]
13
13
  :::
14
14
 
15
15
  In this chapter we'll dive into the use of certain build configurations and understand what happens when the `modern build` command is executed.
@@ -24,11 +24,11 @@ A Bundle is a package of build products, which may be a single file or multiple
24
24
 
25
25
  Bundleless, on the other hand, means that each source file is compiled and built separately, but not packaged together. Each product file can be found with its corresponding source code file. The process of **Bundleless build can also be understood as the process of code conversion of source files only**.
26
26
 
27
- In `buildConfig` you can specify whether the current build task is Bundle or Bundleless by using [`buildConfig.buildType`](/en/api/build-config#buildtype).
27
+ In `buildConfig` you can specify whether the current build task is Bundle or Bundleless by using [`buildConfig.buildType`](/en/api/config/build-config#buildtype).
28
28
 
29
29
  ### Relationship between `input` and `sourceDir`
30
30
 
31
- [`buildConfig.input`](/en/api/build-config#input) is used to specify the file path or directory path where the source code is read, and its default value differs between Bundle and Bundleless builds.
31
+ [`buildConfig.input`](/en/api/config/build-config#input) is used to specify the file path or directory path where the source code is read, and its default value differs between Bundle and Bundleless builds.
32
32
 
33
33
  - When `buildType: 'bundle'`, `input` defaults to `['src/index.ts']`
34
34
  - When `buildType: 'bundleless'`, `input` defaults to `['src']`
@@ -61,7 +61,7 @@ The Bundleless build process also supports such use, but it is not recommended.
61
61
 
62
62
  #### `sourceDir`
63
63
 
64
- [`sourceDir`](/en/api/build-config#sourcedir) is used to specify the source code directory, which is related to both.
64
+ [`sourceDir`](/en/api/config/build-config#sourcedir) is used to specify the source code directory, which is related to both.
65
65
 
66
66
  - type file generation
67
67
  - [`outbase`](https://esbuild.github.io/api/#outbase) for specifying the build process
@@ -73,7 +73,7 @@ In general:
73
73
 
74
74
  ### Declaration Type Files
75
75
 
76
- The [`buildConfig.dts`](/en/api/build-config#dts) configuration is mainly used for type file generation.
76
+ The [`buildConfig.dts`](/en/api/config/build-config#dts) configuration is mainly used for type file generation.
77
77
 
78
78
  #### Turn off type generation
79
79
 
@@ -99,7 +99,7 @@ With `buildType: 'bundleless'`, type files are generated using the project's `ts
99
99
 
100
100
  The **module engineering solution also supports packaging of type files**, although care needs to be taken when using this feature.
101
101
 
102
- - Some third-party dependencies have incorrect syntax that can cause the packaging process to fail. So in this case, you need to exclude such third-party packages manually with [`buildConfig.externals`](/en/api/build-config#externals).
102
+ - Some third-party dependencies have incorrect syntax that can cause the packaging process to fail. So in this case, you need to exclude such third-party packages manually with [`buildConfig.externals`](/en/api/config/build-config#externals).
103
103
  - It is not possible to handle the case where the type file of a third-party dependency points to a `.ts` file. For example, the `package.json` of a third-party dependency contains something like this: `{"types": ". /src/index.ts"}`.
104
104
 
105
105
  #### Alias Conversion
@@ -165,7 +165,7 @@ export default defineConfig({
165
165
 
166
166
  ### `buildConfig.define` Usage for different scenarios
167
167
 
168
- [`buildConfig.define`](/en/api/build-config#define) functions somewhat similar to [`webpack.DefinePlugin`](https://webpack.js.org/plugins/define-plugin/). A few usage scenarios are described here.
168
+ [`buildConfig.define`](/en/api/config/build-config#define) functions somewhat similar to [`webpack.DefinePlugin`](https://webpack.js.org/plugins/define-plugin/). A few usage scenarios are described here.
169
169
 
170
170
  #### Environment variable replacement
171
171
 
@@ -9,7 +9,7 @@ sidebar_position: 2
9
9
  :::tip{title=注意}
10
10
  如果你还不清楚 `buildConfig` 是什么,建议花一些时间通过下面的链接了解一下:
11
11
 
12
- - 【[修改输出产物](/zh/guide/modify-output-product)】
12
+ - 【[修改输出产物](/guide/basic/modify-output-product)】
13
13
  :::
14
14
 
15
15
  而在本章里我们将要深入理解某些构建配置的使用以及了解执行 `modern build` 命令的时候发生了什么。
@@ -4,7 +4,7 @@ sidebar_position: 7
4
4
 
5
5
  # Theme Configuration
6
6
 
7
- The module project provides the ability to configure themes through the [`designSystem`](/en/api/design-system) API.
7
+ The module project provides the ability to configure themes through the [`designSystem`](/en/api/config/design-system) API.
8
8
 
9
9
  ## Motivation and rationale
10
10
 
@@ -17,7 +17,7 @@ The so-called `designToken` corresponds to different things in different style d
17
17
  - `@apply` custom directive under css/less/sass to use a string with the same name as the HTML class name supported by tailwindcss.
18
18
  - css/less/scss: Generate global style variables via `designSystem`.
19
19
 
20
- The data structure of the `designSystem` API is borrowed from the [theme API](https://tailwindcss.com/docs/theme) in the `tailwindcss` configuration object, so a default set of `designToken` exists. For the default values, see the [`designSystem` API](/zh/api/design-system).
20
+ The data structure of the `designSystem` API is borrowed from the [theme API](https://tailwindcss.com/docs/theme) in the `tailwindcss` configuration object, so a default set of `designToken` exists. For the default values, see the [`designSystem` API](/api/config/design-system).
21
21
 
22
22
  :::info
23
23
  The css/less/sass global variables are not supported yet.
@@ -14,7 +14,7 @@ Once NodeJS is installed, not only can you access the `node` executable from the
14
14
 
15
15
  Npm is the standard package manager for NodeJS. It started out as a tool for downloading and managing NodeJS package dependencies, but it has since evolved into a tool for front-end JavaScript.
16
16
 
17
- **If you already know something about usage of npm and npm packages, then you can directly see [npm package manager](/en/guide/before-getting-started#npm-package-manager) section.**
17
+ **If you already know something about usage of npm and npm packages, then you can directly see [npm package manager](/en/guide/basic/before-getting-started#npm-package-manager) section.**
18
18
 
19
19
  ## npm package type project
20
20
 
@@ -26,7 +26,7 @@ Options:
26
26
  When you want to start a project build, you can execute the `modern build` command. When using this command, we can:
27
27
 
28
28
  - When wanting to start a build in watch mode, use the `--watch` option.
29
- - When you want to specify the path to the TypeScript configuration file read by the project build, use `-build --tsconfig . /path/config.json` option. This option overrides all [`buildConfig`](/zh/api/build-config) configurations in [`dts.tsconfigPath`](/zh/api/build-config).
29
+ - When you want to specify the path to the TypeScript configuration file read by the project build, use `-build --tsconfig . /path/config.json` option. This option overrides all [`buildConfig`](/api/config/build-config) configurations in [`dts.tsconfigPath`](/api/config/build-config).
30
30
  - The `-no-dts` option can be used when the DTS type file generation and type checking behavior of the project needs to be turned off. **Note: The generation of type files depends on the results of type checking. If type checking is turned off, then type files will not be generated either**.
31
31
  - The `--no-clear` option can be used when the automatic clearing of the product output directory needs to be turned off.
32
32
 
@@ -59,7 +59,7 @@ The following features can currently be enabled.
59
59
  - Tailwind CSS support
60
60
  - Modern.js Runtime API
61
61
 
62
- You can learn more about these features in the [Using the micro generator](/zh/guide/use-micro-generator) section.
62
+ You can learn more about these features in the [Using the micro generator](/guide/basic/use-micro-generator) section.
63
63
 
64
64
  ## `modern dev`
65
65
 
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  sidebar_position: 3
3
3
  ---
4
+
4
5
  # modify-output-product
5
6
 
6
7
  ## Modify output product
@@ -44,7 +45,7 @@ Then the next step is to first explain `buildPreset`.
44
45
 
45
46
  The value of a **build preset can be in the form of a string**, so a build preset of this form is called a preset string.
46
47
 
47
- The module engineering solution provides generic build preset strings and corresponding variants, depending on the generic scenario in which the npm package is used. All currently supported preset strings can be viewed via the [BuildPreset API](/en/api/build-config). The relationship between **generic preset strings and variants** is explained here.
48
+ The module engineering solution provides generic build preset strings and corresponding variants, depending on the generic scenario in which the npm package is used. All currently supported preset strings can be viewed via the [BuildPreset API](/en/api/config/build-config). The relationship between **generic preset strings and variants** is explained here.
48
49
 
49
50
  Among the generic preset strings, `"npm-library"` can be used in the scenario of developing npm packages of the library type, which is suitable for most common module type projects. When `"npm-library"` is set, the output product of the project will have the following characteristics:
50
51
 
@@ -76,7 +77,7 @@ export default defineConfig({
76
77
 
77
78
  In the above code implementation, `preset.NPM_LIBRARY` corresponds to the preset string `"npm-library"`, which represents the `"npm-library"` equivalent of a multi-group build-related configuration. We traverse the `NPM_LIBRARY` array, which contains multiple `buildConfig` objects, with the `map` method. We make a shallow copy of the original `buildConfig` object and modify the shallow copy to get `buildConfig.target`, specifying it as `es2017`.
78
79
 
79
- > The specific value of `preset.NPM_LIBRARY` can be viewed via the [BuildPreset API](/en/api/build-config). The `preset` object contains not only `NPM_LIBRARY`, but also other similar constants.
80
+ > The specific value of `preset.NPM_LIBRARY` can be viewed via the [BuildPreset API](/en/api/config/build-config). The `preset` object contains not only `NPM_LIBRARY`, but also other similar constants.
80
81
 
81
82
  So what is the `buildConfig` object here? And what are the previously mentioned build product features based on?
82
83
 
@@ -88,34 +89,34 @@ We explain it next.
88
89
 
89
90
  **The basic attributes of a build product include:**
90
91
 
91
- - Whether the product is packaged or not: the corresponding API is [`buildConfig.buildType`](/en/api/build-config#buildtype).
92
- - Product support for syntax: the corresponding API is [`buildConfig.target`](/en/api/build-config#target).
93
- - Output format: The corresponding API is [`buildConfig.format`](/en/api/build-config#format).
94
- - How to handle the output type file: the corresponding API is [`buildConfig.dts`](/en/api/build-config#dts).
95
- - How the sourceMap of the product is handled: the corresponding API is [`buildConfig.sourceMap`](/en/api/build-config#sourcemap).
96
- - The input (or source file) corresponding to the output: the corresponding API is [`buildConfig.input`](/en/api/build-config#input).
97
- - The directory of the output of the product: the corresponding API is [`buildConfig.outDir`](/en/api/build-config#outDir).
98
- - The source directory of the build: the corresponding API is [`buildConfig.sourceDir`](/en/api/build-config#sourcedir).
92
+ - Whether the product is packaged or not: the corresponding API is [`buildConfig.buildType`](/en/api/config/build-config#buildtype).
93
+ - Product support for syntax: the corresponding API is [`buildConfig.target`](/en/api/config/build-config#target).
94
+ - Output format: The corresponding API is [`buildConfig.format`](/en/api/config/build-config#format).
95
+ - How to handle the output type file: the corresponding API is [`buildConfig.dts`](/en/api/config/build-config#dts).
96
+ - How the sourceMap of the product is handled: the corresponding API is [`buildConfig.sourceMap`](/en/api/config/build-config#sourcemap).
97
+ - The input (or source file) corresponding to the output: the corresponding API is [`buildConfig.input`](/en/api/config/build-config#input).
98
+ - The directory of the output of the product: the corresponding API is [`buildConfig.outDir`](/en/api/config/build-config#outDir).
99
+ - The source directory of the build: the corresponding API is [`buildConfig.sourceDir`](/en/api/config/build-config#sourcedir).
99
100
 
100
101
  **Common functions needed to build products include:**
101
102
 
102
- - Alias: The corresponding API is [`buildConfig.alias`](/en/api/build-config#alias).
103
- - Static resource handling: The corresponding API is [`buildConfig.asset`](/en/api/build-config#asset).
103
+ - Alias: The corresponding API is [`buildConfig.alias`](/en/api/config/build-config#alias).
104
+ - Static resource handling: The corresponding API is [`buildConfig.asset`](/en/api/config/build-config#asset).
104
105
  - Third-party dependency handling: The corresponding APIs are
105
- - [`buildConfig.autoExternal`](/en/api/build-config#autoexternal).
106
- - [`buildConfig.externals`](/en/api/build-config#externals).
107
- - Copy: The corresponding API is [`buildConfig.copy`](/en/api/build-config#copy).
108
- - Global variable substitution: the corresponding API is [`buildConfig.define`](/en/api/build-config#define).
109
- - Specify [JSX](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html) compilation method, the corresponding API is [`buildConfig.jsx`](/en/api/build-config#jsx).
106
+ - [`buildConfig.autoExternal`](/en/api/config/build-config#autoexternal).
107
+ - [`buildConfig.externals`](/en/api/config/build-config#externals).
108
+ - Copy: The corresponding API is [`buildConfig.copy`](/en/api/config/build-config#copy).
109
+ - Global variable substitution: the corresponding API is [`buildConfig.define`](/en/api/config/build-config#define).
110
+ - Specify [JSX](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html) compilation method, the corresponding API is [`buildConfig.jsx`](/en/api/config/build-config#jsx).
110
111
 
111
112
  **Some advanced properties or less frequently used functions:**
112
113
 
113
- - Product code compression: The corresponding API is [`buildConfig.minify`](/en/api/build-config#minify).
114
- - Code splitting: [`buildConfig.splitting`](/en/api/build-config#splitting)
115
- - Specify whether the build product is for the NodeJS environment or the browser environment: the corresponding API is [`buildConfig.platform`](/en/api/build-config#platform).
114
+ - Product code compression: The corresponding API is [`buildConfig.minify`](/en/api/config/build-config#minify).
115
+ - Code splitting: [`buildConfig.splitting`](/en/api/config/build-config#splitting)
116
+ - Specify whether the build product is for the NodeJS environment or the browser environment: the corresponding API is [`buildConfig.platform`](/en/api/config/build-config#platform).
116
117
  - umd product-related.
117
- - Specifies the global variables imported externally to the umd product: the corresponding API is [`buildConfig.umdGlobals`](/en/api/build-config#umdglobals).
118
- - Specify the module name of the umd product: the corresponding API is [`buildConfig.umdModuleName`](/en/api/build-config#umdmodulename).
118
+ - Specifies the global variables imported externally to the umd product: the corresponding API is [`buildConfig.umdGlobals`](/en/api/config/build-config#umdglobals).
119
+ - Specify the module name of the umd product: the corresponding API is [`buildConfig.umdModuleName`](/en/api/config/build-config#umdmodulename).
119
120
 
120
121
  In addition to the above categories, frequently asked questions and best practices about these APIs can be found at the following links.
121
122
 
@@ -20,7 +20,7 @@ An npm-type module project release process consists of two phases.
20
20
 
21
21
  Once these changes have been made, the current changes need to be documented with the following command.
22
22
 
23
- - [`modern change`](/zh/guide/command-preview#modern-change)
23
+ - [`modern change`](/guide/basic/command-preview#modern-change)
24
24
 
25
25
  Executing the `modern change` command asks the developer several questions and generates a change log based on the developer's answers. The changelog file contains the type of change and its description, and is committed to the git repository.
26
26
 
@@ -53,7 +53,7 @@ publish test
53
53
 
54
54
  When the project version needs to be updated, execute the following command.
55
55
 
56
- - [`modern bump`](/zh/guide/command-preview#modern-bump)
56
+ - [`modern bump`](/guide/basic/command-preview#modern-bump)
57
57
 
58
58
  Executing `modern bump` will modify the version number in `package.json` based on the contents of the Markdown file in the `.changeset/` directory where the changes were recorded, and generate the `CHANGELOG.md` file. **These Markdown files are also deleted when the version update is complete, so they are "consumed "**.
59
59
 
@@ -71,7 +71,7 @@ Executing `modern bump` will modify the version number in `package.json` based o
71
71
 
72
72
  To publish a project, you can execute the following command.
73
73
 
74
- - [`modern publish`](/zh/guide/command-preview#modern-release)
74
+ - [`modern publish`](/guide/basic/command-preview#modern-release)
75
75
 
76
76
  The `modern release` command publishes the project to the npm Registry.
77
77
 
@@ -89,7 +89,7 @@ However, if you want to change the version number of the current project to a pr
89
89
 
90
90
  When a pre-release is needed before the official release, the following command is executed.
91
91
 
92
- - [`modern pre`](/zh/guide/command-preview#modern-pre)
92
+ - [`modern pre`](/guide/basic/command-preview#modern-pre)
93
93
 
94
94
  First `modern pre enter <tag>` to enter pre-release mode, `<tag>` can be the same as the `tag` specified with the `modern release --tag` command when releasing the project.
95
95
 
@@ -37,7 +37,7 @@ After execution, you will see the results of the test:
37
37
 
38
38
  The Module Engineering Program provides the following configurations for testing.
39
39
 
40
- - [`testing`](/zh/api/config-test)
40
+ - [`testing`](/api/config/testing)
41
41
 
42
42
  You can add it in `modern.config.(j|t)s`.
43
43
 
@@ -99,10 +99,12 @@ npm run test
99
99
 
100
100
  ### Components
101
101
 
102
- For components, Modern.js's [Runtime API](xxx) provides functionality for testing UI components, which is provided by `@modern-js/runtime/testing`.
102
+ {/* 链接待补充 */}
103
+
104
+ For components, Modern.js's Runtime API provides functionality for testing UI components, which is provided by `@modern-js/runtime/testing`.
103
105
 
104
106
  :::tip
105
- If you need to use the Runtime API, then you can turn it on via [microgenerator](/zh/guide/command-preview).
107
+ If you need to use the Runtime API, then you can turn it on via [microgenerator](/guide/basic/command-preview).
106
108
  :::
107
109
 
108
110
  <CH.Spotlight>
@@ -12,7 +12,7 @@ The Module Engineering solution provides the Microgenerator tool, which allows f
12
12
 
13
13
  Thus with these capabilities, **Microgenerator can enable additional feature functionality for the project**.
14
14
 
15
- The microgenerator can be started via [`modern new`](/zh/guide/command-preview). The current Microgenerator features supported by the Module Engineering program are:
15
+ The microgenerator can be started via [`modern new`](/guide/basic/command-preview). The current Microgenerator features supported by the Module Engineering program are:
16
16
 
17
17
  ## Storybook
18
18
 
@@ -20,8 +20,8 @@ The **Storybook feature** can be enabled when we want to debug a component or a
20
20
 
21
21
  For more information on how to start Storybook and how to use it, check out the following link.
22
22
 
23
- - [`modern dev`](/en/guide/command-preview#modern-dev)
24
- - [using Storybook](xxx)
23
+ - [`modern dev`](/en/guide/basic/command-preview#modern-dev)
24
+ - [`using Storybook`](/en/guide/basic/using-storybook)
25
25
 
26
26
  ## Tailwind CSS support
27
27
 
@@ -29,10 +29,14 @@ This can be enabled when we want to add [Tailwind CSS](https://v2.tailwindcss.co
29
29
 
30
30
  For more information on how to use Tailwind CSS in your module projects, check out.
31
31
 
32
- - [Using Tailwind CSS](xxx)
32
+ <!-- 链接待补充 -->
33
+
34
+ - Using Tailwind CSS
33
35
 
34
36
  ## Modern.js Runtime API
35
37
 
36
- **Modern.js provides [Runtime API](xxx) capabilities that can only be used in the Modern.js application project environment**. If you need to develop a component for use in a Modern.js application environment, then you can turn on this feature and the microgenerator will add the `"@modern-js/runtime"` dependency.
38
+ <!-- 链接待补充 -->
39
+
40
+ **Modern.js provides Runtime API capabilities that can only be used in the Modern.js application project environment**. If you need to develop a component for use in a Modern.js application environment, then you can turn on this feature and the microgenerator will add the `"@modern-js/runtime"` dependency.
37
41
 
38
42
  Also, the Storybook debugging tool will determine if the project needs to use the Runtime API by checking the project's dependencies and providing the same Runtime API runtime environment as the Modern.js application project.
@@ -6,8 +6,8 @@ sidebar_position: 5
6
6
 
7
7
  First of all, if you haven't read the following, take a few minutes to understand it first.
8
8
 
9
- - [use micro-generator to enable Storybook debugging](/en/guide/use-micro-generator#storybook-debug)
10
- - [`modern dev`](/en/guide/command-preview#modern-dev)
9
+ - [use micro-generator to enable Storybook debugging](/en/guide/basic/use-micro-generator#storybook-debug)
10
+ - [`modern dev`](/en/guide/basic/command-preview#modern-dev)
11
11
 
12
12
  [Storybook](https://storybook.js.org/) is a tool dedicated to component debugging, providing around component development.
13
13
 
@@ -171,7 +171,9 @@ In addition to the configuration file, the module engineering solution also prov
171
171
 
172
172
  The webpack configuration of Storybook can be modified via this configuration.
173
173
 
174
- - [`dev.storybook.webpack`](xxx)
174
+ {/* 链接待补充 */}
175
+
176
+ - `dev.storybook.webpack`
175
177
 
176
178
  ### Building Storybook Products
177
179
 
@@ -183,6 +185,6 @@ modern build --platform storybook
183
185
 
184
186
  For the `modern build --platform` command you can see.
185
187
 
186
- - [`modern build`](/en/guide/command-preview#modern-build)
188
+ - [`modern build`](/en/guide/basic/command-preview#modern-build)
187
189
 
188
190
  After the build is complete, you can see the build product files in the `dist/storybook-static` directory.