@modern-js/module-tools-docs 2.0.1 → 2.0.3-beta.0

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 (330) 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 +2966 -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 +68 -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/en_api_config_build-config.js +8406 -0
  8. package/doc_build/static/js/async/en_api_config_build-config.js.map +1 -0
  9. package/doc_build/static/js/async/en_api_config_build-preset.js +7865 -0
  10. package/doc_build/static/js/async/en_api_config_build-preset.js.map +1 -0
  11. package/doc_build/static/js/async/en_api_config_design-system.js +47805 -0
  12. package/doc_build/static/js/async/en_api_config_design-system.js.map +1 -0
  13. package/doc_build/static/js/async/en_api_config_plugins.js +1488 -0
  14. package/doc_build/static/js/async/en_api_config_plugins.js.map +1 -0
  15. package/doc_build/static/js/async/en_api_config_testing.js +2139 -0
  16. package/doc_build/static/js/async/en_api_config_testing.js.map +1 -0
  17. package/doc_build/static/js/async/en_api_index.js +51 -0
  18. package/doc_build/static/js/async/en_api_index.js.map +1 -0
  19. package/doc_build/static/js/async/en_api_plugin-api_plugin-hooks.js +14360 -0
  20. package/doc_build/static/js/async/en_api_plugin-api_plugin-hooks.js.map +1 -0
  21. package/doc_build/static/js/async/en_guide_advance_asset.js +3972 -0
  22. package/doc_build/static/js/async/en_guide_advance_asset.js.map +1 -0
  23. package/doc_build/static/js/async/en_guide_advance_build-umd.js +9857 -0
  24. package/doc_build/static/js/async/en_guide_advance_build-umd.js.map +1 -0
  25. package/doc_build/static/js/async/en_guide_advance_copy.js +6541 -0
  26. package/doc_build/static/js/async/en_guide_advance_copy.js.map +1 -0
  27. package/doc_build/static/js/async/en_guide_advance_external-dependency.js +3806 -0
  28. package/doc_build/static/js/async/en_guide_advance_external-dependency.js.map +1 -0
  29. package/doc_build/static/js/async/en_guide_advance_in-depth-about-build.js +5304 -0
  30. package/doc_build/static/js/async/en_guide_advance_in-depth-about-build.js.map +1 -0
  31. package/doc_build/static/js/async/en_guide_advance_in-depth-about-dev-command.js +146 -0
  32. package/doc_build/static/js/async/en_guide_advance_in-depth-about-dev-command.js.map +1 -0
  33. package/doc_build/static/js/async/en_guide_advance_theme-config.js +2486 -0
  34. package/doc_build/static/js/async/en_guide_advance_theme-config.js.map +1 -0
  35. package/doc_build/static/js/async/en_guide_basic_before-getting-started.js +3858 -0
  36. package/doc_build/static/js/async/en_guide_basic_before-getting-started.js.map +1 -0
  37. package/doc_build/static/js/async/en_guide_basic_command-preview.js +3973 -0
  38. package/doc_build/static/js/async/en_guide_basic_command-preview.js.map +1 -0
  39. package/doc_build/static/js/async/en_guide_basic_modify-output-product.js +3048 -0
  40. package/doc_build/static/js/async/en_guide_basic_modify-output-product.js.map +1 -0
  41. package/doc_build/static/js/async/en_guide_basic_publish-your-project.js +2180 -0
  42. package/doc_build/static/js/async/en_guide_basic_publish-your-project.js.map +1 -0
  43. package/doc_build/static/js/async/en_guide_basic_test-your-project.js +3887 -0
  44. package/doc_build/static/js/async/en_guide_basic_test-your-project.js.map +1 -0
  45. package/doc_build/static/js/async/en_guide_basic_use-micro-generator.js +186 -0
  46. package/doc_build/static/js/async/en_guide_basic_use-micro-generator.js.map +1 -0
  47. package/doc_build/static/js/async/en_guide_basic_using-storybook.js +4723 -0
  48. package/doc_build/static/js/async/en_guide_basic_using-storybook.js.map +1 -0
  49. package/doc_build/static/js/async/en_guide_best-practices_components.js +21400 -0
  50. package/doc_build/static/js/async/en_guide_best-practices_components.js.map +1 -0
  51. package/doc_build/static/js/async/en_guide_intro_getting-started.js +1904 -0
  52. package/doc_build/static/js/async/en_guide_intro_getting-started.js.map +1 -0
  53. package/doc_build/static/js/async/en_guide_intro_welcome.js +162 -0
  54. package/doc_build/static/js/async/en_guide_intro_welcome.js.map +1 -0
  55. package/doc_build/static/js/async/en_guide_intro_why-module-engineering-solution.js +96 -0
  56. package/doc_build/static/js/async/en_guide_intro_why-module-engineering-solution.js.map +1 -0
  57. package/doc_build/static/js/async/en_index.js +81 -0
  58. package/doc_build/static/js/async/en_index.js.map +1 -0
  59. package/doc_build/static/js/async/en_plugins_guide_getting-started.js +2556 -0
  60. package/doc_build/static/js/async/en_plugins_guide_getting-started.js.map +1 -0
  61. package/doc_build/static/js/async/en_plugins_guide_plugin-object.js +4173 -0
  62. package/doc_build/static/js/async/en_plugins_guide_plugin-object.js.map +1 -0
  63. package/doc_build/static/js/async/en_plugins_guide_setup-function.js +3815 -0
  64. package/doc_build/static/js/async/en_plugins_guide_setup-function.js.map +1 -0
  65. package/doc_build/static/js/async/en_plugins_official-list_overview.js +66 -0
  66. package/doc_build/static/js/async/en_plugins_official-list_overview.js.map +1 -0
  67. package/doc_build/static/js/async/packages_cli_doc-core_src_theme-default_components_Search_logic_search_ts.js +246 -0
  68. package/doc_build/static/js/async/packages_cli_doc-core_src_theme-default_components_Search_logic_search_ts.js.map +1 -0
  69. 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
  70. 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
  71. package/doc_build/static/js/async/vendors-node_modules_pnpm_flexsearch_0_6_32_node_modules_flexsearch_dist_flexsearch_min_js.js +54 -0
  72. 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
  73. package/doc_build/static/js/async/zh_api_config_build-config.js +11354 -0
  74. package/doc_build/static/js/async/zh_api_config_build-config.js.map +1 -0
  75. package/doc_build/static/js/async/zh_api_config_build-preset.js +7867 -0
  76. package/doc_build/static/js/async/zh_api_config_build-preset.js.map +1 -0
  77. package/doc_build/static/js/async/zh_api_config_design-system.js +48712 -0
  78. package/doc_build/static/js/async/zh_api_config_design-system.js.map +1 -0
  79. package/doc_build/static/js/async/zh_api_config_plugins.js +1488 -0
  80. package/doc_build/static/js/async/zh_api_config_plugins.js.map +1 -0
  81. package/doc_build/static/js/async/zh_api_config_testing.js +2132 -0
  82. package/doc_build/static/js/async/zh_api_config_testing.js.map +1 -0
  83. package/doc_build/static/js/async/zh_api_index.js +52 -0
  84. package/doc_build/static/js/async/zh_api_index.js.map +1 -0
  85. package/doc_build/static/js/async/zh_api_plugin-api_plugin-hooks.js +14392 -0
  86. package/doc_build/static/js/async/zh_api_plugin-api_plugin-hooks.js.map +1 -0
  87. package/doc_build/static/js/async/zh_guide_advance_asset.js +3972 -0
  88. package/doc_build/static/js/async/zh_guide_advance_asset.js.map +1 -0
  89. package/doc_build/static/js/async/zh_guide_advance_build-umd.js +9859 -0
  90. package/doc_build/static/js/async/zh_guide_advance_build-umd.js.map +1 -0
  91. package/doc_build/static/js/async/zh_guide_advance_copy.js +6541 -0
  92. package/doc_build/static/js/async/zh_guide_advance_copy.js.map +1 -0
  93. package/doc_build/static/js/async/zh_guide_advance_external-dependency.js +3808 -0
  94. package/doc_build/static/js/async/zh_guide_advance_external-dependency.js.map +1 -0
  95. package/doc_build/static/js/async/zh_guide_advance_in-depth-about-build.js +5304 -0
  96. package/doc_build/static/js/async/zh_guide_advance_in-depth-about-build.js.map +1 -0
  97. package/doc_build/static/js/async/zh_guide_advance_in-depth-about-dev-command.js +150 -0
  98. package/doc_build/static/js/async/zh_guide_advance_in-depth-about-dev-command.js.map +1 -0
  99. package/doc_build/static/js/async/zh_guide_advance_theme-config.js +2477 -0
  100. package/doc_build/static/js/async/zh_guide_advance_theme-config.js.map +1 -0
  101. package/doc_build/static/js/async/zh_guide_basic_before-getting-started.js +3849 -0
  102. package/doc_build/static/js/async/zh_guide_basic_before-getting-started.js.map +1 -0
  103. package/doc_build/static/js/async/zh_guide_basic_command-preview.js +3805 -0
  104. package/doc_build/static/js/async/zh_guide_basic_command-preview.js.map +1 -0
  105. package/doc_build/static/js/async/zh_guide_basic_modify-output-product.js +3064 -0
  106. package/doc_build/static/js/async/zh_guide_basic_modify-output-product.js.map +1 -0
  107. package/doc_build/static/js/async/zh_guide_basic_publish-your-project.js +2241 -0
  108. package/doc_build/static/js/async/zh_guide_basic_publish-your-project.js.map +1 -0
  109. package/doc_build/static/js/async/zh_guide_basic_test-your-project.js +3887 -0
  110. package/doc_build/static/js/async/zh_guide_basic_test-your-project.js.map +1 -0
  111. package/doc_build/static/js/async/zh_guide_basic_use-micro-generator.js +192 -0
  112. package/doc_build/static/js/async/zh_guide_basic_use-micro-generator.js.map +1 -0
  113. package/doc_build/static/js/async/zh_guide_basic_using-storybook.js +4669 -0
  114. package/doc_build/static/js/async/zh_guide_basic_using-storybook.js.map +1 -0
  115. package/doc_build/static/js/async/zh_guide_best-practices_components.js +21100 -0
  116. package/doc_build/static/js/async/zh_guide_best-practices_components.js.map +1 -0
  117. package/doc_build/static/js/async/zh_guide_intro_getting-started.js +1780 -0
  118. package/doc_build/static/js/async/zh_guide_intro_getting-started.js.map +1 -0
  119. package/doc_build/static/js/async/zh_guide_intro_welcome.js +162 -0
  120. package/doc_build/static/js/async/zh_guide_intro_welcome.js.map +1 -0
  121. package/doc_build/static/js/async/zh_guide_intro_why-module-engineering-solution.js +96 -0
  122. package/doc_build/static/js/async/zh_guide_intro_why-module-engineering-solution.js.map +1 -0
  123. package/doc_build/static/js/async/zh_index.js +81 -0
  124. package/doc_build/static/js/async/zh_index.js.map +1 -0
  125. package/doc_build/static/js/async/zh_plugins_guide_getting-started.js +2604 -0
  126. package/doc_build/static/js/async/zh_plugins_guide_getting-started.js.map +1 -0
  127. package/doc_build/static/js/async/zh_plugins_guide_plugin-object.js +4169 -0
  128. package/doc_build/static/js/async/zh_plugins_guide_plugin-object.js.map +1 -0
  129. package/doc_build/static/js/async/zh_plugins_guide_setup-function.js +3815 -0
  130. package/doc_build/static/js/async/zh_plugins_guide_setup-function.js.map +1 -0
  131. package/doc_build/static/js/async/zh_plugins_official-list_overview.js +66 -0
  132. package/doc_build/static/js/async/zh_plugins_official-list_overview.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 +11847 -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 +8563 -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 +7328 -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/doc_build/static/search_index.json +1 -0
  146. package/docs/.island/dist/404.html +41 -0
  147. package/docs/.island/dist/assets/asset.26aea654.js +160 -0
  148. package/docs/.island/dist/assets/asset.36e3d3c9.js +160 -0
  149. package/docs/.island/dist/assets/before-getting-started.0e863740.js +87 -0
  150. package/docs/.island/dist/assets/before-getting-started.2c6e6b8a.js +87 -0
  151. package/docs/.island/dist/assets/build-config.460d11d9.js +804 -0
  152. package/docs/.island/dist/assets/build-config.e155e534.js +854 -0
  153. package/docs/.island/dist/assets/build-preset.6c2c6c62.js +256 -0
  154. package/docs/.island/dist/assets/build-preset.d3da921d.js +256 -0
  155. package/docs/.island/dist/assets/build-umd.ba00f028.js +264 -0
  156. package/docs/.island/dist/assets/build-umd.edb9d163.js +273 -0
  157. package/docs/.island/dist/assets/command-preview.1dc93921.js +264 -0
  158. package/docs/.island/dist/assets/command-preview.ef7a9d01.js +264 -0
  159. package/docs/.island/dist/assets/components.esm.03560353.js +9 -0
  160. package/docs/.island/dist/assets/copy.28dc4d5f.js +277 -0
  161. package/docs/.island/dist/assets/copy.f4625565.js +277 -0
  162. package/docs/.island/dist/assets/design-system.8993234c.js +1254 -0
  163. package/docs/.island/dist/assets/design-system.b0ba163f.js +639 -0
  164. package/docs/.island/dist/assets/dev.b373b152.js +37 -0
  165. package/docs/.island/dist/assets/dev.b39fd42a.js +37 -0
  166. package/docs/.island/dist/assets/down.f35427d3.svg +1 -0
  167. package/docs/.island/dist/assets/extension.4bf3526b.js +1 -0
  168. package/docs/.island/dist/assets/extension.d64ed0b8.js +469 -0
  169. package/docs/.island/dist/assets/external-dependency.2ede7532.js +156 -0
  170. package/docs/.island/dist/assets/external-dependency.92ca89e0.js +156 -0
  171. package/docs/.island/dist/assets/getting-started.822cf0b2.js +117 -0
  172. package/docs/.island/dist/assets/getting-started.e2764829.js +114 -0
  173. package/docs/.island/dist/assets/github.3bf8ccee.svg +1 -0
  174. package/docs/.island/dist/assets/in-depth-about-build.94cc902d.js +375 -0
  175. package/docs/.island/dist/assets/in-depth-about-build.aa74de10.js +374 -0
  176. package/docs/.island/dist/assets/in-depth-about-dev-command.877bdb83.js +33 -0
  177. package/docs/.island/dist/assets/in-depth-about-dev-command.9736befd.js +39 -0
  178. package/docs/.island/dist/assets/index.01786ba7.js +30 -0
  179. package/docs/.island/dist/assets/index.6cef6f5f.js +4 -0
  180. package/docs/.island/dist/assets/index.cb118238.js +36 -0
  181. package/docs/.island/dist/assets/index.ccb6ce27.js +4 -0
  182. package/docs/.island/dist/assets/island_inject.69495876.js +1 -0
  183. package/docs/.island/dist/assets/island_inject.cdfb22d9.js +1 -0
  184. package/docs/.island/dist/assets/loading.8c9bb911.svg +1 -0
  185. package/docs/.island/dist/assets/modify-output-product.9e2394d7.js +100 -0
  186. package/docs/.island/dist/assets/modify-output-product.f363845a.js +100 -0
  187. package/docs/.island/dist/assets/moon.6b705924.svg +3 -0
  188. package/docs/.island/dist/assets/plugin.70a61997.js +42 -0
  189. package/docs/.island/dist/assets/plugin.80b12ee2.js +42 -0
  190. package/docs/.island/dist/assets/publish-your-project.7321c10e.js +164 -0
  191. package/docs/.island/dist/assets/publish-your-project.7326359f.js +166 -0
  192. package/docs/.island/dist/assets/right.89674cd7.svg +1 -0
  193. package/docs/.island/dist/assets/search.0aea6901.svg +1 -0
  194. package/docs/.island/dist/assets/search.11353245.js +222 -0
  195. package/docs/.island/dist/assets/search.a1b1cff3.js +3 -0
  196. package/docs/.island/dist/assets/search.f9025ced.js +3 -0
  197. package/docs/.island/dist/assets/style.09015a4b.css +1 -0
  198. package/docs/.island/dist/assets/style.2e5f7bc2.css +1970 -0
  199. package/docs/.island/dist/assets/sun.841dac10.svg +11 -0
  200. package/docs/.island/dist/assets/test-your-project.8ab2809e.js +190 -0
  201. package/docs/.island/dist/assets/test-your-project.9ae2a49e.js +190 -0
  202. package/docs/.island/dist/assets/test.2bfe276b.js +66 -0
  203. package/docs/.island/dist/assets/test.a2c00a3f.js +67 -0
  204. package/docs/.island/dist/assets/translator.b1077c44.svg +1 -0
  205. package/docs/.island/dist/assets/use-micro-generator.13c1a09f.js +60 -0
  206. package/docs/.island/dist/assets/use-micro-generator.dfe877f6.js +60 -0
  207. package/docs/.island/dist/assets/using-storybook.adb88cb8.js +260 -0
  208. package/docs/.island/dist/assets/using-storybook.b8e7dd04.js +260 -0
  209. package/docs/.island/dist/assets/welcome.94880043.js +13 -0
  210. package/docs/.island/dist/assets/welcome.b2140e7e.js +13 -0
  211. package/docs/.island/dist/assets/why-module-engineering-solution.bfe7981a.js +26 -0
  212. package/docs/.island/dist/assets/why-module-engineering-solution.e31cd19f.js +26 -0
  213. package/docs/.island/dist/chunk-COLCRJ2V.js +1 -0
  214. package/docs/.island/dist/chunk-K5FMOYDC.js +10 -0
  215. package/docs/.island/dist/chunk-WE42KMYS.js +26 -0
  216. package/docs/.island/dist/client-entry.js +3 -0
  217. package/docs/.island/dist/en/api/build-config.html +344 -0
  218. package/docs/.island/dist/en/api/build-preset.html +82 -0
  219. package/docs/.island/dist/en/api/design-system.html +155 -0
  220. package/docs/.island/dist/en/api/dev.html +45 -0
  221. package/docs/.island/dist/en/api/index.html +41 -0
  222. package/docs/.island/dist/en/api/plugin.html +48 -0
  223. package/docs/.island/dist/en/api/test.html +58 -0
  224. package/docs/.island/dist/en/guide/advance/asset.html +68 -0
  225. package/docs/.island/dist/en/guide/advance/build-umd.html +72 -0
  226. package/docs/.island/dist/en/guide/advance/copy.html +82 -0
  227. package/docs/.island/dist/en/guide/advance/extension.html +41 -0
  228. package/docs/.island/dist/en/guide/advance/external-dependency.html +71 -0
  229. package/docs/.island/dist/en/guide/advance/in-depth-about-build.html +148 -0
  230. package/docs/.island/dist/en/guide/advance/in-depth-about-dev-command.html +51 -0
  231. package/docs/.island/dist/en/guide/basic/before-getting-started.html +127 -0
  232. package/docs/.island/dist/en/guide/basic/command-preview.html +100 -0
  233. package/docs/.island/dist/en/guide/basic/modify-output-product.html +140 -0
  234. package/docs/.island/dist/en/guide/basic/publish-your-project.html +91 -0
  235. package/docs/.island/dist/en/guide/basic/test-your-project.html +72 -0
  236. package/docs/.island/dist/en/guide/basic/use-micro-generator.html +65 -0
  237. package/docs/.island/dist/en/guide/basic/using-storybook.html +113 -0
  238. package/docs/.island/dist/en/guide/intro/getting-started.html +76 -0
  239. package/docs/.island/dist/en/guide/intro/welcome.html +53 -0
  240. package/docs/.island/dist/en/guide/intro/why-module-engineering-solution.html +49 -0
  241. package/docs/.island/dist/en/index.html +42 -0
  242. package/docs/.island/dist/react-dom.js +1 -0
  243. package/docs/.island/dist/react-dom_client.js +1 -0
  244. package/docs/.island/dist/react.js +1 -0
  245. package/docs/.island/dist/react_jsx-runtime.js +10 -0
  246. package/docs/.island/dist/ssr-manifest.json +57 -0
  247. package/docs/.island/dist/test-result.png +0 -0
  248. package/docs/.island/dist/why-module-solution.png +0 -0
  249. package/docs/.island/dist/zh/api/build-config.html +361 -0
  250. package/docs/.island/dist/zh/api/build-preset.html +82 -0
  251. package/docs/.island/dist/zh/api/design-system.html +149 -0
  252. package/docs/.island/dist/zh/api/dev.html +46 -0
  253. package/docs/.island/dist/zh/api/index.html +41 -0
  254. package/docs/.island/dist/zh/api/plugin.html +48 -0
  255. package/docs/.island/dist/zh/api/test.html +59 -0
  256. package/docs/.island/dist/zh/guide/advance/asset.html +68 -0
  257. package/docs/.island/dist/zh/guide/advance/build-umd.html +72 -0
  258. package/docs/.island/dist/zh/guide/advance/copy.html +82 -0
  259. package/docs/.island/dist/zh/guide/advance/extension.html +127 -0
  260. package/docs/.island/dist/zh/guide/advance/external-dependency.html +71 -0
  261. package/docs/.island/dist/zh/guide/advance/in-depth-about-build.html +148 -0
  262. package/docs/.island/dist/zh/guide/advance/in-depth-about-dev-command.html +53 -0
  263. package/docs/.island/dist/zh/guide/basic/before-getting-started.html +127 -0
  264. package/docs/.island/dist/zh/guide/basic/command-preview.html +100 -0
  265. package/docs/.island/dist/zh/guide/basic/modify-output-product.html +140 -0
  266. package/docs/.island/dist/zh/guide/basic/publish-your-project.html +92 -0
  267. package/docs/.island/dist/zh/guide/basic/test-your-project.html +72 -0
  268. package/docs/.island/dist/zh/guide/basic/use-micro-generator.html +65 -0
  269. package/docs/.island/dist/zh/guide/basic/using-storybook.html +114 -0
  270. package/docs/.island/dist/zh/guide/intro/getting-started.html +79 -0
  271. package/docs/.island/dist/zh/guide/intro/welcome.html +53 -0
  272. package/docs/.island/dist/zh/guide/intro/why-module-engineering-solution.html +49 -0
  273. package/docs/.island/dist/zh/index.html +42 -0
  274. package/docs/en/api/config/build-config.md +20 -10
  275. package/docs/en/api/config/build-preset.md +3 -2
  276. package/docs/en/api/config/design-system.md +623 -615
  277. package/docs/en/api/config/plugins.md +2 -2
  278. package/docs/en/api/config/testing.md +2 -1
  279. package/docs/en/api/plugin-api/plugin-hooks.md +1 -1
  280. package/docs/en/guide/advance/asset.mdx +1 -5
  281. package/docs/en/guide/advance/build-umd.mdx +6 -6
  282. package/docs/en/guide/advance/copy.md +5 -5
  283. package/docs/en/guide/advance/external-dependency.mdx +2 -2
  284. package/docs/en/guide/advance/in-depth-about-build.md +21 -20
  285. package/docs/en/guide/advance/in-depth-about-dev-command.md +3 -2
  286. package/docs/en/guide/advance/theme-config.mdx +2 -2
  287. package/docs/en/guide/basic/before-getting-started.md +17 -10
  288. package/docs/en/guide/basic/command-preview.md +4 -4
  289. package/docs/en/guide/basic/modify-output-product.md +65 -68
  290. package/docs/en/guide/basic/publish-your-project.md +4 -4
  291. package/docs/en/guide/basic/test-your-project.mdx +6 -6
  292. package/docs/en/guide/basic/use-micro-generator.md +13 -5
  293. package/docs/en/guide/basic/using-storybook.mdx +4 -14
  294. package/docs/en/guide/best-practices/components.mdx +103 -97
  295. package/docs/en/guide/intro/getting-started.md +3 -3
  296. package/docs/en/index.md +14 -17
  297. package/docs/en/plugins/guide/getting-started.mdx +4 -4
  298. package/docs/en/plugins/guide/plugin-object.mdx +5 -5
  299. package/docs/en/plugins/guide/setup-function.mdx +2 -2
  300. package/docs/zh/api/config/_category_.json +1 -1
  301. package/docs/zh/api/config/build-config.md +33 -10
  302. package/docs/zh/api/config/build-preset.md +3 -2
  303. package/docs/zh/api/config/design-system.md +2 -2
  304. package/docs/zh/api/config/plugins.md +3 -3
  305. package/docs/zh/api/config/testing.md +3 -2
  306. package/docs/zh/api/index.md +1 -0
  307. package/docs/zh/api/plugin-api/_category_.json +1 -1
  308. package/docs/zh/api/plugin-api/plugin-hooks.md +56 -55
  309. package/docs/zh/guide/advance/asset.mdx +1 -6
  310. package/docs/zh/guide/advance/build-umd.mdx +6 -6
  311. package/docs/zh/guide/advance/copy.md +5 -5
  312. package/docs/zh/guide/advance/external-dependency.mdx +3 -3
  313. package/docs/zh/guide/advance/in-depth-about-build.md +21 -20
  314. package/docs/zh/guide/advance/in-depth-about-dev-command.md +3 -2
  315. package/docs/zh/guide/advance/theme-config.mdx +2 -2
  316. package/docs/zh/guide/basic/before-getting-started.md +16 -9
  317. package/docs/zh/guide/basic/command-preview.md +4 -4
  318. package/docs/zh/guide/basic/modify-output-product.md +45 -47
  319. package/docs/zh/guide/basic/publish-your-project.md +4 -4
  320. package/docs/zh/guide/basic/test-your-project.mdx +6 -6
  321. package/docs/zh/guide/basic/use-micro-generator.md +10 -6
  322. package/docs/zh/guide/basic/using-storybook.mdx +12 -20
  323. package/docs/zh/guide/best-practices/components.mdx +10 -10
  324. package/docs/zh/guide/intro/getting-started.md +3 -3
  325. package/docs/zh/index.md +1 -1
  326. package/docs/zh/plugins/guide/getting-started.mdx +5 -5
  327. package/docs/zh/plugins/guide/plugin-object.mdx +5 -5
  328. package/docs/zh/plugins/guide/setup-function.mdx +2 -2
  329. package/modern.config.ts +15 -8
  330. package/package.json +4 -4
