@modern-js/module-tools-docs 2.0.2 → 2.2.0-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 (308) hide show
  1. package/doc_build/html/main/index.html +1 -1
  2. package/doc_build/static/css/main.css +267 -660
  3. package/doc_build/static/css/main.css.map +1 -1
  4. 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 +6 -23
  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.map +1 -1
  6. package/doc_build/static/js/async/en_api_config_build-config.js +79 -36
  7. package/doc_build/static/js/async/en_api_config_build-config.js.map +1 -1
  8. package/doc_build/static/js/async/en_api_config_build-preset.js +40 -20
  9. package/doc_build/static/js/async/en_api_config_build-preset.js.map +1 -1
  10. package/doc_build/static/js/async/en_api_config_design-system.js +33800 -2340
  11. package/doc_build/static/js/async/en_api_config_design-system.js.map +1 -1
  12. package/doc_build/static/js/async/en_api_config_plugins.js +15 -19
  13. package/doc_build/static/js/async/en_api_config_testing.js +26 -24
  14. package/doc_build/static/js/async/en_api_config_testing.js.map +1 -1
  15. package/doc_build/static/js/async/{en_api_.js → en_api_index.js} +10 -14
  16. package/doc_build/static/js/async/en_api_index.js.map +1 -0
  17. package/doc_build/static/js/async/en_api_plugin-api_plugin-hooks.js +24 -26
  18. package/doc_build/static/js/async/en_api_plugin-api_plugin-hooks.js.map +1 -1
  19. package/doc_build/static/js/async/en_guide_advance_asset.js +16 -41
  20. package/doc_build/static/js/async/en_guide_advance_asset.js.map +1 -1
  21. package/doc_build/static/js/async/en_guide_advance_build-umd.js +20 -24
  22. package/doc_build/static/js/async/en_guide_advance_copy.js +25 -23
  23. package/doc_build/static/js/async/en_guide_advance_copy.js.map +1 -1
  24. package/doc_build/static/js/async/en_guide_advance_external-dependency.js +15 -19
  25. package/doc_build/static/js/async/en_guide_advance_in-depth-about-build.js +352 -94
  26. package/doc_build/static/js/async/en_guide_advance_in-depth-about-build.js.map +1 -1
  27. package/doc_build/static/js/async/en_guide_advance_in-depth-about-dev-command.js +11 -15
  28. package/doc_build/static/js/async/en_guide_advance_in-depth-about-dev-command.js.map +1 -1
  29. package/doc_build/static/js/async/en_guide_advance_theme-config.js +26 -24
  30. package/doc_build/static/js/async/en_guide_advance_theme-config.js.map +1 -1
  31. package/doc_build/static/js/async/en_guide_basic_before-getting-started.js +275 -88
  32. package/doc_build/static/js/async/en_guide_basic_before-getting-started.js.map +1 -1
  33. package/doc_build/static/js/async/en_guide_basic_command-preview.js +45 -33
  34. package/doc_build/static/js/async/en_guide_basic_command-preview.js.map +1 -1
  35. package/doc_build/static/js/async/en_guide_basic_modify-output-product.js +274 -196
  36. package/doc_build/static/js/async/en_guide_basic_modify-output-product.js.map +1 -1
  37. package/doc_build/static/js/async/en_guide_basic_publish-your-project.js +18 -20
  38. package/doc_build/static/js/async/en_guide_basic_publish-your-project.js.map +1 -1
  39. package/doc_build/static/js/async/en_guide_basic_test-your-project.js +27 -32
  40. package/doc_build/static/js/async/en_guide_basic_test-your-project.js.map +1 -1
  41. package/doc_build/static/js/async/en_guide_basic_use-micro-generator.js +33 -15
  42. package/doc_build/static/js/async/en_guide_basic_use-micro-generator.js.map +1 -1
  43. package/doc_build/static/js/async/en_guide_basic_using-storybook.js +24 -63
  44. package/doc_build/static/js/async/en_guide_basic_using-storybook.js.map +1 -1
  45. package/doc_build/static/js/async/en_guide_best-practices_components.js +39 -27
  46. package/doc_build/static/js/async/en_guide_best-practices_components.js.map +1 -1
  47. package/doc_build/static/js/async/en_guide_intro_getting-started.js +288 -45
  48. package/doc_build/static/js/async/en_guide_intro_getting-started.js.map +1 -1
  49. package/doc_build/static/js/async/en_guide_intro_welcome.js +27 -13
  50. package/doc_build/static/js/async/en_guide_intro_welcome.js.map +1 -1
  51. package/doc_build/static/js/async/en_guide_intro_why-module-engineering-solution.js +16 -12
  52. package/doc_build/static/js/async/en_guide_intro_why-module-engineering-solution.js.map +1 -1
  53. package/doc_build/static/js/async/{en_.js → en_index.js} +12 -16
  54. package/doc_build/static/js/async/en_index.js.map +1 -0
  55. package/doc_build/static/js/async/en_plugins_guide_getting-started.js +17 -21
  56. package/doc_build/static/js/async/en_plugins_guide_plugin-object.js +20 -24
  57. package/doc_build/static/js/async/en_plugins_guide_setup-function.js +19 -23
  58. package/doc_build/static/js/async/en_plugins_guide_setup-function.js.map +1 -1
  59. package/doc_build/static/js/async/en_plugins_official-list_overview.js +8 -12
  60. package/doc_build/static/js/async/packages_cli_doc-core_src_theme-default_components_Search_logic_search_ts.js +166 -367
  61. package/doc_build/static/js/async/packages_cli_doc-core_src_theme-default_components_Search_logic_search_ts.js.map +1 -1
  62. package/doc_build/static/js/async/{api_config_build-config.js → zh_api_config_build-config.js} +80 -35
  63. package/doc_build/static/js/async/{api_config_build-config.js.map → zh_api_config_build-config.js.map} +1 -1
  64. package/doc_build/static/js/async/{api_config_build-preset.js → zh_api_config_build-preset.js} +39 -21
  65. package/doc_build/static/js/async/{api_config_build-preset.js.map → zh_api_config_build-preset.js.map} +1 -1
  66. package/doc_build/static/js/async/{api_config_design-system.js → zh_api_config_design-system.js} +27 -23
  67. package/doc_build/static/js/async/{api_config_design-system.js.map → zh_api_config_design-system.js.map} +1 -1
  68. package/doc_build/static/js/async/{api_config_plugins.js → zh_api_config_plugins.js} +17 -21
  69. package/doc_build/static/js/async/{api_config_plugins.js.map → zh_api_config_plugins.js.map} +1 -1
  70. package/doc_build/static/js/async/{api_config_testing.js → zh_api_config_testing.js} +28 -26
  71. package/doc_build/static/js/async/{api_config_testing.js.map → zh_api_config_testing.js.map} +1 -1
  72. package/doc_build/static/js/async/{api_.js → zh_api_index.js} +10 -14
  73. package/doc_build/static/js/async/zh_api_index.js.map +1 -0
  74. package/doc_build/static/js/async/{api_plugin-api_plugin-hooks.js → zh_api_plugin-api_plugin-hooks.js} +25 -27
  75. package/doc_build/static/js/async/{api_plugin-api_plugin-hooks.js.map → zh_api_plugin-api_plugin-hooks.js.map} +1 -1
  76. package/doc_build/static/js/async/{guide_advance_asset.js → zh_guide_advance_asset.js} +18 -43
  77. package/doc_build/static/js/async/{guide_advance_asset.js.map → zh_guide_advance_asset.js.map} +1 -1
  78. package/doc_build/static/js/async/{guide_advance_build-umd.js → zh_guide_advance_build-umd.js} +22 -26
  79. package/doc_build/static/js/async/{guide_advance_build-umd.js.map → zh_guide_advance_build-umd.js.map} +1 -1
  80. package/doc_build/static/js/async/{guide_advance_copy.js → zh_guide_advance_copy.js} +26 -24
  81. package/doc_build/static/js/async/{guide_advance_copy.js.map → zh_guide_advance_copy.js.map} +1 -1
  82. package/doc_build/static/js/async/{guide_advance_external-dependency.js → zh_guide_advance_external-dependency.js} +17 -21
  83. package/doc_build/static/js/async/{guide_advance_external-dependency.js.map → zh_guide_advance_external-dependency.js.map} +1 -1
  84. package/doc_build/static/js/async/{guide_advance_in-depth-about-build.js → zh_guide_advance_in-depth-about-build.js} +353 -95
  85. package/doc_build/static/js/async/{guide_advance_in-depth-about-build.js.map → zh_guide_advance_in-depth-about-build.js.map} +1 -1
  86. package/doc_build/static/js/async/{guide_advance_in-depth-about-dev-command.js → zh_guide_advance_in-depth-about-dev-command.js} +16 -18
  87. package/doc_build/static/js/async/zh_guide_advance_in-depth-about-dev-command.js.map +1 -0
  88. package/doc_build/static/js/async/{guide_advance_theme-config.js → zh_guide_advance_theme-config.js} +24 -22
  89. package/doc_build/static/js/async/{guide_advance_theme-config.js.map → zh_guide_advance_theme-config.js.map} +1 -1
  90. package/doc_build/static/js/async/{guide_basic_before-getting-started.js → zh_guide_basic_before-getting-started.js} +272 -85
  91. package/doc_build/static/js/async/zh_guide_basic_before-getting-started.js.map +1 -0
  92. package/doc_build/static/js/async/{guide_basic_command-preview.js → zh_guide_basic_command-preview.js} +47 -35
  93. package/doc_build/static/js/async/zh_guide_basic_command-preview.js.map +1 -0
  94. package/doc_build/static/js/async/{guide_basic_modify-output-product.js → zh_guide_basic_modify-output-product.js} +203 -88
  95. package/doc_build/static/js/async/zh_guide_basic_modify-output-product.js.map +1 -0
  96. package/doc_build/static/js/async/{guide_basic_publish-your-project.js → zh_guide_basic_publish-your-project.js} +20 -22
  97. package/doc_build/static/js/async/{guide_basic_publish-your-project.js.map → zh_guide_basic_publish-your-project.js.map} +1 -1
  98. package/doc_build/static/js/async/{guide_basic_test-your-project.js → zh_guide_basic_test-your-project.js} +30 -35
  99. package/doc_build/static/js/async/{guide_basic_test-your-project.js.map → zh_guide_basic_test-your-project.js.map} +1 -1
  100. package/doc_build/static/js/async/{guide_basic_use-micro-generator.js → zh_guide_basic_use-micro-generator.js} +40 -20
  101. package/doc_build/static/js/async/zh_guide_basic_use-micro-generator.js.map +1 -0
  102. package/doc_build/static/js/async/{guide_basic_using-storybook.js → zh_guide_basic_using-storybook.js} +78 -171
  103. package/doc_build/static/js/async/{guide_basic_using-storybook.js.map → zh_guide_basic_using-storybook.js.map} +1 -1
  104. package/doc_build/static/js/async/{guide_best-practices_components.js → zh_guide_best-practices_components.js} +41 -29
  105. package/doc_build/static/js/async/{guide_best-practices_components.js.map → zh_guide_best-practices_components.js.map} +1 -1
  106. package/doc_build/static/js/async/{guide_intro_getting-started.js → zh_guide_intro_getting-started.js} +291 -42
  107. package/doc_build/static/js/async/{guide_intro_getting-started.js.map → zh_guide_intro_getting-started.js.map} +1 -1
  108. package/doc_build/static/js/async/{guide_intro_welcome.js → zh_guide_intro_welcome.js} +28 -14
  109. package/doc_build/static/js/async/zh_guide_intro_welcome.js.map +1 -0
  110. package/doc_build/static/js/async/{guide_intro_why-module-engineering-solution.js → zh_guide_intro_why-module-engineering-solution.js} +18 -14
  111. package/doc_build/static/js/async/zh_guide_intro_why-module-engineering-solution.js.map +1 -0
  112. package/doc_build/static/js/async/{index.js → zh_index.js} +11 -15
  113. package/doc_build/static/js/async/zh_index.js.map +1 -0
  114. package/doc_build/static/js/async/{plugins_guide_getting-started.js → zh_plugins_guide_getting-started.js} +19 -23
  115. package/doc_build/static/js/async/{plugins_guide_getting-started.js.map → zh_plugins_guide_getting-started.js.map} +1 -1
  116. package/doc_build/static/js/async/{plugins_guide_plugin-object.js → zh_plugins_guide_plugin-object.js} +22 -26
  117. package/doc_build/static/js/async/{plugins_guide_plugin-object.js.map → zh_plugins_guide_plugin-object.js.map} +1 -1
  118. package/doc_build/static/js/async/{plugins_guide_setup-function.js → zh_plugins_guide_setup-function.js} +21 -25
  119. package/doc_build/static/js/async/{plugins_guide_setup-function.js.map → zh_plugins_guide_setup-function.js.map} +1 -1
  120. package/doc_build/static/js/async/{plugins_official-list_overview.js → zh_plugins_official-list_overview.js} +10 -14
  121. package/doc_build/static/js/async/zh_plugins_official-list_overview.js.map +1 -0
  122. package/doc_build/static/js/builder-runtime.js +1 -1
  123. package/doc_build/static/js/builder-runtime.js.map +1 -1
  124. package/doc_build/static/js/lib-polyfill.js +3433 -16355
  125. package/doc_build/static/js/lib-polyfill.js.map +1 -1
  126. package/doc_build/static/js/main.js +2073 -2700
  127. package/doc_build/static/js/main.js.map +1 -1
  128. 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 +485 -1689
  129. 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 -1
  130. package/doc_build/static/search_index.json +1 -0
  131. package/docs/.island/dist/404.html +41 -0
  132. package/docs/.island/dist/assets/asset.26aea654.js +160 -0
  133. package/docs/.island/dist/assets/asset.36e3d3c9.js +160 -0
  134. package/docs/.island/dist/assets/before-getting-started.0e863740.js +87 -0
  135. package/docs/.island/dist/assets/before-getting-started.2c6e6b8a.js +87 -0
  136. package/docs/.island/dist/assets/build-config.460d11d9.js +804 -0
  137. package/docs/.island/dist/assets/build-config.e155e534.js +854 -0
  138. package/docs/.island/dist/assets/build-preset.6c2c6c62.js +256 -0
  139. package/docs/.island/dist/assets/build-preset.d3da921d.js +256 -0
  140. package/docs/.island/dist/assets/build-umd.ba00f028.js +264 -0
  141. package/docs/.island/dist/assets/build-umd.edb9d163.js +273 -0
  142. package/docs/.island/dist/assets/command-preview.1dc93921.js +264 -0
  143. package/docs/.island/dist/assets/command-preview.ef7a9d01.js +264 -0
  144. package/docs/.island/dist/assets/components.esm.03560353.js +9 -0
  145. package/docs/.island/dist/assets/copy.28dc4d5f.js +277 -0
  146. package/docs/.island/dist/assets/copy.f4625565.js +277 -0
  147. package/docs/.island/dist/assets/design-system.8993234c.js +1254 -0
  148. package/docs/.island/dist/assets/design-system.b0ba163f.js +639 -0
  149. package/docs/.island/dist/assets/dev.b373b152.js +37 -0
  150. package/docs/.island/dist/assets/dev.b39fd42a.js +37 -0
  151. package/docs/.island/dist/assets/down.f35427d3.svg +1 -0
  152. package/docs/.island/dist/assets/extension.4bf3526b.js +1 -0
  153. package/docs/.island/dist/assets/extension.d64ed0b8.js +469 -0
  154. package/docs/.island/dist/assets/external-dependency.2ede7532.js +156 -0
  155. package/docs/.island/dist/assets/external-dependency.92ca89e0.js +156 -0
  156. package/docs/.island/dist/assets/getting-started.822cf0b2.js +117 -0
  157. package/docs/.island/dist/assets/getting-started.e2764829.js +114 -0
  158. package/docs/.island/dist/assets/github.3bf8ccee.svg +1 -0
  159. package/docs/.island/dist/assets/in-depth-about-build.94cc902d.js +375 -0
  160. package/docs/.island/dist/assets/in-depth-about-build.aa74de10.js +374 -0
  161. package/docs/.island/dist/assets/in-depth-about-dev-command.877bdb83.js +33 -0
  162. package/docs/.island/dist/assets/in-depth-about-dev-command.9736befd.js +39 -0
  163. package/docs/.island/dist/assets/index.01786ba7.js +30 -0
  164. package/docs/.island/dist/assets/index.6cef6f5f.js +4 -0
  165. package/docs/.island/dist/assets/index.cb118238.js +36 -0
  166. package/docs/.island/dist/assets/index.ccb6ce27.js +4 -0
  167. package/docs/.island/dist/assets/island_inject.69495876.js +1 -0
  168. package/docs/.island/dist/assets/island_inject.cdfb22d9.js +1 -0
  169. package/docs/.island/dist/assets/loading.8c9bb911.svg +1 -0
  170. package/docs/.island/dist/assets/modify-output-product.9e2394d7.js +100 -0
  171. package/docs/.island/dist/assets/modify-output-product.f363845a.js +100 -0
  172. package/docs/.island/dist/assets/moon.6b705924.svg +3 -0
  173. package/docs/.island/dist/assets/plugin.70a61997.js +42 -0
  174. package/docs/.island/dist/assets/plugin.80b12ee2.js +42 -0
  175. package/docs/.island/dist/assets/publish-your-project.7321c10e.js +164 -0
  176. package/docs/.island/dist/assets/publish-your-project.7326359f.js +166 -0
  177. package/docs/.island/dist/assets/right.89674cd7.svg +1 -0
  178. package/docs/.island/dist/assets/search.0aea6901.svg +1 -0
  179. package/docs/.island/dist/assets/search.11353245.js +222 -0
  180. package/docs/.island/dist/assets/search.a1b1cff3.js +3 -0
  181. package/docs/.island/dist/assets/search.f9025ced.js +3 -0
  182. package/docs/.island/dist/assets/style.09015a4b.css +1 -0
  183. package/docs/.island/dist/assets/style.2e5f7bc2.css +1970 -0
  184. package/docs/.island/dist/assets/sun.841dac10.svg +11 -0
  185. package/docs/.island/dist/assets/test-your-project.8ab2809e.js +190 -0
  186. package/docs/.island/dist/assets/test-your-project.9ae2a49e.js +190 -0
  187. package/docs/.island/dist/assets/test.2bfe276b.js +66 -0
  188. package/docs/.island/dist/assets/test.a2c00a3f.js +67 -0
  189. package/docs/.island/dist/assets/translator.b1077c44.svg +1 -0
  190. package/docs/.island/dist/assets/use-micro-generator.13c1a09f.js +60 -0
  191. package/docs/.island/dist/assets/use-micro-generator.dfe877f6.js +60 -0
  192. package/docs/.island/dist/assets/using-storybook.adb88cb8.js +260 -0
  193. package/docs/.island/dist/assets/using-storybook.b8e7dd04.js +260 -0
  194. package/docs/.island/dist/assets/welcome.94880043.js +13 -0
  195. package/docs/.island/dist/assets/welcome.b2140e7e.js +13 -0
  196. package/docs/.island/dist/assets/why-module-engineering-solution.bfe7981a.js +26 -0
  197. package/docs/.island/dist/assets/why-module-engineering-solution.e31cd19f.js +26 -0
  198. package/docs/.island/dist/chunk-COLCRJ2V.js +1 -0
  199. package/docs/.island/dist/chunk-K5FMOYDC.js +10 -0
  200. package/docs/.island/dist/chunk-WE42KMYS.js +26 -0
  201. package/docs/.island/dist/client-entry.js +3 -0
  202. package/docs/.island/dist/en/api/build-config.html +344 -0
  203. package/docs/.island/dist/en/api/build-preset.html +82 -0
  204. package/docs/.island/dist/en/api/design-system.html +155 -0
  205. package/docs/.island/dist/en/api/dev.html +45 -0
  206. package/docs/.island/dist/en/api/index.html +41 -0
  207. package/docs/.island/dist/en/api/plugin.html +48 -0
  208. package/docs/.island/dist/en/api/test.html +58 -0
  209. package/docs/.island/dist/en/guide/advance/asset.html +68 -0
  210. package/docs/.island/dist/en/guide/advance/build-umd.html +72 -0
  211. package/docs/.island/dist/en/guide/advance/copy.html +82 -0
  212. package/docs/.island/dist/en/guide/advance/extension.html +41 -0
  213. package/docs/.island/dist/en/guide/advance/external-dependency.html +71 -0
  214. package/docs/.island/dist/en/guide/advance/in-depth-about-build.html +148 -0
  215. package/docs/.island/dist/en/guide/advance/in-depth-about-dev-command.html +51 -0
  216. package/docs/.island/dist/en/guide/basic/before-getting-started.html +127 -0
  217. package/docs/.island/dist/en/guide/basic/command-preview.html +100 -0
  218. package/docs/.island/dist/en/guide/basic/modify-output-product.html +140 -0
  219. package/docs/.island/dist/en/guide/basic/publish-your-project.html +91 -0
  220. package/docs/.island/dist/en/guide/basic/test-your-project.html +72 -0
  221. package/docs/.island/dist/en/guide/basic/use-micro-generator.html +65 -0
  222. package/docs/.island/dist/en/guide/basic/using-storybook.html +113 -0
  223. package/docs/.island/dist/en/guide/intro/getting-started.html +76 -0
  224. package/docs/.island/dist/en/guide/intro/welcome.html +53 -0
  225. package/docs/.island/dist/en/guide/intro/why-module-engineering-solution.html +49 -0
  226. package/docs/.island/dist/en/index.html +42 -0
  227. package/docs/.island/dist/react-dom.js +1 -0
  228. package/docs/.island/dist/react-dom_client.js +1 -0
  229. package/docs/.island/dist/react.js +1 -0
  230. package/docs/.island/dist/react_jsx-runtime.js +10 -0
  231. package/docs/.island/dist/ssr-manifest.json +57 -0
  232. package/docs/.island/dist/test-result.png +0 -0
  233. package/docs/.island/dist/why-module-solution.png +0 -0
  234. package/docs/.island/dist/zh/api/build-config.html +361 -0
  235. package/docs/.island/dist/zh/api/build-preset.html +82 -0
  236. package/docs/.island/dist/zh/api/design-system.html +149 -0
  237. package/docs/.island/dist/zh/api/dev.html +46 -0
  238. package/docs/.island/dist/zh/api/index.html +41 -0
  239. package/docs/.island/dist/zh/api/plugin.html +48 -0
  240. package/docs/.island/dist/zh/api/test.html +59 -0
  241. package/docs/.island/dist/zh/guide/advance/asset.html +68 -0
  242. package/docs/.island/dist/zh/guide/advance/build-umd.html +72 -0
  243. package/docs/.island/dist/zh/guide/advance/copy.html +82 -0
  244. package/docs/.island/dist/zh/guide/advance/extension.html +127 -0
  245. package/docs/.island/dist/zh/guide/advance/external-dependency.html +71 -0
  246. package/docs/.island/dist/zh/guide/advance/in-depth-about-build.html +148 -0
  247. package/docs/.island/dist/zh/guide/advance/in-depth-about-dev-command.html +53 -0
  248. package/docs/.island/dist/zh/guide/basic/before-getting-started.html +127 -0
  249. package/docs/.island/dist/zh/guide/basic/command-preview.html +100 -0
  250. package/docs/.island/dist/zh/guide/basic/modify-output-product.html +140 -0
  251. package/docs/.island/dist/zh/guide/basic/publish-your-project.html +92 -0
  252. package/docs/.island/dist/zh/guide/basic/test-your-project.html +72 -0
  253. package/docs/.island/dist/zh/guide/basic/use-micro-generator.html +65 -0
  254. package/docs/.island/dist/zh/guide/basic/using-storybook.html +114 -0
  255. package/docs/.island/dist/zh/guide/intro/getting-started.html +79 -0
  256. package/docs/.island/dist/zh/guide/intro/welcome.html +53 -0
  257. package/docs/.island/dist/zh/guide/intro/why-module-engineering-solution.html +49 -0
  258. package/docs/.island/dist/zh/index.html +42 -0
  259. package/docs/en/api/config/build-config.md +15 -5
  260. package/docs/en/api/config/build-preset.md +3 -2
  261. package/docs/en/api/config/design-system.md +623 -615
  262. package/docs/en/api/config/plugins.md +2 -2
  263. package/docs/en/api/config/testing.md +2 -1
  264. package/docs/en/guide/advance/asset.mdx +0 -4
  265. package/docs/en/guide/advance/build-umd.mdx +3 -3
  266. package/docs/en/guide/advance/in-depth-about-build.md +14 -13
  267. package/docs/en/guide/advance/in-depth-about-dev-command.md +2 -1
  268. package/docs/en/guide/basic/before-getting-started.md +16 -9
  269. package/docs/en/guide/basic/command-preview.md +2 -2
  270. package/docs/en/guide/basic/modify-output-product.md +65 -69
  271. package/docs/en/guide/basic/test-your-project.mdx +1 -3
  272. package/docs/en/guide/basic/use-micro-generator.md +4 -0
  273. package/docs/en/guide/basic/using-storybook.mdx +1 -13
  274. package/docs/en/guide/intro/getting-started.md +16 -7
  275. package/docs/en/plugins/guide/getting-started.mdx +2 -2
  276. package/docs/en/plugins/guide/plugin-object.mdx +5 -5
  277. package/docs/zh/api/config/build-config.md +18 -6
  278. package/docs/zh/api/config/build-preset.md +3 -2
  279. package/docs/zh/api/config/design-system.md +2 -2
  280. package/docs/zh/api/config/plugins.md +2 -2
  281. package/docs/zh/api/config/testing.md +3 -2
  282. package/docs/zh/guide/advance/asset.mdx +0 -5
  283. package/docs/zh/guide/advance/build-umd.mdx +3 -3
  284. package/docs/zh/guide/advance/in-depth-about-build.md +14 -13
  285. package/docs/zh/guide/advance/in-depth-about-dev-command.md +2 -1
  286. package/docs/zh/guide/basic/before-getting-started.md +15 -8
  287. package/docs/zh/guide/basic/command-preview.md +2 -2
  288. package/docs/zh/guide/basic/modify-output-product.md +17 -19
  289. package/docs/zh/guide/basic/test-your-project.mdx +1 -3
  290. package/docs/zh/guide/basic/use-micro-generator.md +5 -1
  291. package/docs/zh/guide/basic/using-storybook.mdx +9 -19
  292. package/docs/zh/guide/intro/getting-started.md +17 -11
  293. package/docs/zh/plugins/guide/getting-started.mdx +2 -2
  294. package/docs/zh/plugins/guide/plugin-object.mdx +5 -5
  295. package/modern.config.ts +11 -5
  296. package/package.json +4 -4
  297. package/doc_build/static/js/async/api_.js.map +0 -1
  298. package/doc_build/static/js/async/en_.js.map +0 -1
  299. package/doc_build/static/js/async/en_api_.js.map +0 -1
  300. package/doc_build/static/js/async/guide_advance_in-depth-about-dev-command.js.map +0 -1
  301. package/doc_build/static/js/async/guide_basic_before-getting-started.js.map +0 -1
  302. package/doc_build/static/js/async/guide_basic_command-preview.js.map +0 -1
  303. package/doc_build/static/js/async/guide_basic_modify-output-product.js.map +0 -1
  304. package/doc_build/static/js/async/guide_basic_use-micro-generator.js.map +0 -1
  305. package/doc_build/static/js/async/guide_intro_welcome.js.map +0 -1
  306. package/doc_build/static/js/async/guide_intro_why-module-engineering-solution.js.map +0 -1
  307. package/doc_build/static/js/async/index.js.map +0 -1
  308. package/doc_build/static/js/async/plugins_official-list_overview.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- (self["webpackChunk_modern_js_module_tools_docs"] = self["webpackChunk_modern_js_module_tools_docs"] || []).push([["guide_intro_why-module-engineering-solution"],{
2
+ (self["webpackChunk_modern_js_module_tools_docs"] = self["webpackChunk_modern_js_module_tools_docs"] || []).push([["zh_guide_intro_why-module-engineering-solution"],{
3
3
 
4
4
  /***/ "./docs/zh/guide/intro/why-module-engineering-solution.md":
5
5
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
@@ -14,14 +14,14 @@ __webpack_require__.r(__webpack_exports__);
14
14
  /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js");
15
15
  /*@jsxRuntime automatic @jsxImportSource react*/
16
16
 
17
- var frontmatter = {
17
+ const frontmatter = {
18
18
  "sidebar_position": 2
19
19
  };
20
- var toc = [];
21
- var title = "\u4E3A\u4EC0\u4E48\u9700\u8981\u6A21\u5757\u5DE5\u7A0B\u89E3\u51B3\u65B9\u6848";
22
- var content = "\"---\\nsidebar_position: 2\\n---\\n\\n# 为什么需要模块工程解决方案\\n\\n大家可能都经历过:从零开始开发一个组件库或者工具库的过程中,我们不仅要考虑项目本身的代码逻辑如何编写,还要考虑项目的构建、调试、测试、代码格式化等等和代码逻辑无关的事情。\\n\\n比如说,当我们考虑构建模块项目的代码是使用什么构建工具的时候,在之前我们可能会考虑使用 [webpack](https://webpack.js.org/) 还是 [Rollup](https://rollupjs.org/guide/en/),然而现在的话,也许还会考虑是使用 [esbuild](https://esbuild.github.io/) 还是 [SWC](https://swc.rs/)。\\n\\n无论选择哪个构建工具,这对于没有熟练掌握这些构建工具使用方式的开发者来说,是需要一定的成本去学习的。即使想要快速使用,也会需要花费大量的时间和精力。\\n\\n而除了构建这件事情以外,像为项目提供调试工具、支持测试能力、增加代码格式校验等等,对于一个新手来说都有可能需要花费很长的时间和精力了解或者掌握它们,并且真正的服务于当前的项目中。\\n\\n而为了保证代码质量以及项目的完整性,我们往往是需要做这些与代码逻辑实现无关的事情。然而这些事情很有可能会影响整体的项目开发进度,降低开发者的开发体验,会让开发者感觉模块项目的开发门槛很高。\\n\\n如果说每次开发一个模块类型的项目都需要经历一遍这些工作准备的话,那么基本上刚开始开发的时间会大部分花费在这些与代码实现无关的事情上。如果能够提供一个模块工程解决方案,它能够帮助开发者解决项目工程上的事情,让开发者可以更专注于代码的实现上,那么这将会大大提升模块类型项目的开发体验。\\n\\n![没有使用工程方案对比使用工程方案](https://lf3-static.bytednsdoc.com/obj/eden-cn/uhbfnupenuhf/module-tools/why-module-solution.png)\\n\\nModern.js 为了让开发模块类型的项目更简单,为了解决上述提到的问题提供了模块工程解决方案,并且使用 Module Tools 提供了主要的功能。**Module-tools 可以理解为是一个专门用于模块类型项目开发的工具**。\\n\"";
20
+ const toc = [];
21
+ const title = `为什么需要模块工程解决方案`;
22
+ const content = "\"---\\nsidebar_position: 2\\n---\\n\\n# 为什么需要模块工程解决方案\\n\\n大家可能都经历过:从零开始开发一个组件库或者工具库的过程中,我们不仅要考虑项目本身的代码逻辑如何编写,还要考虑项目的构建、调试、测试、代码格式化等等和代码逻辑无关的事情。\\n\\n比如说,当我们考虑构建模块项目的代码是使用什么构建工具的时候,在之前我们可能会考虑使用 [webpack](https://webpack.js.org/) 还是 [Rollup](https://rollupjs.org/guide/en/),然而现在的话,也许还会考虑是使用 [esbuild](https://esbuild.github.io/) 还是 [SWC](https://swc.rs/)。\\n\\n无论选择哪个构建工具,这对于没有熟练掌握这些构建工具使用方式的开发者来说,是需要一定的成本去学习的。即使想要快速使用,也会需要花费大量的时间和精力。\\n\\n而除了构建这件事情以外,像为项目提供调试工具、支持测试能力、增加代码格式校验等等,对于一个新手来说都有可能需要花费很长的时间和精力了解或者掌握它们,并且真正的服务于当前的项目中。\\n\\n而为了保证代码质量以及项目的完整性,我们往往是需要做这些与代码逻辑实现无关的事情。然而这些事情很有可能会影响整体的项目开发进度,降低开发者的开发体验,会让开发者感觉模块项目的开发门槛很高。\\n\\n如果说每次开发一个模块类型的项目都需要经历一遍这些工作准备的话,那么基本上刚开始开发的时间会大部分花费在这些与代码实现无关的事情上。如果能够提供一个模块工程解决方案,它能够帮助开发者解决项目工程上的事情,让开发者可以更专注于代码的实现上,那么这将会大大提升模块类型项目的开发体验。\\n\\n![没有使用工程方案对比使用工程方案](https://lf3-static.bytednsdoc.com/obj/eden-cn/uhbfnupenuhf/module-tools/why-module-solution.png)\\n\\nModern.js 为了让开发模块类型的项目更简单,为了解决上述提到的问题提供了模块工程解决方案,并且使用 Module Tools 提供了主要的功能。**Module-tools 可以理解为是一个专门用于模块类型项目开发的工具**。\\n\"";
23
23
  function _createMdxContent(props) {
24
- var _components = Object.assign({
24
+ const _components = Object.assign({
25
25
  h1: "h1",
26
26
  a: "a",
27
27
  p: "p",
@@ -42,15 +42,23 @@ function _createMdxContent(props) {
42
42
  }), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.p, {
43
43
  children: ["比如说,当我们考虑构建模块项目的代码是使用什么构建工具的时候,在之前我们可能会考虑使用 ", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.a, {
44
44
  href: "https://webpack.js.org/",
45
+ target: "_blank",
46
+ rel: "nofollow",
45
47
  children: "webpack"
46
48
  }), " 还是 ", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.a, {
47
49
  href: "https://rollupjs.org/guide/en/",
50
+ target: "_blank",
51
+ rel: "nofollow",
48
52
  children: "Rollup"
49
53
  }), ",然而现在的话,也许还会考虑是使用 ", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.a, {
50
54
  href: "https://esbuild.github.io/",
55
+ target: "_blank",
56
+ rel: "nofollow",
51
57
  children: "esbuild"
52
58
  }), " 还是 ", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.a, {
53
59
  href: "https://swc.rs/",
60
+ target: "_blank",
61
+ rel: "nofollow",
54
62
  children: "SWC"
55
63
  }), "。"]
56
64
  }), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.p, {
@@ -73,20 +81,16 @@ function _createMdxContent(props) {
73
81
  })]
74
82
  });
75
83
  }
76
- function MDXContent() {
77
- var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
78
- var _ref = props.components || {},
79
- MDXLayout = _ref.wrapper;
84
+ function MDXContent(props = {}) {
85
+ const {wrapper: MDXLayout} = props.components || ({});
80
86
  return MDXLayout ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(MDXLayout, Object.assign({}, props, {
81
87
  children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_createMdxContent, props)
82
88
  })) : _createMdxContent(props);
83
89
  }
84
- _c = MDXContent;
85
90
  /* harmony default export */ __webpack_exports__["default"] = (MDXContent);
86
- var _c;
87
- __webpack_require__.$Refresh$.register(_c, "MDXContent");
91
+
88
92
 
89
93
  /***/ })