@@ -9,9 +9,9 @@ This chapter describes the configuration of the registered module-tools plugin.
9
9
  - type: `Array<ModuleToolsPlugin>`
10
10
 
11
11
  ```js modern.config.ts
12
- import { ExamplePlugin } from '. /plugins/example';
12
+ import { examplePlugin } from '. /plugins/example';
13
13
  export default defineConfig({
14
- plugins: [ExamplePlugin()],
14
+ plugins: [examplePlugin()],
15
15
  });
16
16
  ```
17
17
 
@@ -5,7 +5,8 @@ sidebar_position: 5
5
5
  # Testing
6
6
 
7
7
  This chapter describes the test-related configuration
8
- :::tips
8
+
9
+ :::tip
9
10
  You need to enable the unit testing feature with `pnpm run new` first.
10
11
  :::
11
12
 
@@ -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
 
@@ -18,7 +18,6 @@ For the handling of static files, the module project currently supports the foll
18
18
 
19
19
  - Set the static resource path to `. /assets`.
20
20
  - For files over **10kb** they are inlined into the code.
21
- - Use [SVGR](https://react-svgr.com/) for files with the `.svg` suffix.
22
21
 
23
22
  Let us look at the following example:
24
23
 
@@ -144,6 +143,3 @@ If the size of `bg.png` is larger than 10 kb, then the product content will be.
144
143
 
145
144
  </CH.Spotlight>
146
145
 
147
- ## SVGR
148
-
149
- WIP
@@ -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
 
@@ -164,7 +164,7 @@ console.info(React);
164
164
 
165
165
  At this point we will see the product code like this.
166
166
 
167
- ```js dist/index.js focus=7:12
167
+ ```js dist/index.js focus=12:18
168
168
  (function (global, factory) {
169
169
  if (typeof module === 'object' && typeof module.exports === 'object')
170
170
  factory();
@@ -203,7 +203,7 @@ export default () => {
203
203
 
204
204
  ** By default, the name of the source file is used as the name of the module's global variable in the browser. **For the above example, the product would read as follows:
205
205
 
206
- ```js ./dist/index.js focus=6:6
206
+ ```js ./dist/index.js focus=9:9
207
207
  (function (global, factory) {
208
208
  if (typeof module === 'object' && typeof module.exports === 'object')
209
209
  factory(exports);
@@ -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
 
@@ -233,7 +233,7 @@ export default defineConfig({
233
233
 
234
234
  The construction products at this point are:
235
235
 
236
- ```js ./dist/index.js focus=6:6
236
+ ```js ./dist/index.js focus=9:9
237
237
  (function (global, factory) {
238
238
  if (typeof module === 'object' && typeof module.exports === 'object')
239
239
  factory(exports);
@@ -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,8 +9,9 @@ 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)]
13
- :::
12
+ - [[modify-output-product](/en/guide/basic/modify-output-product)]
13
+
14
+ :::
14
15
 
15
16
  In this chapter we'll dive into the use of certain build configurations and understand what happens when the `modern build` command is executed.
16
17
 
@@ -24,17 +25,17 @@ A Bundle is a package of build products, which may be a single file or multiple
24
25
 
25
26
  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
27
 
27
- In `buildConfig` you can specify whether the current build task is Bundle or Bundleless by using [`buildConfig.buildType`](/en/api/build-config#buildtype).
28
+ 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
29
 
29
30
  ### Relationship between `input` and `sourceDir`
30
31
 
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.
32
+ [`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
33
 
33
34
  - When `buildType: 'bundle'`, `input` defaults to `['src/index.ts']`
34
35
  - When `buildType: 'bundleless'`, `input` defaults to `['src']`
35
36
  > In fact, at `buildType: 'bundle'`, the build tool detects the existence of a file matching the name rule `src/index.(j|t)sx?` and uses it as an entry file.
36
37
 
37
- :::warn{title=notes}
38
+ :::warning{title=notes}
38
39
  It is recommended that you do not specify multiple source file directories during a Bundleless build, as unintended results may occur. Bundleless builds with multiple source directories are currently in an unstable stage.
39
40
  :::
40
41
 
@@ -44,7 +45,7 @@ We know from the defaults: **Bundle builds can generally specify a file path as
44
45
 
45
46
  In addition to setting `input` to an array, you can also set it to an object during the Bundle build process. **By using the object form, we can modify the name of the file that the build product outputs**. So for the following example, `. /src/index.ts` corresponds to the path of the build product file as `. /dist/main.js`.
46
47
 
47
- ```tsx modern.config.ts
48
+ ```js modern.config.ts
48
49
  import { defineConfig } from '@modern-js/module-tools';
49
50
 
50
51
  export default defineConfig({
@@ -61,7 +62,7 @@ The Bundleless build process also supports such use, but it is not recommended.
61
62
 
62
63
  #### `sourceDir`
63
64
 
64
- [`sourceDir`](/en/api/build-config#sourcedir) is used to specify the source code directory, which is related to both.
65
+ [`sourceDir`](/en/api/config/build-config#sourcedir) is used to specify the source code directory, which is related to both.
65
66
 
66
67
  - type file generation
67
68
  - [`outbase`](https://esbuild.github.io/api/#outbase) for specifying the build process
@@ -73,13 +74,13 @@ In general:
73
74
 
74
75
  ### Declaration Type Files
75
76
 
76
- The [`buildConfig.dts`](/en/api/build-config#dts) configuration is mainly used for type file generation.
77
+ The [`buildConfig.dts`](/en/api/config/build-config#dts) configuration is mainly used for type file generation.
77
78
 
78
79
  #### Turn off type generation
79
80
 
80
81
  Type generation is turned on by default, if you need to turn it off, you can configure it as follows:
81
82
 
82
- ```ts ./modern.config.ts
83
+ ```js modern.config.ts
83
84
  import { defineConfig } from '@modern-js/module-tools';
84
85
 
85
86
  export default defineConfig({
@@ -99,14 +100,14 @@ With `buildType: 'bundleless'`, type files are generated using the project's `ts
99
100
 
100
101
  The **module engineering solution also supports packaging of type files**, although care needs to be taken when using this feature.
101
102
 
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).
103
+ - 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
104
  - 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
105
 
105
106
  #### Alias Conversion
106
107
 
107
108
  During the Bundleless build process, if an alias appears in the source code, e.g.
108
109
 
109
- ```ts ./src/index.ts
110
+ ```js ./src/index.ts
110
111
  import utils from '@common/utils';
111
112
  ```
112
113
 
@@ -123,7 +124,7 @@ However, there are some cases that cannot be handled at this time.
123
124
 
124
125
  General usage:
125
126
 
126
- ```ts
127
+ ```js
127
128
  import { defineConfig } from '@modern-js/module-tools';
128
129
 
129
130
  export default defineConfig({
@@ -141,7 +142,7 @@ export default defineConfig({
141
142
 
142
143
  For the use of `dts.only`:
143
144
 
144
- ```ts
145
+ ```js
145
146
  import { defineConfig } from '@modern-js/module-tools';
146
147
 
147
148
  export default defineConfig({
@@ -165,11 +166,11 @@ export default defineConfig({
165
166
 
166
167
  ### `buildConfig.define` Usage for different scenarios
167
168
 
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.
169
+ [`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
170
 
170
171
  #### Environment variable replacement
171
172
 
172
- ```ts
173
+ ```js
173
174
  import { defineConfig } from '@modern-js/module-tools';
174
175
  export default defineConfig({
175
176
  buildConfig: {
@@ -182,21 +183,21 @@ export default defineConfig({
182
183
 
183
184
  With the above configuration, we can put the following code.
184
185
 
185
- ```
186
+ ```js
186
187
  // pre-compiler code
187
188
  console.log(process.env.VERSION);
188
189
  ```
189
190
 
190
191
  When executing `VERSION=1.0.0 modern build`, the conversion is:
191
192
 
192
- ```
193
+ ```js
193
194
  // compiled code
194
195
  console.log('1.0.0');
195
196
  ```
196
197
 
197
198
  #### Global variable replacement
198
199
 
199
- ```ts
200
+ ```js
200
201
  import { defineConfig } from '@modern-js/module-tools';
201
202
  export default defineConfig({
202
203
  buildConfig: {
@@ -209,14 +210,14 @@ export default defineConfig({
209
210
 
210
211
  With the above configuration, we can put the following code.
211
212
 
212
- ```
213
+ ```js
213
214
  // pre-compile code
214
215
  console.log(VERSION);
215
216
  ```
216
217
 
217
218
  Convert to:
218
219
 
219
- ```
220
+ ```js
220
221
  // post-compile code
221
222
  console.log('1.0.0');
222
223
  ```
@@ -9,8 +9,9 @@ sidebar_position: 2
9
9
  :::tip{title=注意}
10
10
  如果你还不清楚 `buildConfig` 是什么,建议花一些时间通过下面的链接了解一下:
11
11
 
12
- - 【[修改输出产物](/zh/guide/modify-output-product)】
13
- :::
12
+ - 【[修改输出产物](/guide/basic/modify-output-product)】
13
+
14
+ :::
14
15
 
15
16
  而在本章里我们将要深入理解某些构建配置的使用以及了解执行 `modern build` 命令的时候发生了什么。
16
17
 
@@ -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.
@@ -6,7 +6,7 @@ sidebar_position: 1
6
6
 
7
7
  ## Environment preparation
8
8
 
9
- In order to use the Modern.js module engineering solution, you first need [NodeJS](https://nodejs.org/zh/) engine, we recommend the latest [LTS version](https://github.com/nodejs/Release), and make sure the Node version is **>=14.17.6**. because non-stable NodeJS releases frequently have bugs. You might consider installing via [nvm-windows](https://github.com/coreybutler/nvm-windows) and [nvm](https://github.com/nvm-sh/nvm) (Mac/linux), so you can easily switch to different NodeJS versions that might be required for different projects that you work on.
9
+ In order to use the Modern.js module engineering solution, you first need [NodeJS](https://nodejs.org/zh/) engine, we recommend the latest [LTS version](https://github.com/nodejs/Release), and make sure the Node version is **>=14.18.0**. because non-stable NodeJS releases frequently have bugs. You might consider installing via [nvm-windows](https://github.com/coreybutler/nvm-windows) and [nvm](https://github.com/nvm-sh/nvm) (Mac/linux), so you can easily switch to different NodeJS versions that might be required for different projects that you work on.
10
10
 
11
11
  ## Getting Started with npm
12
12
 
@@ -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
 
@@ -71,6 +71,7 @@ Similarly, you can install **only packages needed for local development and test
71
71
  ```
72
72
 
73
73
  **When installing or using third-party npm packages be sure to determine what they are for and whether they should be placed in `"dependencies"` or `"devDependencies"` by distinguishing between their types.**
74
+
74
75
  :::tip
75
76
  In general, packages that need to be used in source code are `dependencies` dependencies. Unless you are exporting dependent code locally via packaging, in which case it can be treated as a `devDependencies` dependency.
76
77
  :::
@@ -161,25 +162,31 @@ npm install -g pnpm
161
162
 
162
163
  ## Module Tools configuration file
163
164
 
164
- A configuration file for Module Tools is provided in the initial module project directory -- `modern.config.(j|t)s`. By default, no configuration is required, so the `modern.config` configuration file is not required to exist.
165
+ The Module Tools configuration file - `modern.config.(j|t)s` - is provided in the project directory of the module project created with `@modern-js/create`. However, the `modern.config` configuration file is not required to exist.
165
166
 
166
- The contents of the initial configuration file are as follows.
167
+ By default, the contents of the generated configuration file are as follows.
167
168
 
168
169
  ```typescript
169
170
  // modern.config.ts
170
- import { defineConfig } from '@modern-js/module-tools';
171
+ import moduleTools, { defineConfig } from '@modern-js/module-tools';
171
172
 
172
- export default defineConfig({});
173
+ export default defineConfig({
174
+ plugins: [moduleTools()],
175
+ buildPreset: 'npm-library',
176
+ });
173
177
  ```
174
178
 
175
179
  ```js
176
180
  // modern.config.js
177
- const { defineConfig } = require('@modern-js/module-tools');
181
+ import moduleTools from '@modern-js/module-tools';
178
182
 
179
- module.exports = defineConfig({});
183
+ export default {
184
+ plugins: [moduleTools()],
185
+ buildPreset: 'npm-library',
186
+ };
180
187
  ```
181
188
 
182
- **We recommend using the `defineConfig` function**, but it is not mandatory to use it. So you can also return an object directly in the configuration file: the:
189
+ **We recommend using the `defineConfig` function**, but it is not mandatory to use it. So you can also return an object directly in the config file: the
183
190
 
184
191
  ```typescript
185
192
  // modern.config.ts
@@ -188,5 +195,5 @@ export default {};
188
195
 
189
196
  ```js
190
197
  // modern.config.js
191
- module.exports = {};
198
+ export default {};
192
199
  ```
@@ -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
 
@@ -55,11 +55,12 @@ The `modern new` command is used to start the microgenerator functionality, whic
55
55
 
56
56
  The following features can currently be enabled.
57
57
 
58
+ - Testing support
58
59
  - Storybook debugging
59
60
  - Tailwind CSS support
60
61
  - Modern.js Runtime API
61
62
 
62
- You can learn more about these features in the [Using the micro generator](/zh/guide/use-micro-generator) section.
63
+ You can learn more about these features in the [Using the micro generator](/guide/basic/use-micro-generator) section.
63
64
 
64
65
  ## `modern dev`
65
66
 
@@ -88,6 +89,7 @@ Options:
88
89
  -h, --help display help for command
89
90
  ```
90
91
 
92
+ You need to execute `modern new` to turn on the test function before you can execute the `modern test` command.
91
93
  The `modern test` command will automatically run the `src/tests/*.test.(js|ts|jsx|tsx)` file as a test case.
92
94
 
93
95
  ## `modern lint`
@@ -204,5 +206,3 @@ Options:
204
206
  The `modern upgrade` command is used to upgrade the project Modern.js related dependencies to the latest version.
205
207
 
206
208
  Executing the command `npx modern upgrade` in the project root directory will update the Modern.js dependencies in `package.json` of the currently executing project to the latest version by default.
207
-
208
- command is provided in `@modern-js/module-tools` version **>= 1.17.0**, previous versions can be upgraded using `npx @modern-js/upgrade`.