90
94
 
91
95
  }]);
92
- //# sourceMappingURL=guide_intro_why-module-engineering-solution.js.map
96
+ //# sourceMappingURL=zh_guide_intro_why-module-engineering-solution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"static/js/async/zh_guide_intro_why-module-engineering-solution.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA;;AAEA;;AAEA;;;;AAAA;AAAA;;;;AAAA;AAAA;;;;AAAA;AAAA;;;;AAAA;AAAA;;AAEA;;AAEA;;AAEA;;AAEA;;;;;;;AAIA;AAAA;AAAA","sources":["webpack://@modern-js/module-tools-docs/./docs/zh/guide/intro/why-module-engineering-solution.md"],"names":[],"sourceRoot":""}
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- (self["webpackChunk_modern_js_module_tools_docs"] = self["webpackChunk_modern_js_module_tools_docs"] || []).push([["index"],{
2
+ (self["webpackChunk_modern_js_module_tools_docs"] = self["webpackChunk_modern_js_module_tools_docs"] || []).push([["zh_index"],{
3
3
 
4
4
  /***/ "./docs/zh/index.md":
5
5
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
@@ -14,10 +14,10 @@ __webpack_require__.r(__webpack_exports__);
14
14
  /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js");
15
15
  /*@jsxRuntime automatic @jsxImportSource react*/
16
16
 
17
- var frontmatter = {
17
+ const frontmatter = {
18
18
  "pageType": "home",
19
19
  "hero": {
20
- "name": "Module tools",
20
+ "name": "Module Tools",
21
21
  "text": "模块工程解决方案",
22
22
  "tagline": "简单、强大、高性能的现代化npm包开发方案",
23
23
  "actions": [{
@@ -48,11 +48,11 @@ var frontmatter = {
48
48
  "icon": "🎨"
49
49
  }]
50
50
  };
51
- var toc = [];
52
- var title = "index";
53
- var content = "\"---\\npageType: home\\n\\nhero:\\n name: Module tools\\n text: 模块工程解决方案\\n tagline: 简单、强大、高性能的现代化npm包开发方案\\n actions:\\n - theme: brand\\n text: 欢迎使用\\n link: /guide/intro/welcome\\n\\nfeatures:\\n - title: 'Esbuild: 高性能的JS Bundler'\\n details: 基于 Esbuild 构建,构建速度极快,带给你极致的开发体验。\\n icon: 🚀\\n - title: 'Storybook: 社区流行的UI开发工具'\\n details: 集成了Storybook,你可以使用它调试UI。\\n icon: 📦\\n - title: 'transform + bundle'\\n details: 支持bundle和bundleless两种构建模式。\\n icon: ✨\\n - title: '零配置'\\n details: 无需任何配置即可开发你的npm包,内置预设覆盖多种场景。\\n icon: 🛠️\\n - title: '扩展性强: 提供强大的插件机制'\\n details: 通过其插件扩展机制,你可以轻松的扩展Module tools的各项能力。\\n icon: 🎨\\n---\\n# index\\n\"";
51
+ const toc = [];
52
+ const title = `index`;
53
+ const content = "\"---\\npageType: home\\n\\nhero:\\n name: Module Tools\\n text: 模块工程解决方案\\n tagline: 简单、强大、高性能的现代化npm包开发方案\\n actions:\\n - theme: brand\\n text: 欢迎使用\\n link: /guide/intro/welcome\\n\\nfeatures:\\n - title: 'Esbuild: 高性能的JS Bundler'\\n details: 基于 Esbuild 构建,构建速度极快,带给你极致的开发体验。\\n icon: 🚀\\n - title: 'Storybook: 社区流行的UI开发工具'\\n details: 集成了Storybook,你可以使用它调试UI。\\n icon: 📦\\n - title: 'transform + bundle'\\n details: 支持bundle和bundleless两种构建模式。\\n icon: ✨\\n - title: '零配置'\\n details: 无需任何配置即可开发你的npm包,内置预设覆盖多种场景。\\n icon: 🛠️\\n - title: '扩展性强: 提供强大的插件机制'\\n details: 通过其插件扩展机制,你可以轻松的扩展Module tools的各项能力。\\n icon: 🎨\\n---\\n# index\\n\"";
54
54
  function _createMdxContent(props) {
55
- var _components = Object.assign({
55
+ const _components = Object.assign({
56
56
  h1: "h1",
57
57
  a: "a"
58
58
  }, props.components);
@@ -66,20 +66,16 @@ function _createMdxContent(props) {
66
66
  }), "index"]
67
67
  });
68
68
  }
69
- function MDXContent() {
70
- var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
71
- var _ref = props.components || {},
72
- MDXLayout = _ref.wrapper;
69
+ function MDXContent(props = {}) {
70
+ const {wrapper: MDXLayout} = props.components || ({});
73
71
  return MDXLayout ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(MDXLayout, Object.assign({}, props, {
74
72
  children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_createMdxContent, props)
75
73
  })) : _createMdxContent(props);
76
74
  }
77
- _c = MDXContent;
78
75
  /* harmony default export */ __webpack_exports__["default"] = (MDXContent);
79
- var _c;
80
- __webpack_require__.$Refresh$.register(_c, "MDXContent");
76
+
81
77
 
82
78
  /***/ })
83
79
 
84
80
  }]);
85
- //# sourceMappingURL=index.js.map
81
+ //# sourceMappingURL=zh_index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"static/js/async/zh_index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA","sources":["webpack://@modern-js/module-tools-docs/./docs/zh/index.md"],"names":[],"sourceRoot":""}
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- (self["webpackChunk_modern_js_module_tools_docs"] = self["webpackChunk_modern_js_module_tools_docs"] || []).push([["plugins_guide_getting-started"],{
2
+ (self["webpackChunk_modern_js_module_tools_docs"] = self["webpackChunk_modern_js_module_tools_docs"] || []).push([["zh_plugins_guide_getting-started"],{
3
3
 
4
4
  /***/ "./docs/zh/plugins/guide/getting-started.mdx":
5
5
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
@@ -18,12 +18,12 @@ __webpack_require__.r(__webpack_exports__);
18
18
  /*@jsxRuntime automatic @jsxImportSource react*/
19
19
 
20
20
 
21
- var CH = {
21
+ const CH = {
22
22
  annotations: _code_hike_mdx_dist_components_cjs_js__WEBPACK_IMPORTED_MODULE_1__.annotations,
23
23
  Spotlight: _code_hike_mdx_dist_components_cjs_js__WEBPACK_IMPORTED_MODULE_1__.Spotlight,
24
24
  CodeSlot: _code_hike_mdx_dist_components_cjs_js__WEBPACK_IMPORTED_MODULE_1__.CodeSlot
25
25
  };
26
- var chCodeConfig = {
26
+ const chCodeConfig = {
27
27
  "staticMediaQuery": "not screen, (max-width: 768px)",
28
28
  "theme": {
29
29
  "name": "nord",
@@ -1186,16 +1186,16 @@ var chCodeConfig = {
1186
1186
  "autoImport": true,
1187
1187
  "showCopyButton": true,
1188
1188
  "skipLanguages": [],
1189
- "filepath": "/Users/bytedance/modern.js/website/module-tools/docs/zh/plugins/guide/getting-started.mdx"
1189
+ "filepath": "/Users/targeral/github/targeral-modern-js/website/module-tools/docs/zh/plugins/guide/getting-started.mdx"
1190
1190
  };
1191
- var frontmatter = {
1191
+ const frontmatter = {
1192
1192
  "sidebar_position": 1
1193
1193
  };
1194
- var toc = [];
1195
- var title = "\u5FEB\u901F\u5F00\u59CB";
1196
- var content = "\"---\\nsidebar_position: 1\\n---\\n\\n# 快速开始\\n\\n模块工程解决方案不仅提供了丰富的功能,同时也支持通过插件的方式为当前项目扩展能力。\\n\\n我们可以通过下面的例子来快速了解如果编写一个 module-tools 插件:\\n\\n<CH.Spotlight>\\n\\n```md ./project\\n./\\n├── plugins\\n│ └── example.ts\\n├── src/\\n└── modern.config.ts\\n```\\n\\n---\\n\\n首先我们在初始化的项目下创建 `./plugins/example.ts` 文件。\\n\\n```md ./project\\n\\n```\\n\\n---\\n\\n接着在 `example.ts` 文件中增加插件的代码。\\n\\n```ts\\nimport type { CliPlugin, ModuleTools } from '@modern-js/module-tools';\\n\\nexport const ExamplePlugin = (): CliPlugin<ModuleTools> => {\\n return {\\n name: 'example',\\n setup() {\\n console.info('this is example plugin');\\n return {\\n // use hooks\\n afterBuild() {\\n console.info('build over');\\n }\\n };\\n };\\n };\\n};\\n```\\n\\n---\\n\\n然后我们通过 [`plugins`](/api/config/plugins) API,将刚刚写好的插件进行注册。\\n\\n```ts ./modern.config.ts\\nimport { ExamplePlugin } from './plugins/example';\\nexport default defineConfig({\\n plugins: [ExamplePlugin()],\\n});\\n```\\n\\n---\\n\\n最后运行 `modern build`,就可以看到。\\n\\n```bash terminal\\nthis is example plugin\\nBuild succeed: 510.684ms\\nbuild over\\n```\\n\\n</CH.Spotlight>\\n\\n通过上面这个例子,我们了解到了下面几件事:\\n\\n- 推荐的插件目录结构\\n- 插件的初始化代码\\n- 插件的注册\\n\\n除了以上内容以外,我们还需要了解:\\n\\n- [插件对象、类型定义与推荐配置项](/plugins/guide/plugin-object)\\n- [setup 函数、`api` 对象参数、生命周期钩子](/plugins/guide/setup-function)\\n\"";
1194
+ const toc = [];
1195
+ const title = `快速开始`;
1196
+ const content = "\"---\\nsidebar_position: 1\\n---\\n\\n# 快速开始\\n\\n模块工程解决方案不仅提供了丰富的功能,同时也支持通过插件的方式为当前项目扩展能力。\\n\\n我们可以通过下面的例子来快速了解如果编写一个 module-tools 插件:\\n\\n<CH.Spotlight>\\n\\n```md ./project\\n./\\n├── plugins\\n│ └── example.ts\\n├── src/\\n└── modern.config.ts\\n```\\n\\n---\\n\\n首先我们在初始化的项目下创建 `./plugins/example.ts` 文件。\\n\\n```md ./project\\n\\n```\\n\\n---\\n\\n接着在 `example.ts` 文件中增加插件的代码。\\n\\n```ts\\nimport type { CliPlugin, ModuleTools } from '@modern-js/module-tools';\\n\\nexport const ExamplePlugin = (): CliPlugin<ModuleTools> => {\\n return {\\n name: 'example',\\n setup() {\\n console.info('this is example plugin');\\n return {\\n // use hooks\\n afterBuild() {\\n console.info('build over');\\n }\\n };\\n };\\n };\\n};\\n```\\n\\n---\\n\\n然后我们通过 [`plugins`](/api/config/plugins) API,将刚刚写好的插件进行注册。\\n\\n```ts ./modern.config.ts\\nimport { examplePlugin } from './plugins/example';\\nexport default defineConfig({\\n plugins: [examplePlugin()],\\n});\\n```\\n\\n---\\n\\n最后运行 `modern build`,就可以看到。\\n\\n```bash terminal\\nthis is example plugin\\nBuild succeed: 510.684ms\\nbuild over\\n```\\n\\n</CH.Spotlight>\\n\\n通过上面这个例子,我们了解到了下面几件事:\\n\\n- 推荐的插件目录结构\\n- 插件的初始化代码\\n- 插件的注册\\n\\n除了以上内容以外,我们还需要了解:\\n\\n- [插件对象、类型定义与推荐配置项](/plugins/guide/plugin-object)\\n- [setup 函数、`api` 对象参数、生命周期钩子](/plugins/guide/setup-function)\\n\"";
1197
1197
  function _createMdxContent(props) {
1198
- var _components = Object.assign({
1198
+ const _components = Object.assign({
1199
1199
  h1: "h1",
1200
1200
  a: "a",
1201
1201
  p: "p",
@@ -2229,7 +2229,7 @@ function _createMdxContent(props) {
2229
2229
  }
2230
2230
  }
2231
2231
  }, {
2232
- "content": "ExamplePlugin",
2232
+ "content": "examplePlugin",
2233
2233
  "props": {
2234
2234
  "style": {
2235
2235
  "color": "#D8DEE9"
@@ -2380,7 +2380,7 @@ function _createMdxContent(props) {
2380
2380
  }
2381
2381
  }
2382
2382
  }, {
2383
- "content": "ExamplePlugin",
2383
+ "content": "examplePlugin",
2384
2384
  "props": {
2385
2385
  "style": {
2386
2386
  "color": "#88C0D0"
@@ -2544,7 +2544,7 @@ function _createMdxContent(props) {
2544
2544
  }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
2545
2545
  children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.p, {
2546
2546
  children: ["然后我们通过 ", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.a, {
2547
- href: "/api/config/plugins.html",
2547
+ href: "/module-tools/api/config/plugins.html",
2548
2548
  children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.code, {
2549
2549
  children: "plugins"
2550
2550
  })
@@ -2572,12 +2572,12 @@ function _createMdxContent(props) {
2572
2572
  }), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.ul, {
2573
2573
  children: ["\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.li, {
2574
2574
  children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.a, {
2575
- href: "/plugins/guide/plugin-object.html",
2575
+ href: "/module-tools/plugins/guide/plugin-object.html",
2576
2576
  children: "插件对象、类型定义与推荐配置项"
2577
2577
  })
2578
2578
  }), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.li, {
2579
2579
  children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.a, {
2580
- href: "/plugins/guide/setup-function.html",
2580
+ href: "/module-tools/plugins/guide/setup-function.html",
2581
2581
  children: ["setup 函数、", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.code, {
2582
2582
  children: "api"
2583
2583
  }), " 对象参数、生命周期钩子"]
@@ -2586,23 +2586,19 @@ function _createMdxContent(props) {
2586
2586
  })]
2587
2587
  });
2588
2588
  }
2589
- function MDXContent() {
2590
- var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2591
- var _ref = props.components || {},
2592
- MDXLayout = _ref.wrapper;
2589
+ function MDXContent(props = {}) {
2590
+ const {wrapper: MDXLayout} = props.components || ({});
2593
2591
  return MDXLayout ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(MDXLayout, Object.assign({}, props, {
2594
2592
  children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_createMdxContent, props)
2595
2593
  })) : _createMdxContent(props);
2596
2594
  }
2597
- _c = MDXContent;
2598
2595
  /* harmony default export */ __webpack_exports__["default"] = (MDXContent);
2599
2596
  function _missingMdxReference(id, component, place) {
2600
- throw new Error("Expected " + (component ? "component" : "object") + " `" + id + "` to be defined: you likely forgot to import, pass, or provide it." + (place ? "\nIt’s referenced in your code at `" + place + "` in `/Users/bytedance/modern.js/website/module-tools/docs/zh/plugins/guide/getting-started.mdx`" : ""));
2597
+ throw new Error("Expected " + (component ? "component" : "object") + " `" + id + "` to be defined: you likely forgot to import, pass, or provide it." + (place ? "\nIt’s referenced in your code at `" + place + "` in `/Users/targeral/github/targeral-modern-js/website/module-tools/docs/zh/plugins/guide/getting-started.mdx`" : ""));
2601
2598
  }
2602
- var _c;
2603
- __webpack_require__.$Refresh$.register(_c, "MDXContent");
2599
+
2604
2600
 
2605
2601
  /***/ })
2606
2602
 
2607
2603
  }]);
2608
- //# sourceMappingURL=plugins_guide_getting-started.js.map
2604
+ //# sourceMappingURL=zh_plugins_guide_getting-started.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"static/js/async/plugins_guide_getting-started.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;AAEA;;;;;AACA;;AAAA","sources":["webpack://@modern-js/module-tools-docs/./docs/zh/plugins/guide/getting-started.mdx"],"names":[],"sourceRoot":""}
1
+ {"version":3,"file":"static/js/async/zh_plugins_guide_getting-started.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA;;AAAA;;;;AAQA;;AAAA;;;;AAuBA;;;;;AAAA;;;;AAWA;;AAAA;;;;AAUA;;;AAEA;;AACA;;AACA;;;AAEA;;;;;AAEA;;;;;AACA;;AAAA","sources":["webpack://@modern-js/module-tools-docs/./docs/zh/plugins/guide/getting-started.mdx"],"names":[],"sourceRoot":""}
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- (self["webpackChunk_modern_js_module_tools_docs"] = self["webpackChunk_modern_js_module_tools_docs"] || []).push([["plugins_guide_plugin-object"],{
2
+ (self["webpackChunk_modern_js_module_tools_docs"] = self["webpackChunk_modern_js_module_tools_docs"] || []).push([["zh_plugins_guide_plugin-object"],{
3
3
 
4
4
  /***/ "./docs/zh/plugins/guide/plugin-object.mdx":
5
5
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
@@ -18,11 +18,11 @@ __webpack_require__.r(__webpack_exports__);
18
18
  /*@jsxRuntime automatic @jsxImportSource react*/
19
19
 
20
20
 
21
- var CH = {
21
+ const CH = {
22
22
  annotations: _code_hike_mdx_dist_components_cjs_js__WEBPACK_IMPORTED_MODULE_1__.annotations,
23
23
  Code: _code_hike_mdx_dist_components_cjs_js__WEBPACK_IMPORTED_MODULE_1__.Code
24
24
  };
25
- var chCodeConfig = {
25
+ const chCodeConfig = {
26
26
  "staticMediaQuery": "not screen, (max-width: 768px)",
27
27
  "theme": {
28
28
  "name": "nord",
@@ -1185,12 +1185,12 @@ var chCodeConfig = {
1185
1185
  "autoImport": true,
1186
1186
  "showCopyButton": true,
1187
1187
  "skipLanguages": [],
1188
- "filepath": "/Users/bytedance/modern.js/website/module-tools/docs/zh/plugins/guide/plugin-object.mdx"
1188
+ "filepath": "/Users/targeral/github/targeral-modern-js/website/module-tools/docs/zh/plugins/guide/plugin-object.mdx"
1189
1189
  };
1190
- var frontmatter = {
1190
+ const frontmatter = {
1191
1191
  "sidebar_position": 2
1192
1192
  };
1193
- var toc = [{
1193
+ const toc = [{
1194
1194
  "id": "插件类型定义",
1195
1195
  "text": "插件类型定义",
1196
1196
  "depth": 2
@@ -1199,10 +1199,10 @@ var toc = [{
1199
1199
  "text": "插件配置项",
1200
1200
  "depth": 2
1201
1201
  }];
1202
- var title = "\u63D2\u4EF6\u5BF9\u8C61";
1203
- var content = "\"---\\nsidebar_position: 2\\n---\\n\\n# 插件对象\\n\\nModule-tools 插件是一个对象,对象包含以下属性:\\n\\n- `name`:插件的名称,唯一标识符。\\n- `setup`:插件初始化函数,只会执行一次。setup 函数可以返回一个 [Hooks 对象](),module-tools 会在特定的时机执行 Hooks 对象上定义的 Hook 对应的函数。\\n\\n例如在下面的插件代码示例中,在项目开始执行构建任务之前会触发 `beforeBuild` 函数的执行,并打印 `build start` 的 log 内容。\\n\\n<CH.Code>\\n\\n```ts ./plugins/demo.tsx\\nimport type { CliPlugin, ModuleTools } from '@modern-js/module-tools';\\n\\nconst MyPlugin: CliPlugin<ModuleTools> = {\\n name: 'my-plugin',\\n\\n setup() {\\n return {\\n // this is hook\\n beforeBuild: () => {\\n console.info('build start');\\n },\\n };\\n },\\n};\\n```\\n\\n---\\n\\n```ts ./modern.config.ts\\nimport { MyPlugin } from './plugins/demo';\\nexport default {\\n plugins: [MyPlugin()],\\n};\\n```\\n\\n</CH.Code>\\n\\n## 插件类型定义\\n\\n使用 TypeScript 时,可以引入内置的 `CliPlugin` 和 `ModuleTools` 类型,为插件提供正确的类型推导:\\n\\n```ts\\nimport type { CliPlugin, ModuleTools } from '@modern-js/module-tools';\\n\\nconst MyPlugin: CliPlugin<ModuleTools> = {\\n name: 'my-plugin',\\n\\n setup() {\\n const foo = '1';\\n\\n return {\\n // this is hook\\n afterBuild: () => {\\n //...\\n },\\n };\\n },\\n};\\n```\\n\\n## 插件配置项\\n\\n**建议将插件写成函数的形式**,使插件能通过函数入参来接收配置项:\\n\\n```ts\\nimport type { CliPlugin, ModuleTools } from '@modern-js/module-tools';\\n\\ntype MyPluginOptions = {\\n foo: string;\\n};\\n\\nconst MyPlugin = (options: MyPluginOptions): CliPlugin<ModuleTools> => ({\\n name: 'my-plugin',\\n\\n setup() {\\n console.log(options.foo);\\n },\\n});\\n```\\n\"";
1202
+ const title = `插件对象`;
1203
+ const content = "\"---\\nsidebar_position: 2\\n---\\n\\n# 插件对象\\n\\nModule-tools 插件是一个对象,对象包含以下属性:\\n\\n- `name`:插件的名称,唯一标识符。\\n- `setup`:插件初始化函数,只会执行一次。setup 函数可以返回一个 [Hooks 对象](),module-tools 会在特定的时机执行 Hooks 对象上定义的 Hook 对应的函数。\\n\\n例如在下面的插件代码示例中,在项目开始执行构建任务之前会触发 `beforeBuild` 函数的执行,并打印 `build start` 的 log 内容。\\n\\n<CH.Code>\\n\\n```ts ./plugins/demo.tsx\\nimport type { CliPlugin, ModuleTools } from '@modern-js/module-tools';\\n\\nconst myPlugin: CliPlugin<ModuleTools> = {\\n name: 'my-plugin',\\n\\n setup() {\\n return {\\n // this is hook\\n beforeBuild: () => {\\n console.info('build start');\\n },\\n };\\n },\\n};\\n```\\n\\n---\\n\\n```ts ./modern.config.ts\\nimport { myPlugin } from './plugins/demo';\\nexport default {\\n plugins: [myPlugin()],\\n};\\n```\\n\\n</CH.Code>\\n\\n## 插件类型定义\\n\\n使用 TypeScript 时,可以引入内置的 `CliPlugin` 和 `ModuleTools` 类型,为插件提供正确的类型推导:\\n\\n```ts\\nimport type { CliPlugin, ModuleTools } from '@modern-js/module-tools';\\n\\nconst myPlugin: CliPlugin<ModuleTools> = {\\n name: 'my-plugin',\\n\\n setup() {\\n const foo = '1';\\n\\n return {\\n // this is hook\\n afterBuild: () => {\\n //...\\n },\\n };\\n },\\n};\\n```\\n\\n## 插件配置项\\n\\n**建议将插件写成函数的形式**,使插件能通过函数入参来接收配置项:\\n\\n```ts\\nimport type { CliPlugin, ModuleTools } from '@modern-js/module-tools';\\n\\ntype MyPluginOptions = {\\n foo: string;\\n};\\n\\nconst myPlugin = (options: MyPluginOptions): CliPlugin<ModuleTools> => ({\\n name: 'my-plugin',\\n\\n setup() {\\n console.log(options.foo);\\n },\\n});\\n```\\n\"";
1204
1204
  function _createMdxContent(props) {
1205
- var _components = Object.assign({
1205
+ const _components = Object.assign({
1206
1206
  h1: "h1",
1207
1207
  a: "a",
1208
1208
  p: "p",
@@ -1414,7 +1414,7 @@ function _createMdxContent(props) {
1414
1414
  }
1415
1415
  }
1416
1416
  }, {
1417
- "content": "MyPlugin",
1417
+ "content": "myPlugin",
1418
1418
  "props": {
1419
1419
  "style": {
1420
1420
  "color": "#D8DEE9"
@@ -1880,7 +1880,7 @@ function _createMdxContent(props) {
1880
1880
  }
1881
1881
  }
1882
1882
  }, {
1883
- "content": "MyPlugin",
1883
+ "content": "myPlugin",
1884
1884
  "props": {
1885
1885
  "style": {
1886
1886
  "color": "#D8DEE9"
@@ -2017,7 +2017,7 @@ function _createMdxContent(props) {
2017
2017
  }
2018
2018
  }
2019
2019
  }, {
2020
- "content": "MyPlugin",
2020
+ "content": "myPlugin",
2021
2021
  "props": {
2022
2022
  "style": {
2023
2023
  "color": "#88C0D0"
@@ -2223,7 +2223,7 @@ function _createMdxContent(props) {
2223
2223
  }
2224
2224
  }
2225
2225
  }, {
2226
- "content": "MyPlugin",
2226
+ "content": "myPlugin",
2227
2227
  "props": {
2228
2228
  "style": {
2229
2229
  "color": "#D8DEE9"
@@ -2697,7 +2697,7 @@ function _createMdxContent(props) {
2697
2697
  }
2698
2698
  }
2699
2699
  }, {
2700
- "content": "MyPlugin",
2700
+ "content": "myPlugin",
2701
2701
  "props": {
2702
2702
  "style": {
2703
2703
  "color": "#D8DEE9"
@@ -2834,7 +2834,7 @@ function _createMdxContent(props) {
2834
2834
  }
2835
2835
  }
2836
2836
  }, {
2837
- "content": "MyPlugin",
2837
+ "content": "myPlugin",
2838
2838
  "props": {
2839
2839
  "style": {
2840
2840
  "color": "#88C0D0"
@@ -3055,7 +3055,7 @@ function _createMdxContent(props) {
3055
3055
  }
3056
3056
  }
3057
3057
  }, {
3058
- "content": "MyPlugin",
3058
+ "content": "myPlugin",
3059
3059
  "props": {
3060
3060
  "style": {
3061
3061
  "color": "#D8DEE9"
@@ -3795,7 +3795,7 @@ function _createMdxContent(props) {
3795
3795
  }
3796
3796
  }
3797
3797
  }, {
3798
- "content": "MyPlugin",
3798
+ "content": "myPlugin",
3799
3799
  "props": {
3800
3800
  "style": {
3801
3801
  "color": "#88C0D0"
@@ -4151,23 +4151,19 @@ function _createMdxContent(props) {
4151
4151
  })]
4152
4152
  });
4153
4153
  }
4154
- function MDXContent() {
4155
- var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
4156
- var _ref = props.components || {},
4157
- MDXLayout = _ref.wrapper;
4154
+ function MDXContent(props = {}) {
4155
+ const {wrapper: MDXLayout} = props.components || ({});
4158
4156
  return MDXLayout ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(MDXLayout, Object.assign({}, props, {
4159
4157
  children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_createMdxContent, props)
4160
4158
  })) : _createMdxContent(props);
4161
4159
  }
4162
- _c = MDXContent;
4163
4160
  /* harmony default export */ __webpack_exports__["default"] = (MDXContent);
4164
4161
  function _missingMdxReference(id, component, place) {
4165
- throw new Error("Expected " + (component ? "component" : "object") + " `" + id + "` to be defined: you likely forgot to import, pass, or provide it." + (place ? "\nIt’s referenced in your code at `" + place + "` in `/Users/bytedance/modern.js/website/module-tools/docs/zh/plugins/guide/plugin-object.mdx`" : ""));
4162
+ throw new Error("Expected " + (component ? "component" : "object") + " `" + id + "` to be defined: you likely forgot to import, pass, or provide it." + (place ? "\nIt’s referenced in your code at `" + place + "` in `/Users/targeral/github/targeral-modern-js/website/module-tools/docs/zh/plugins/guide/plugin-object.mdx`" : ""));
4166
4163
  }
4167
- var _c;
4168
- __webpack_require__.$Refresh$.register(_c, "MDXContent");
4164
+
4169
4165
 
4170
4166
  /***/ })
4171
4167
 
4172
4168
  }]);
4173
- //# sourceMappingURL=plugins_guide_plugin-object.js.map
4169
+ //# sourceMappingURL=zh_plugins_guide_plugin-object.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"static/js/async/plugins_guide_plugin-object.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA;;;AAEA;AAAA","sources":["webpack://@modern-js/module-tools-docs/./docs/zh/plugins/guide/plugin-object.mdx"],"names":[],"sourceRoot":""}
1
+ {"version":3,"file":"static/js/async/zh_plugins_guide_plugin-object.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA;;AAEA;;AAAA;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA;;;AAEA;AAAA","sources":["webpack://@modern-js/module-tools-docs/./docs/zh/plugins/guide/plugin-object.mdx"],"names":[],"sourceRoot":""}
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- (self["webpackChunk_modern_js_module_tools_docs"] = self["webpackChunk_modern_js_module_tools_docs"] || []).push([["plugins_guide_setup-function"],{
2
+ (self["webpackChunk_modern_js_module_tools_docs"] = self["webpackChunk_modern_js_module_tools_docs"] || []).push([["zh_plugins_guide_setup-function"],{
3
3
 
4
4
  /***/ "./docs/zh/plugins/guide/setup-function.mdx":
5
5
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
@@ -18,11 +18,11 @@ __webpack_require__.r(__webpack_exports__);
18
18
  /*@jsxRuntime automatic @jsxImportSource react*/
19
19
 
20
20
 
21
- var CH = {
21
+ const CH = {
22
22
  annotations: _code_hike_mdx_dist_components_cjs_js__WEBPACK_IMPORTED_MODULE_1__.annotations,
23
23
  Code: _code_hike_mdx_dist_components_cjs_js__WEBPACK_IMPORTED_MODULE_1__.Code
24
24
  };
25
- var chCodeConfig = {
25
+ const chCodeConfig = {
26
26
  "staticMediaQuery": "not screen, (max-width: 768px)",
27
27
  "theme": {
28
28
  "name": "nord",
@@ -1185,12 +1185,12 @@ var chCodeConfig = {
1185
1185
  "autoImport": true,
1186
1186
  "showCopyButton": true,
1187
1187
  "skipLanguages": [],
1188
- "filepath": "/Users/bytedance/modern.js/website/module-tools/docs/zh/plugins/guide/setup-function.mdx"
1188
+ "filepath": "/Users/targeral/github/targeral-modern-js/website/module-tools/docs/zh/plugins/guide/setup-function.mdx"
1189
1189
  };
1190
- var frontmatter = {
1190
+ const frontmatter = {
1191
1191
  "sidebar_position": 3
1192
1192
  };
1193
- var toc = [{
1193
+ const toc = [{
1194
1194
  "id": "插件-api-对象",
1195
1195
  "text": "插件 API 对象",
1196
1196
  "depth": 2
@@ -1215,10 +1215,10 @@ var toc = [{
1215
1215
  "text": "生命周期钩子",
1216
1216
  "depth": 2
1217
1217
  }];
1218
- var title = "Setup \u51FD\u6570";
1219
- var content = "\"---\\nsidebar_position: 3\\n---\\n\\n# Setup 函数\\n\\n在[【插件对象】](/plugins/guide/plugin-object) 部分我们知道插件对象包含了一个 `setup` 函数,该函数不仅包含了一个 `api` 对象参数,同时还可以返回一个 Hooks 对象。\\n\\n## 插件 API 对象\\n\\n插件的 `setup` 函数会提供一个 `api` 对象参数,你可以调用该对象上提供的一些方法来获取到配置、项目上下文等信息。\\n\\n```ts\\nexport default (): CliPlugin<ModuleTools> => ({\\n name: 'my-plugin',\\n\\n setup(api) {\\n // 获取应用原始配置\\n const config = api.useConfigContext();\\n // 获取应用运行上下文\\n const appContext = api.useAppContext();\\n // 获取解析之后的最终配置\\n const resolvedConfig = api.useResolvedConfigContext();\\n },\\n});\\n```\\n\\n### `api.useAppContext`\\n\\n用于获取项目上下文信息。\\n\\n```ts\\nconst useAppContext: () => IAppContext;\\n\\ninterface IAppContext {\\n appDirectory: string;\\n configFile: string | false;\\n packageName: string;\\n nodeModulesDirectory: string;\\n internalDirectory: string;\\n plugins: {\\n cli?: any;\\n server?: any;\\n }[];\\n}\\n```\\n\\n:::info\\n通过实际的类型文件我们可以看到还存在着其他的字段,不过目前对于模块工程有意义的字段只有以上内容。api 对象其他的方法也是如此。\\n:::\\n\\n### `api.useResolvedConfigContext`\\n\\n用于获取解析之后的最终配置。\\n\\n:::info\\n如果需要获取构建相关的最终配置,需要使用 [`beforeBuild`]() Hook。\\n:::\\n\\n```ts\\nconst useResolvedConfigContext: () => NormalizedConfig;\\n\\ninterface NormalizedConfig {\\n buildConfig: PartialBuildConfig;\\n buildPreset: BuildPreset;\\n designSystem?: Record<string, any>;\\n dev: Dev;\\n plugins: PluginConfig;\\n runtime: RuntimeConfig;\\n runtimeByEntries?: RuntimeByEntriesConfig;\\n _raw: UserConfig;\\n}\\n```\\n\\n### `api.useHookRunners`\\n\\n用于获取 Hooks 的执行器,并触发特定的 Hook 执行。\\n\\n```ts\\nimport type { CliPlugin } from '@modern-js/core';\\n\\nexport default (): CliPlugin => ({\\n name: 'my-plugin',\\n\\n async setup(api) {\\n const hookRunners = api.useHookRunners();\\n // 触发 afterBuild Hook\\n await hookRunners.afterBuild();\\n },\\n});\\n```\\n\\n## 异步 setup\\n\\nCLI 插件的 setup 可以是一个异步函数,在初始化过程中执行异步逻辑。\\n\\n```ts\\nexport default (): CliPlugin<ModuleTools> => ({\\n name: 'my-plugin',\\n\\n async setup(api) {\\n await doSomething();\\n },\\n});\\n```\\n\\n## 生命周期钩子\\n\\n我们知道 `setup` 函数会返回一个 Hooks 对象,所谓 Hooks 对象也可以理解是具有 module-tools 生命周期钩子的对象。\\n\\n目前主要包含两类钩子:\\n\\n- 构建钩子:仅在执行 `build` 命令构建源码产物时触发。\\n- `buildPlatform` 钩子:仅在执行 `build --platform` 命令生成其他构建产物时触发。\\n- 调试钩子:运行 `dev` 命令时会触发的钩子。\\n\\n关于生命周期钩子的完整列表参考 [API 文档](/api/plugin-api/plugin-hooks)。\\n\"";
1218
+ const title = `Setup 函数`;
1219
+ const content = "\"---\\nsidebar_position: 3\\n---\\n\\n# Setup 函数\\n\\n在[【插件对象】](/plugins/guide/plugin-object) 部分我们知道插件对象包含了一个 `setup` 函数,该函数不仅包含了一个 `api` 对象参数,同时还可以返回一个 Hooks 对象。\\n\\n## 插件 API 对象\\n\\n插件的 `setup` 函数会提供一个 `api` 对象参数,你可以调用该对象上提供的一些方法来获取到配置、项目上下文等信息。\\n\\n```ts\\nexport default (): CliPlugin<ModuleTools> => ({\\n name: 'my-plugin',\\n\\n setup(api) {\\n // 获取应用原始配置\\n const config = api.useConfigContext();\\n // 获取应用运行上下文\\n const appContext = api.useAppContext();\\n // 获取解析之后的最终配置\\n const resolvedConfig = api.useResolvedConfigContext();\\n },\\n});\\n```\\n\\n### `api.useAppContext`\\n\\n用于获取项目上下文信息。\\n\\n```ts\\nconst useAppContext: () => IAppContext;\\n\\ninterface IAppContext {\\n appDirectory: string;\\n configFile: string | false;\\n packageName: string;\\n nodeModulesDirectory: string;\\n internalDirectory: string;\\n plugins: {\\n cli?: any;\\n server?: any;\\n }[];\\n}\\n```\\n\\n:::info\\n通过实际的类型文件我们可以看到还存在着其他的字段,不过目前对于模块工程有意义的字段只有以上内容。api 对象其他的方法也是如此。\\n:::\\n\\n### `api.useResolvedConfigContext`\\n\\n用于获取解析之后的最终配置。\\n\\n:::info\\n如果需要获取构建相关的最终配置,需要使用 [`beforeBuild`]() Hook。\\n:::\\n\\n```ts\\nconst useResolvedConfigContext: () => NormalizedConfig;\\n\\ninterface NormalizedConfig {\\n buildConfig: PartialBuildConfig;\\n buildPreset: BuildPreset;\\n designSystem?: Record<string, any>;\\n dev: Dev;\\n plugins: PluginConfig;\\n runtime: RuntimeConfig;\\n runtimeByEntries?: RuntimeByEntriesConfig;\\n _raw: UserConfig;\\n}\\n```\\n\\n### `api.useHookRunners`\\n\\n用于获取 Hooks 的执行器,并触发特定的 Hook 执行。\\n\\n```ts\\nimport type { CliPlugin } from '@modern-js/core';\\n\\nexport default (): CliPlugin => ({\\n name: 'my-plugin',\\n\\n async setup(api) {\\n const hookRunners = api.useHookRunners();\\n // 触发 afterBuild Hook\\n await hookRunners.afterBuild();\\n },\\n});\\n```\\n\\n## 异步 setup\\n\\nCLI 插件的 setup 可以是一个异步函数,在初始化过程中执行异步逻辑。\\n\\n```ts\\nexport default (): CliPlugin<ModuleTools> => ({\\n name: 'my-plugin',\\n\\n async setup(api) {\\n await doSomething();\\n },\\n});\\n```\\n\\n## 生命周期钩子\\n\\n我们知道 `setup` 函数会返回一个 Hooks 对象,所谓 Hooks 对象也可以理解是具有 module-tools 生命周期钩子的对象。\\n\\n目前主要包含两类钩子:\\n\\n- 构建钩子:仅在执行 `build` 命令构建源码产物时触发。\\n- `buildPlatform` 钩子:仅在执行 `build --platform` 命令生成其他构建产物时触发。\\n- 调试钩子:运行 `dev` 命令时会触发的钩子。\\n\\n关于生命周期钩子的完整列表参考 [API 文档](/api/plugin-api/plugin-hooks)。\\n\"";
1220
1220
  function _createMdxContent(props) {
1221
- var _components = Object.assign({
1221
+ const _components = Object.assign({
1222
1222
  h1: "h1",
1223
1223
  a: "a",
1224
1224
  p: "p",
@@ -1242,7 +1242,7 @@ function _createMdxContent(props) {
1242
1242
  }), "Setup 函数"]
1243
1243
  }), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.p, {
1244
1244
  children: ["在", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.a, {
1245
- href: "/plugins/guide/plugin-object.html",
1245
+ href: "/module-tools/plugins/guide/plugin-object.html",
1246
1246
  children: "【插件对象】"
1247
1247
  }), " 部分我们知道插件对象包含了一个 ", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.code, {
1248
1248
  children: "setup"
@@ -2350,9 +2350,9 @@ function _createMdxContent(props) {
2350
2350
  className: "modern-directive-title",
2351
2351
  children: "INFO"
2352
2352
  }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.div, {
2353
- className: "island-directive-content",
2353
+ className: "modern-directive-content",
2354
2354
  children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.p, {
2355
- children: "通过实际的类型文件我们可以看到还存在着其他的字段,不过目前对于模块工程有意义的字段只有以上内容。api 对象其他的方法也是如此。"
2355
+ children: "\n通过实际的类型文件我们可以看到还存在着其他的字段,不过目前对于模块工程有意义的字段只有以上内容。api 对象其他的方法也是如此。"
2356
2356
  })
2357
2357
  })]
2358
2358
  }), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.h3, {
@@ -2373,14 +2373,14 @@ function _createMdxContent(props) {
2373
2373
  className: "modern-directive-title",
2374
2374
  children: "INFO"
2375
2375
  }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.div, {
2376
- className: "island-directive-content",
2376
+ className: "modern-directive-content",
2377
2377
  children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.p, {
2378
- children: ["如果需要获取构建相关的最终配置,需要使用 ", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.a, {
2378
+ children: ["\n如果需要获取构建相关的最终配置,需要使用 ", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.a, {
2379
2379
  href: "",
2380
2380
  children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.code, {
2381
2381
  children: "beforeBuild"
2382
2382
  })
2383
- }), " Hook。"]
2383
+ }), "Hook。"]
2384
2384
  })
2385
2385
  })]
2386
2386
  }), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(CH.Code, {
@@ -3791,29 +3791,25 @@ function _createMdxContent(props) {
3791
3791
  }), "\n"]
3792
3792
  }), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.p, {
3793
3793
  children: ["关于生命周期钩子的完整列表参考 ", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.a, {
3794
- href: "/api/plugin-api/plugin-hooks.html",
3794
+ href: "/module-tools/api/plugin-api/plugin-hooks.html",
3795
3795
  children: "API 文档"
3796
3796
  }), "。"]
3797
3797
  })]
3798
3798
  });
3799
3799
  }
3800
- function MDXContent() {
3801
- var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3802
- var _ref = props.components || {},
3803
- MDXLayout = _ref.wrapper;
3800
+ function MDXContent(props = {}) {
3801
+ const {wrapper: MDXLayout} = props.components || ({});
3804
3802
  return MDXLayout ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(MDXLayout, Object.assign({}, props, {
3805
3803
  children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_createMdxContent, props)
3806
3804
  })) : _createMdxContent(props);
3807
3805
  }
3808
- _c = MDXContent;
3809
3806
  /* harmony default export */ __webpack_exports__["default"] = (MDXContent);
3810
3807
  function _missingMdxReference(id, component, place) {
3811
- throw new Error("Expected " + (component ? "component" : "object") + " `" + id + "` to be defined: you likely forgot to import, pass, or provide it." + (place ? "\nIt’s referenced in your code at `" + place + "` in `/Users/bytedance/modern.js/website/module-tools/docs/zh/plugins/guide/setup-function.mdx`" : ""));
3808
+ throw new Error("Expected " + (component ? "component" : "object") + " `" + id + "` to be defined: you likely forgot to import, pass, or provide it." + (place ? "\nIt’s referenced in your code at `" + place + "` in `/Users/targeral/github/targeral-modern-js/website/module-tools/docs/zh/plugins/guide/setup-function.mdx`" : ""));
3812
3809
  }
3813
- var _c;
3814
- __webpack_require__.$Refresh$.register(_c, "MDXContent");
3810
+
3815
3811
 
3816
3812
  /***/ })
3817
3813
 
3818
3814
  }]);
3819
- //# sourceMappingURL=plugins_guide_setup-function.js.map
3815
+ //# sourceMappingURL=zh_plugins_guide_setup-function.js.map