@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.
- package/doc_build/html/main/index.html +16 -0
- package/doc_build/route.json +10 -0
- package/doc_build/static/css/main.css +2966 -0
- package/doc_build/static/css/main.css.map +1 -0
- 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
- 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
- package/doc_build/static/js/async/en_api_config_build-config.js +8406 -0
- package/doc_build/static/js/async/en_api_config_build-config.js.map +1 -0
- package/doc_build/static/js/async/en_api_config_build-preset.js +7865 -0
- package/doc_build/static/js/async/en_api_config_build-preset.js.map +1 -0
- package/doc_build/static/js/async/en_api_config_design-system.js +47805 -0
- package/doc_build/static/js/async/en_api_config_design-system.js.map +1 -0
- package/doc_build/static/js/async/en_api_config_plugins.js +1488 -0
- package/doc_build/static/js/async/en_api_config_plugins.js.map +1 -0
- package/doc_build/static/js/async/en_api_config_testing.js +2139 -0
- package/doc_build/static/js/async/en_api_config_testing.js.map +1 -0
- package/doc_build/static/js/async/en_api_index.js +51 -0
- package/doc_build/static/js/async/en_api_index.js.map +1 -0
- package/doc_build/static/js/async/en_api_plugin-api_plugin-hooks.js +14360 -0
- package/doc_build/static/js/async/en_api_plugin-api_plugin-hooks.js.map +1 -0
- package/doc_build/static/js/async/en_guide_advance_asset.js +3972 -0
- package/doc_build/static/js/async/en_guide_advance_asset.js.map +1 -0
- package/doc_build/static/js/async/en_guide_advance_build-umd.js +9857 -0
- package/doc_build/static/js/async/en_guide_advance_build-umd.js.map +1 -0
- package/doc_build/static/js/async/en_guide_advance_copy.js +6541 -0
- package/doc_build/static/js/async/en_guide_advance_copy.js.map +1 -0
- package/doc_build/static/js/async/en_guide_advance_external-dependency.js +3806 -0
- package/doc_build/static/js/async/en_guide_advance_external-dependency.js.map +1 -0
- package/doc_build/static/js/async/en_guide_advance_in-depth-about-build.js +5304 -0
- package/doc_build/static/js/async/en_guide_advance_in-depth-about-build.js.map +1 -0
- package/doc_build/static/js/async/en_guide_advance_in-depth-about-dev-command.js +146 -0
- package/doc_build/static/js/async/en_guide_advance_in-depth-about-dev-command.js.map +1 -0
- package/doc_build/static/js/async/en_guide_advance_theme-config.js +2486 -0
- package/doc_build/static/js/async/en_guide_advance_theme-config.js.map +1 -0
- package/doc_build/static/js/async/en_guide_basic_before-getting-started.js +3858 -0
- package/doc_build/static/js/async/en_guide_basic_before-getting-started.js.map +1 -0
- package/doc_build/static/js/async/en_guide_basic_command-preview.js +3973 -0
- package/doc_build/static/js/async/en_guide_basic_command-preview.js.map +1 -0
- package/doc_build/static/js/async/en_guide_basic_modify-output-product.js +3048 -0
- package/doc_build/static/js/async/en_guide_basic_modify-output-product.js.map +1 -0
- package/doc_build/static/js/async/en_guide_basic_publish-your-project.js +2180 -0
- package/doc_build/static/js/async/en_guide_basic_publish-your-project.js.map +1 -0
- package/doc_build/static/js/async/en_guide_basic_test-your-project.js +3887 -0
- package/doc_build/static/js/async/en_guide_basic_test-your-project.js.map +1 -0
- package/doc_build/static/js/async/en_guide_basic_use-micro-generator.js +186 -0
- package/doc_build/static/js/async/en_guide_basic_use-micro-generator.js.map +1 -0
- package/doc_build/static/js/async/en_guide_basic_using-storybook.js +4723 -0
- package/doc_build/static/js/async/en_guide_basic_using-storybook.js.map +1 -0
- package/doc_build/static/js/async/en_guide_best-practices_components.js +21400 -0
- package/doc_build/static/js/async/en_guide_best-practices_components.js.map +1 -0
- package/doc_build/static/js/async/en_guide_intro_getting-started.js +1904 -0
- package/doc_build/static/js/async/en_guide_intro_getting-started.js.map +1 -0
- package/doc_build/static/js/async/en_guide_intro_welcome.js +162 -0
- package/doc_build/static/js/async/en_guide_intro_welcome.js.map +1 -0
- package/doc_build/static/js/async/en_guide_intro_why-module-engineering-solution.js +96 -0
- package/doc_build/static/js/async/en_guide_intro_why-module-engineering-solution.js.map +1 -0
- package/doc_build/static/js/async/en_index.js +81 -0
- package/doc_build/static/js/async/en_index.js.map +1 -0
- package/doc_build/static/js/async/en_plugins_guide_getting-started.js +2556 -0
- package/doc_build/static/js/async/en_plugins_guide_getting-started.js.map +1 -0
- package/doc_build/static/js/async/en_plugins_guide_plugin-object.js +4173 -0
- package/doc_build/static/js/async/en_plugins_guide_plugin-object.js.map +1 -0
- package/doc_build/static/js/async/en_plugins_guide_setup-function.js +3815 -0
- package/doc_build/static/js/async/en_plugins_guide_setup-function.js.map +1 -0
- package/doc_build/static/js/async/en_plugins_official-list_overview.js +66 -0
- package/doc_build/static/js/async/en_plugins_official-list_overview.js.map +1 -0
- package/doc_build/static/js/async/packages_cli_doc-core_src_theme-default_components_Search_logic_search_ts.js +246 -0
- package/doc_build/static/js/async/packages_cli_doc-core_src_theme-default_components_Search_logic_search_ts.js.map +1 -0
- 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
- 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
- package/doc_build/static/js/async/vendors-node_modules_pnpm_flexsearch_0_6_32_node_modules_flexsearch_dist_flexsearch_min_js.js +54 -0
- 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
- package/doc_build/static/js/async/zh_api_config_build-config.js +11354 -0
- package/doc_build/static/js/async/zh_api_config_build-config.js.map +1 -0
- package/doc_build/static/js/async/zh_api_config_build-preset.js +7867 -0
- package/doc_build/static/js/async/zh_api_config_build-preset.js.map +1 -0
- package/doc_build/static/js/async/zh_api_config_design-system.js +48712 -0
- package/doc_build/static/js/async/zh_api_config_design-system.js.map +1 -0
- package/doc_build/static/js/async/zh_api_config_plugins.js +1488 -0
- package/doc_build/static/js/async/zh_api_config_plugins.js.map +1 -0
- package/doc_build/static/js/async/zh_api_config_testing.js +2132 -0
- package/doc_build/static/js/async/zh_api_config_testing.js.map +1 -0
- package/doc_build/static/js/async/zh_api_index.js +52 -0
- package/doc_build/static/js/async/zh_api_index.js.map +1 -0
- package/doc_build/static/js/async/zh_api_plugin-api_plugin-hooks.js +14392 -0
- package/doc_build/static/js/async/zh_api_plugin-api_plugin-hooks.js.map +1 -0
- package/doc_build/static/js/async/zh_guide_advance_asset.js +3972 -0
- package/doc_build/static/js/async/zh_guide_advance_asset.js.map +1 -0
- package/doc_build/static/js/async/zh_guide_advance_build-umd.js +9859 -0
- package/doc_build/static/js/async/zh_guide_advance_build-umd.js.map +1 -0
- package/doc_build/static/js/async/zh_guide_advance_copy.js +6541 -0
- package/doc_build/static/js/async/zh_guide_advance_copy.js.map +1 -0
- package/doc_build/static/js/async/zh_guide_advance_external-dependency.js +3808 -0
- package/doc_build/static/js/async/zh_guide_advance_external-dependency.js.map +1 -0
- package/doc_build/static/js/async/zh_guide_advance_in-depth-about-build.js +5304 -0
- package/doc_build/static/js/async/zh_guide_advance_in-depth-about-build.js.map +1 -0
- package/doc_build/static/js/async/zh_guide_advance_in-depth-about-dev-command.js +150 -0
- package/doc_build/static/js/async/zh_guide_advance_in-depth-about-dev-command.js.map +1 -0
- package/doc_build/static/js/async/zh_guide_advance_theme-config.js +2477 -0
- package/doc_build/static/js/async/zh_guide_advance_theme-config.js.map +1 -0
- package/doc_build/static/js/async/zh_guide_basic_before-getting-started.js +3849 -0
- package/doc_build/static/js/async/zh_guide_basic_before-getting-started.js.map +1 -0
- package/doc_build/static/js/async/zh_guide_basic_command-preview.js +3805 -0
- package/doc_build/static/js/async/zh_guide_basic_command-preview.js.map +1 -0
- package/doc_build/static/js/async/zh_guide_basic_modify-output-product.js +3064 -0
- package/doc_build/static/js/async/zh_guide_basic_modify-output-product.js.map +1 -0
- package/doc_build/static/js/async/zh_guide_basic_publish-your-project.js +2241 -0
- package/doc_build/static/js/async/zh_guide_basic_publish-your-project.js.map +1 -0
- package/doc_build/static/js/async/zh_guide_basic_test-your-project.js +3887 -0
- package/doc_build/static/js/async/zh_guide_basic_test-your-project.js.map +1 -0
- package/doc_build/static/js/async/zh_guide_basic_use-micro-generator.js +192 -0
- package/doc_build/static/js/async/zh_guide_basic_use-micro-generator.js.map +1 -0
- package/doc_build/static/js/async/zh_guide_basic_using-storybook.js +4669 -0
- package/doc_build/static/js/async/zh_guide_basic_using-storybook.js.map +1 -0
- package/doc_build/static/js/async/zh_guide_best-practices_components.js +21100 -0
- package/doc_build/static/js/async/zh_guide_best-practices_components.js.map +1 -0
- package/doc_build/static/js/async/zh_guide_intro_getting-started.js +1780 -0
- package/doc_build/static/js/async/zh_guide_intro_getting-started.js.map +1 -0
- package/doc_build/static/js/async/zh_guide_intro_welcome.js +162 -0
- package/doc_build/static/js/async/zh_guide_intro_welcome.js.map +1 -0
- package/doc_build/static/js/async/zh_guide_intro_why-module-engineering-solution.js +96 -0
- package/doc_build/static/js/async/zh_guide_intro_why-module-engineering-solution.js.map +1 -0
- package/doc_build/static/js/async/zh_index.js +81 -0
- package/doc_build/static/js/async/zh_index.js.map +1 -0
- package/doc_build/static/js/async/zh_plugins_guide_getting-started.js +2604 -0
- package/doc_build/static/js/async/zh_plugins_guide_getting-started.js.map +1 -0
- package/doc_build/static/js/async/zh_plugins_guide_plugin-object.js +4169 -0
- package/doc_build/static/js/async/zh_plugins_guide_plugin-object.js.map +1 -0
- package/doc_build/static/js/async/zh_plugins_guide_setup-function.js +3815 -0
- package/doc_build/static/js/async/zh_plugins_guide_setup-function.js.map +1 -0
- package/doc_build/static/js/async/zh_plugins_official-list_overview.js +66 -0
- package/doc_build/static/js/async/zh_plugins_official-list_overview.js.map +1 -0
- package/doc_build/static/js/builder-runtime.js +1375 -0
- package/doc_build/static/js/builder-runtime.js.map +1 -0
- package/doc_build/static/js/lib-lodash.js +4907 -0
- package/doc_build/static/js/lib-lodash.js.map +1 -0
- package/doc_build/static/js/lib-polyfill.js +11847 -0
- package/doc_build/static/js/lib-polyfill.js.map +1 -0
- package/doc_build/static/js/lib-react.js +39510 -0
- package/doc_build/static/js/lib-react.js.map +1 -0
- package/doc_build/static/js/main.js +8563 -0
- package/doc_build/static/js/main.js.map +1 -0
- 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
- 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
- package/doc_build/static/search_index.json +1 -0
- package/docs/.island/dist/404.html +41 -0
- package/docs/.island/dist/assets/asset.26aea654.js +160 -0
- package/docs/.island/dist/assets/asset.36e3d3c9.js +160 -0
- package/docs/.island/dist/assets/before-getting-started.0e863740.js +87 -0
- package/docs/.island/dist/assets/before-getting-started.2c6e6b8a.js +87 -0
- package/docs/.island/dist/assets/build-config.460d11d9.js +804 -0
- package/docs/.island/dist/assets/build-config.e155e534.js +854 -0
- package/docs/.island/dist/assets/build-preset.6c2c6c62.js +256 -0
- package/docs/.island/dist/assets/build-preset.d3da921d.js +256 -0
- package/docs/.island/dist/assets/build-umd.ba00f028.js +264 -0
- package/docs/.island/dist/assets/build-umd.edb9d163.js +273 -0
- package/docs/.island/dist/assets/command-preview.1dc93921.js +264 -0
- package/docs/.island/dist/assets/command-preview.ef7a9d01.js +264 -0
- package/docs/.island/dist/assets/components.esm.03560353.js +9 -0
- package/docs/.island/dist/assets/copy.28dc4d5f.js +277 -0
- package/docs/.island/dist/assets/copy.f4625565.js +277 -0
- package/docs/.island/dist/assets/design-system.8993234c.js +1254 -0
- package/docs/.island/dist/assets/design-system.b0ba163f.js +639 -0
- package/docs/.island/dist/assets/dev.b373b152.js +37 -0
- package/docs/.island/dist/assets/dev.b39fd42a.js +37 -0
- package/docs/.island/dist/assets/down.f35427d3.svg +1 -0
- package/docs/.island/dist/assets/extension.4bf3526b.js +1 -0
- package/docs/.island/dist/assets/extension.d64ed0b8.js +469 -0
- package/docs/.island/dist/assets/external-dependency.2ede7532.js +156 -0
- package/docs/.island/dist/assets/external-dependency.92ca89e0.js +156 -0
- package/docs/.island/dist/assets/getting-started.822cf0b2.js +117 -0
- package/docs/.island/dist/assets/getting-started.e2764829.js +114 -0
- package/docs/.island/dist/assets/github.3bf8ccee.svg +1 -0
- package/docs/.island/dist/assets/in-depth-about-build.94cc902d.js +375 -0
- package/docs/.island/dist/assets/in-depth-about-build.aa74de10.js +374 -0
- package/docs/.island/dist/assets/in-depth-about-dev-command.877bdb83.js +33 -0
- package/docs/.island/dist/assets/in-depth-about-dev-command.9736befd.js +39 -0
- package/docs/.island/dist/assets/index.01786ba7.js +30 -0
- package/docs/.island/dist/assets/index.6cef6f5f.js +4 -0
- package/docs/.island/dist/assets/index.cb118238.js +36 -0
- package/docs/.island/dist/assets/index.ccb6ce27.js +4 -0
- package/docs/.island/dist/assets/island_inject.69495876.js +1 -0
- package/docs/.island/dist/assets/island_inject.cdfb22d9.js +1 -0
- package/docs/.island/dist/assets/loading.8c9bb911.svg +1 -0
- package/docs/.island/dist/assets/modify-output-product.9e2394d7.js +100 -0
- package/docs/.island/dist/assets/modify-output-product.f363845a.js +100 -0
- package/docs/.island/dist/assets/moon.6b705924.svg +3 -0
- package/docs/.island/dist/assets/plugin.70a61997.js +42 -0
- package/docs/.island/dist/assets/plugin.80b12ee2.js +42 -0
- package/docs/.island/dist/assets/publish-your-project.7321c10e.js +164 -0
- package/docs/.island/dist/assets/publish-your-project.7326359f.js +166 -0
- package/docs/.island/dist/assets/right.89674cd7.svg +1 -0
- package/docs/.island/dist/assets/search.0aea6901.svg +1 -0
- package/docs/.island/dist/assets/search.11353245.js +222 -0
- package/docs/.island/dist/assets/search.a1b1cff3.js +3 -0
- package/docs/.island/dist/assets/search.f9025ced.js +3 -0
- package/docs/.island/dist/assets/style.09015a4b.css +1 -0
- package/docs/.island/dist/assets/style.2e5f7bc2.css +1970 -0
- package/docs/.island/dist/assets/sun.841dac10.svg +11 -0
- package/docs/.island/dist/assets/test-your-project.8ab2809e.js +190 -0
- package/docs/.island/dist/assets/test-your-project.9ae2a49e.js +190 -0
- package/docs/.island/dist/assets/test.2bfe276b.js +66 -0
- package/docs/.island/dist/assets/test.a2c00a3f.js +67 -0
- package/docs/.island/dist/assets/translator.b1077c44.svg +1 -0
- package/docs/.island/dist/assets/use-micro-generator.13c1a09f.js +60 -0
- package/docs/.island/dist/assets/use-micro-generator.dfe877f6.js +60 -0
- package/docs/.island/dist/assets/using-storybook.adb88cb8.js +260 -0
- package/docs/.island/dist/assets/using-storybook.b8e7dd04.js +260 -0
- package/docs/.island/dist/assets/welcome.94880043.js +13 -0
- package/docs/.island/dist/assets/welcome.b2140e7e.js +13 -0
- package/docs/.island/dist/assets/why-module-engineering-solution.bfe7981a.js +26 -0
- package/docs/.island/dist/assets/why-module-engineering-solution.e31cd19f.js +26 -0
- package/docs/.island/dist/chunk-COLCRJ2V.js +1 -0
- package/docs/.island/dist/chunk-K5FMOYDC.js +10 -0
- package/docs/.island/dist/chunk-WE42KMYS.js +26 -0
- package/docs/.island/dist/client-entry.js +3 -0
- package/docs/.island/dist/en/api/build-config.html +344 -0
- package/docs/.island/dist/en/api/build-preset.html +82 -0
- package/docs/.island/dist/en/api/design-system.html +155 -0
- package/docs/.island/dist/en/api/dev.html +45 -0
- package/docs/.island/dist/en/api/index.html +41 -0
- package/docs/.island/dist/en/api/plugin.html +48 -0
- package/docs/.island/dist/en/api/test.html +58 -0
- package/docs/.island/dist/en/guide/advance/asset.html +68 -0
- package/docs/.island/dist/en/guide/advance/build-umd.html +72 -0
- package/docs/.island/dist/en/guide/advance/copy.html +82 -0
- package/docs/.island/dist/en/guide/advance/extension.html +41 -0
- package/docs/.island/dist/en/guide/advance/external-dependency.html +71 -0
- package/docs/.island/dist/en/guide/advance/in-depth-about-build.html +148 -0
- package/docs/.island/dist/en/guide/advance/in-depth-about-dev-command.html +51 -0
- package/docs/.island/dist/en/guide/basic/before-getting-started.html +127 -0
- package/docs/.island/dist/en/guide/basic/command-preview.html +100 -0
- package/docs/.island/dist/en/guide/basic/modify-output-product.html +140 -0
- package/docs/.island/dist/en/guide/basic/publish-your-project.html +91 -0
- package/docs/.island/dist/en/guide/basic/test-your-project.html +72 -0
- package/docs/.island/dist/en/guide/basic/use-micro-generator.html +65 -0
- package/docs/.island/dist/en/guide/basic/using-storybook.html +113 -0
- package/docs/.island/dist/en/guide/intro/getting-started.html +76 -0
- package/docs/.island/dist/en/guide/intro/welcome.html +53 -0
- package/docs/.island/dist/en/guide/intro/why-module-engineering-solution.html +49 -0
- package/docs/.island/dist/en/index.html +42 -0
- package/docs/.island/dist/react-dom.js +1 -0
- package/docs/.island/dist/react-dom_client.js +1 -0
- package/docs/.island/dist/react.js +1 -0
- package/docs/.island/dist/react_jsx-runtime.js +10 -0
- package/docs/.island/dist/ssr-manifest.json +57 -0
- package/docs/.island/dist/test-result.png +0 -0
- package/docs/.island/dist/why-module-solution.png +0 -0
- package/docs/.island/dist/zh/api/build-config.html +361 -0
- package/docs/.island/dist/zh/api/build-preset.html +82 -0
- package/docs/.island/dist/zh/api/design-system.html +149 -0
- package/docs/.island/dist/zh/api/dev.html +46 -0
- package/docs/.island/dist/zh/api/index.html +41 -0
- package/docs/.island/dist/zh/api/plugin.html +48 -0
- package/docs/.island/dist/zh/api/test.html +59 -0
- package/docs/.island/dist/zh/guide/advance/asset.html +68 -0
- package/docs/.island/dist/zh/guide/advance/build-umd.html +72 -0
- package/docs/.island/dist/zh/guide/advance/copy.html +82 -0
- package/docs/.island/dist/zh/guide/advance/extension.html +127 -0
- package/docs/.island/dist/zh/guide/advance/external-dependency.html +71 -0
- package/docs/.island/dist/zh/guide/advance/in-depth-about-build.html +148 -0
- package/docs/.island/dist/zh/guide/advance/in-depth-about-dev-command.html +53 -0
- package/docs/.island/dist/zh/guide/basic/before-getting-started.html +127 -0
- package/docs/.island/dist/zh/guide/basic/command-preview.html +100 -0
- package/docs/.island/dist/zh/guide/basic/modify-output-product.html +140 -0
- package/docs/.island/dist/zh/guide/basic/publish-your-project.html +92 -0
- package/docs/.island/dist/zh/guide/basic/test-your-project.html +72 -0
- package/docs/.island/dist/zh/guide/basic/use-micro-generator.html +65 -0
- package/docs/.island/dist/zh/guide/basic/using-storybook.html +114 -0
- package/docs/.island/dist/zh/guide/intro/getting-started.html +79 -0
- package/docs/.island/dist/zh/guide/intro/welcome.html +53 -0
- package/docs/.island/dist/zh/guide/intro/why-module-engineering-solution.html +49 -0
- package/docs/.island/dist/zh/index.html +42 -0
- package/docs/en/api/config/build-config.md +20 -10
- package/docs/en/api/config/build-preset.md +3 -2
- package/docs/en/api/config/design-system.md +623 -615
- package/docs/en/api/config/plugins.md +2 -2
- package/docs/en/api/config/testing.md +2 -1
- package/docs/en/api/plugin-api/plugin-hooks.md +1 -1
- package/docs/en/guide/advance/asset.mdx +1 -5
- package/docs/en/guide/advance/build-umd.mdx +6 -6
- package/docs/en/guide/advance/copy.md +5 -5
- package/docs/en/guide/advance/external-dependency.mdx +2 -2
- package/docs/en/guide/advance/in-depth-about-build.md +21 -20
- package/docs/en/guide/advance/in-depth-about-dev-command.md +3 -2
- package/docs/en/guide/advance/theme-config.mdx +2 -2
- package/docs/en/guide/basic/before-getting-started.md +17 -10
- package/docs/en/guide/basic/command-preview.md +4 -4
- package/docs/en/guide/basic/modify-output-product.md +65 -68
- package/docs/en/guide/basic/publish-your-project.md +4 -4
- package/docs/en/guide/basic/test-your-project.mdx +6 -6
- package/docs/en/guide/basic/use-micro-generator.md +13 -5
- package/docs/en/guide/basic/using-storybook.mdx +4 -14
- package/docs/en/guide/best-practices/components.mdx +103 -97
- package/docs/en/guide/intro/getting-started.md +3 -3
- package/docs/en/index.md +14 -17
- package/docs/en/plugins/guide/getting-started.mdx +4 -4
- package/docs/en/plugins/guide/plugin-object.mdx +5 -5
- package/docs/en/plugins/guide/setup-function.mdx +2 -2
- package/docs/zh/api/config/_category_.json +1 -1
- package/docs/zh/api/config/build-config.md +33 -10
- package/docs/zh/api/config/build-preset.md +3 -2
- package/docs/zh/api/config/design-system.md +2 -2
- package/docs/zh/api/config/plugins.md +3 -3
- package/docs/zh/api/config/testing.md +3 -2
- package/docs/zh/api/index.md +1 -0
- package/docs/zh/api/plugin-api/_category_.json +1 -1
- package/docs/zh/api/plugin-api/plugin-hooks.md +56 -55
- package/docs/zh/guide/advance/asset.mdx +1 -6
- package/docs/zh/guide/advance/build-umd.mdx +6 -6
- package/docs/zh/guide/advance/copy.md +5 -5
- package/docs/zh/guide/advance/external-dependency.mdx +3 -3
- package/docs/zh/guide/advance/in-depth-about-build.md +21 -20
- package/docs/zh/guide/advance/in-depth-about-dev-command.md +3 -2
- package/docs/zh/guide/advance/theme-config.mdx +2 -2
- package/docs/zh/guide/basic/before-getting-started.md +16 -9
- package/docs/zh/guide/basic/command-preview.md +4 -4
- package/docs/zh/guide/basic/modify-output-product.md +45 -47
- package/docs/zh/guide/basic/publish-your-project.md +4 -4
- package/docs/zh/guide/basic/test-your-project.mdx +6 -6
- package/docs/zh/guide/basic/use-micro-generator.md +10 -6
- package/docs/zh/guide/basic/using-storybook.mdx +12 -20
- package/docs/zh/guide/best-practices/components.mdx +10 -10
- package/docs/zh/guide/intro/getting-started.md +3 -3
- package/docs/zh/index.md +1 -1
- package/docs/zh/plugins/guide/getting-started.mdx +5 -5
- package/docs/zh/plugins/guide/plugin-object.mdx +5 -5
- package/docs/zh/plugins/guide/setup-function.mdx +2 -2
- package/modern.config.ts +15 -8
- package/package.json +4 -4
|
@@ -1,143 +1,140 @@
|
|
|
1
1
|
---
|
|
2
2
|
sidebar_position: 3
|
|
3
3
|
---
|
|
4
|
-
# modify-output-product
|
|
5
4
|
|
|
6
|
-
## Modify output product
|
|
5
|
+
## Modify the output product
|
|
7
6
|
|
|
8
7
|
## Default output products
|
|
9
8
|
|
|
10
|
-
When the `modern build` command is used in an initialized project, the products are generated according to the default configuration supported by Module Tools. The default supported configurations are as follows.
|
|
9
|
+
When the `modern build` command is used in an initialized project, the products are generated according to the default configuration supported by Module Tools. The default supported configurations are specified as follows.
|
|
11
10
|
|
|
12
11
|
```typescript
|
|
13
|
-
import { defineConfig } from '@modern-js/module-tools';
|
|
12
|
+
import moduleTools, { defineConfig } from '@modern-js/module-tools';
|
|
14
13
|
|
|
15
14
|
export default defineConfig({
|
|
16
|
-
|
|
15
|
+
plugins: [moduleTools()],
|
|
16
|
+
buildPreset: 'npm-library',
|
|
17
17
|
});
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
**The default
|
|
21
|
-
|
|
22
|
-
- The code format is [CommonJS](https://nodejs.org/api/modules.html#modules-commonjs-modules), or simply `cjs`.
|
|
23
|
-
- Code syntax is supported up to `ES6`.
|
|
24
|
-
- All code is packaged into a single file, i.e. **bundle** processing is performed.
|
|
25
|
-
- The output root directory is the `dist` directory under the project, and the output directory for type files is `dist/types`.
|
|
26
|
-
|
|
27
|
-
:::tip
|
|
20
|
+
**The default generation product has the following characteristics**.
|
|
28
21
|
|
|
29
|
-
|
|
30
|
-
|
|
22
|
+
- will generate [CommonJS](https://nodejs.org/api/modules.html#modules-commonjs-modules) and [ESM](https://nodejs.org/api/esm.html#modules- ecmascript-modules).
|
|
23
|
+
- The code syntax is supported up to `ES6` , and more advanced syntax will be converted.
|
|
24
|
+
- All code is packaged into one file, i.e. **bundle** processing is performed.
|
|
25
|
+
- The output root directory is the `dist` directory under the project, and the type file output directory is `dist/types`.
|
|
31
26
|
|
|
32
|
-
You may have the following questions when you see this
|
|
27
|
+
You may have the following questions when you see this.
|
|
33
28
|
|
|
34
29
|
1. what is `buildPreset`?
|
|
35
|
-
2. what determines these characteristics of the
|
|
30
|
+
2. what determines these characteristics of the product?
|
|
36
31
|
|
|
37
32
|
Then the next step is to first explain `buildPreset`.
|
|
38
33
|
|
|
39
34
|
## buildPreset
|
|
40
35
|
|
|
41
|
-
`buildPreset` represents one or more sets of build-related configurations prepared in advance. By using the corresponding preset values of `buildPreset`, you can eliminate the troublesome and complicated configuration work and get the expected product.
|
|
36
|
+
The `buildPreset` represents one or more sets of build-related configurations prepared in advance. By using the corresponding preset values of the `buildPreset`, you can eliminate the troublesome and complicated configuration work and get the expected product.
|
|
42
37
|
|
|
43
|
-
### String form of
|
|
38
|
+
### String form of build preset
|
|
44
39
|
|
|
45
40
|
The value of a **build preset can be in the form of a string**, so a build preset of this form is called a preset string.
|
|
46
41
|
|
|
47
|
-
The module engineering solution provides generic build preset strings and corresponding variants, depending on the generic scenario in which the npm package is used. All currently supported preset strings can be viewed via the [BuildPreset API](/
|
|
42
|
+
The module engineering solution provides generic build preset strings and corresponding variants, depending on the generic scenario in which the npm package is used. All currently supported preset strings can be viewed via the [BuildPreset API](/api/config/build-preset). Here is an explanation about the relationship between **generic preset strings and variants**.
|
|
48
43
|
|
|
49
|
-
Among the generic preset strings, `"npm-library"` can be used in the scenario of developing npm packages of the library type, which is suitable for most common module type projects. When `"npm-library"` is set, the output product of the project will have the following characteristics
|
|
44
|
+
Among the generic preset strings, `"npm-library"` can be used in the scenario of developing npm packages of the library type, which is suitable for most common module type projects. When `"npm-library"` is set, the output product of the project will have the following characteristics.
|
|
50
45
|
|
|
51
|
-
- In the `dist/lib` directory you will get
|
|
52
|
-
- In the `dist/es` directory, you get code in the format `esm`, with syntax support up to `es6` and
|
|
46
|
+
- In the `dist/lib` directory you will get code formatted as `cjs`, syntax supported up to `es6` and packaged.
|
|
47
|
+
- In the `dist/es` directory, you get code in the format `esm`, with syntax support up to `es6` and after packaging.
|
|
53
48
|
- In the `dist/types` directory, you get the type files. If it is not a TypeScript project, there is no such directory.
|
|
54
49
|
|
|
55
|
-
The default string `"npm-library"` is a variant of the original product with modified **code
|
|
50
|
+
The default string `"npm-library"` is a variant of the original product with a modified **code syntax support** feature and a string naming change to `"npm-library-[es5 | es2016.... . es2020 | esnext]"`.
|
|
56
51
|
|
|
57
|
-
For example, if the output product is based on the preset string `"npm-library"` and the syntax supported by the product code is changed to `
|
|
52
|
+
For example, if the output product is based on the preset string `"npm-library"` and the syntax supported by the product code is changed to `es5`, then simply changing `"npm-library"` to `"npm-library-es5"` would be sufficient.
|
|
58
53
|
|
|
59
|
-
###
|
|
54
|
+
### Build pre-defined function forms
|
|
60
55
|
|
|
61
56
|
**In addition to the string form, the value of a build preset can also be in the form of a function, where the specific configuration corresponding to a preset value can be printed or modified**.
|
|
62
57
|
|
|
63
|
-
For example,
|
|
58
|
+
For example, to achieve the same effect as the preset string ``npm-library-es5"` using the form of a preset function, you can do the following.
|
|
64
59
|
|
|
65
60
|
```typescript
|
|
66
|
-
import { defineConfig } from
|
|
61
|
+
import { defineConfig } from '@modern-js/module-tools';
|
|
67
62
|
|
|
68
63
|
export default defineConfig({
|
|
69
64
|
buildPreset({ preset }) {
|
|
70
65
|
return preset.NPM_LIBRARY.map(config => {
|
|
71
|
-
return { ... .config, target: '
|
|
66
|
+
return { ... .config, target: 'es5' }
|
|
72
67
|
});
|
|
73
68
|
},
|
|
74
69
|
});
|
|
75
70
|
```
|
|
76
71
|
|
|
77
|
-
In the above code implementation, `preset.NPM_LIBRARY` corresponds to the preset string `"npm-library"`, which represents the `"npm-library"` equivalent of a multi-group build-related configuration. We traverse the `NPM_LIBRARY` array, which contains multiple `buildConfig` objects, with the `map` method. We make a shallow copy of the original `buildConfig` object and modify the shallow copy to get `buildConfig.target`, specifying it as `
|
|
72
|
+
In the above code implementation, `preset.NPM_LIBRARY` corresponds to the preset string `"npm-library"`, which represents the `"npm-library"` equivalent of a multi-group build-related configuration. We traverse the `NPM_LIBRARY` array, which contains multiple `buildConfig` objects, with the `map` method. We make a shallow copy of the original `buildConfig` object and modify the shallow copy to get `buildConfig.target`, specifying it as `es5`.
|
|
78
73
|
|
|
79
|
-
>
|
|
74
|
+
> NPM_LIBRARY`, you can check it with [BuildPreset API](/api/config/build-preset). The`preset`object contains not only`NPM_LIBRARY`, but also other similar constants.
|
|
80
75
|
|
|
81
|
-
So what is the `buildConfig` object here?
|
|
76
|
+
So what is the `buildConfig` object here? What is the basis for the build product feature mentioned before?
|
|
82
77
|
|
|
83
|
-
|
|
78
|
+
Let's explain next.
|
|
84
79
|
|
|
85
80
|
## Build configuration (object)
|
|
86
81
|
|
|
87
|
-
**`buildConfig` is a configuration object that describes how to compile and generate build products**. What was mentioned at the beginning about "_features of build products_" are actually properties supported by `buildConfig`. The currently supported properties cover the needs of most module type projects when building products. `buildConfig` not only contains some
|
|
82
|
+
**`buildConfig` is a configuration object that describes how to compile and generate build products**. What was mentioned at the beginning about "_features of build products_" are actually properties supported by `buildConfig`. The currently supported properties cover the needs of most module type projects when building products. `buildConfig` not only contains some properties that products have, but also contains some features needed to build products. The following is a brief list from a classification point of view.
|
|
88
83
|
|
|
89
84
|
**The basic attributes of a build product include:**
|
|
90
85
|
|
|
91
|
-
- Whether the product is packaged or not: the corresponding API is [`buildConfig.buildType`](/
|
|
92
|
-
- Product support for syntax: the corresponding API is [`buildConfig.target`](/
|
|
93
|
-
- Output format:
|
|
94
|
-
- How
|
|
95
|
-
- How the sourceMap of the product is handled: the corresponding API is [`buildConfig.sourceMap`](/
|
|
96
|
-
- The input (or source file) corresponding to the output: the corresponding API is [`buildConfig.input`](/
|
|
97
|
-
- The directory of the output of the product: the corresponding API is [`buildConfig.outDir`](/
|
|
98
|
-
-
|
|
86
|
+
- Whether the product is packaged or not: the corresponding API is [`buildConfig.buildType`](/api/config/build-config#buildtype).
|
|
87
|
+
- Product support for syntax: the corresponding API is [`buildConfig.target`](/api/config/build-config#target).
|
|
88
|
+
- Output format: the corresponding API is [`buildConfig.format`](/api/config/build-config#format).
|
|
89
|
+
- How the output type file is handled: the corresponding API is [`buildConfig.dts`](/api/config/build-config#dts).
|
|
90
|
+
- How the sourceMap of the product is handled: the corresponding API is [`buildConfig.sourceMap`](/api/config/build-config#sourcemap).
|
|
91
|
+
- The input (or source file) corresponding to the output: the corresponding API is [`buildConfig.input`](/api/config/build-config#input).
|
|
92
|
+
- The directory of the output of the product: the corresponding API is [`buildConfig.outDir`](/api/config/build-config#outDir).
|
|
93
|
+
- Build source directory: the corresponding API is [`buildConfig.sourceDir`](/api/config/build-config#sourcedir).
|
|
99
94
|
|
|
100
|
-
**Common functions
|
|
95
|
+
**Common functions required for build products include:**
|
|
101
96
|
|
|
102
|
-
- Alias: The corresponding API is [`buildConfig.alias`](/
|
|
103
|
-
- Static resource handling:
|
|
97
|
+
- Alias: The corresponding API is [`buildConfig.alias`](/api/config/build-config#alias).
|
|
98
|
+
- Static resource handling: the corresponding API is [`buildConfig.asset`](/api/config/build-config#asset).
|
|
104
99
|
- Third-party dependency handling: The corresponding APIs are
|
|
105
|
-
- [`buildConfig.autoExternal`](/
|
|
106
|
-
- [`buildConfig.externals`](/
|
|
107
|
-
- Copy: The corresponding API is [`buildConfig.copy`](/
|
|
108
|
-
- Global variable substitution: the corresponding API is [`buildConfig.define`](/
|
|
109
|
-
- Specify [JSX](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html) compilation method, the corresponding API is [`buildConfig.jsx`](/
|
|
100
|
+
- [`buildConfig.autoExternal`](/api/config/build-config#autoexternal).
|
|
101
|
+
- [`buildConfig.externals`](/api/config/build-config#externals).
|
|
102
|
+
- Copy: The corresponding API is [`buildConfig.copy`](/api/config/build-config#copy).
|
|
103
|
+
- Global variable substitution: the corresponding API is [`buildConfig.define`](/api/config/build-config#define).
|
|
104
|
+
- Specify [JSX](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html) compilation method, the corresponding API is [`buildConfig.jsx`](/api/config/ build-config#jsx).
|
|
110
105
|
|
|
111
106
|
**Some advanced properties or less frequently used functions:**
|
|
112
107
|
|
|
113
|
-
- Product code compression: The corresponding API is [`buildConfig.minify`](/
|
|
114
|
-
- Code splitting: [`buildConfig.splitting`](/
|
|
115
|
-
- Specify whether the build product is for the NodeJS environment or the browser environment: the corresponding API is [`buildConfig.platform`](/
|
|
108
|
+
- Product code compression: The corresponding API is [`buildConfig.minify`](/api/config/build-config#minify).
|
|
109
|
+
- Code splitting: [`buildConfig.splitting`](/api/config/build-config#splitting)
|
|
110
|
+
- Specify whether the build product is for the NodeJS environment or the browser environment: the corresponding API is [`buildConfig.platform`](/api/config/build-config#platform).
|
|
116
111
|
- umd product-related.
|
|
117
|
-
- Specifies the global variables imported externally to the umd product: the corresponding API is [`buildConfig.umdGlobals`](/
|
|
118
|
-
- Specify the module name of the umd product: the corresponding API is [`buildConfig.umdModuleName`](/
|
|
112
|
+
- Specifies the global variables imported externally to the umd product: the corresponding API is [`buildConfig.umdGlobals`](/api/config/build-config#umdglobals).
|
|
113
|
+
- Specify the module name of the umd product: the corresponding API is [`buildConfig.umdModuleName`](/api/config/build-config#umdmodulename).
|
|
119
114
|
|
|
120
|
-
In addition to the above categories, frequently asked questions and best practices about these APIs can be found at the following links
|
|
115
|
+
In addition to the above categories, frequently asked questions and best practices about these APIs can be found at the following links
|
|
121
116
|
|
|
122
|
-
- [What are `bundle` and `bundleless`?](/
|
|
123
|
-
- [
|
|
124
|
-
- [
|
|
125
|
-
- [
|
|
126
|
-
- [How to handle third-party dependencies?](/
|
|
127
|
-
- [How to use copy?](/
|
|
128
|
-
-
|
|
129
|
-
- [The capabilities currently supported by static resources.](/
|
|
117
|
+
- [What are `bundle` and `bundleless`?](/guide/advance/in-depth-about-build#bundle- and-bundleless)
|
|
118
|
+
- [Relationship of `input` to `sourceDir`](/guide/advance/in-depth-about-build#input- to -sourcedir-)
|
|
119
|
+
- [Multiple ways to generate type files in product](/guide/advance/in-depth-about-build#type-files).
|
|
120
|
+
- [`buildConfig.define` Different ways to use it for different scenarios.](/guide/advance/in-depth-about-build#buildconfigdefine - How to use it for different scenarios)
|
|
121
|
+
- [How to handle third-party dependencies?](/guide/advance/external-dependency)
|
|
122
|
+
- [How to use copy?](/guide/advance/copy)
|
|
123
|
+
- How do I build umd products? (/guide/advance/build-umd# sets the global variable name of the project)
|
|
124
|
+
- [The capabilities currently supported by static resources.](/guide/advance/asset)
|
|
130
125
|
|
|
131
126
|
## When to use `buildConfig`
|
|
132
127
|
|
|
133
|
-
`buildConfig` is one of the
|
|
128
|
+
`buildConfig` is one of the methods used to modify the product, **only `buildConfig` will take effect when configured in conjunction with `buildPreset`**. So if configured as follows.
|
|
134
129
|
|
|
135
130
|
```typescript
|
|
136
131
|
import { defineConfig } from '@modern-js/module-tools';
|
|
137
132
|
|
|
138
133
|
export default defineConfig({
|
|
139
|
-
buildConfig:
|
|
140
|
-
|
|
134
|
+
buildConfig: {
|
|
135
|
+
format: 'umd',
|
|
136
|
+
},
|
|
137
|
+
buildPreset: 'npm-library',
|
|
141
138
|
});
|
|
142
139
|
```
|
|
143
140
|
|
|
@@ -149,4 +146,4 @@ Since both 'buildConfig' and 'buildPreset' are present, only the 'buildConfig' c
|
|
|
149
146
|
|
|
150
147
|
The set or sets of build-related configurations represented by `buildPreset` are composed of `buildConfig`, **which can be used to customize output products** when the current project needs cannot be met using `buildPreset`.
|
|
151
148
|
|
|
152
|
-
The process of using `buildConfig` is the process of thinking about
|
|
149
|
+
The process of using `buildConfig` is the process of thinking about **what kind of build product to get**.
|
|
@@ -20,7 +20,7 @@ An npm-type module project release process consists of two phases.
|
|
|
20
20
|
|
|
21
21
|
Once these changes have been made, the current changes need to be documented with the following command.
|
|
22
22
|
|
|
23
|
-
- [`modern change`](/
|
|
23
|
+
- [`modern change`](/guide/basic/command-preview#modern-change)
|
|
24
24
|
|
|
25
25
|
Executing the `modern change` command asks the developer several questions and generates a change log based on the developer's answers. The changelog file contains the type of change and its description, and is committed to the git repository.
|
|
26
26
|
|
|
@@ -53,7 +53,7 @@ publish test
|
|
|
53
53
|
|
|
54
54
|
When the project version needs to be updated, execute the following command.
|
|
55
55
|
|
|
56
|
-
- [`modern bump`](/
|
|
56
|
+
- [`modern bump`](/guide/basic/command-preview#modern-bump)
|
|
57
57
|
|
|
58
58
|
Executing `modern bump` will modify the version number in `package.json` based on the contents of the Markdown file in the `.changeset/` directory where the changes were recorded, and generate the `CHANGELOG.md` file. **These Markdown files are also deleted when the version update is complete, so they are "consumed "**.
|
|
59
59
|
|
|
@@ -71,7 +71,7 @@ Executing `modern bump` will modify the version number in `package.json` based o
|
|
|
71
71
|
|
|
72
72
|
To publish a project, you can execute the following command.
|
|
73
73
|
|
|
74
|
-
- [`modern publish`](/
|
|
74
|
+
- [`modern publish`](/guide/basic/command-preview#modern-release)
|
|
75
75
|
|
|
76
76
|
The `modern release` command publishes the project to the npm Registry.
|
|
77
77
|
|
|
@@ -89,7 +89,7 @@ However, if you want to change the version number of the current project to a pr
|
|
|
89
89
|
|
|
90
90
|
When a pre-release is needed before the official release, the following command is executed.
|
|
91
91
|
|
|
92
|
-
- [`modern pre`](/
|
|
92
|
+
- [`modern pre`](/guide/basic/command-preview#modern-pre)
|
|
93
93
|
|
|
94
94
|
First `modern pre enter <tag>` to enter pre-release mode, `<tag>` can be the same as the `tag` specified with the `modern release --tag` command when releasing the project.
|
|
95
95
|
|
|
@@ -8,9 +8,7 @@ This chapter will describe how to test modules.
|
|
|
8
8
|
|
|
9
9
|
## Prerequisites and conventions
|
|
10
10
|
|
|
11
|
-
To use the testing
|
|
12
|
-
|
|
13
|
-
- `"@modern-js/plugin-testing"`
|
|
11
|
+
To use the testing features of the project, you need to make sure that the project contains the dependency: `"@modern-js/plugin-testing"` , which can be done with [modern new](/guide/basic/command-preview#modern-new).
|
|
14
12
|
|
|
15
13
|
In the module engineering scheme, the following conventions are in place for test cases, or files for writing tests:
|
|
16
14
|
|
|
@@ -37,7 +35,7 @@ After execution, you will see the results of the test:
|
|
|
37
35
|
|
|
38
36
|
The Module Engineering Program provides the following configurations for testing.
|
|
39
37
|
|
|
40
|
-
- [`testing`](/
|
|
38
|
+
- [`testing`](/api/config/testing)
|
|
41
39
|
|
|
42
40
|
You can add it in `modern.config.(j|t)s`.
|
|
43
41
|
|
|
@@ -99,10 +97,12 @@ npm run test
|
|
|
99
97
|
|
|
100
98
|
### Components
|
|
101
99
|
|
|
102
|
-
|
|
100
|
+
{/* 链接待补充 */}
|
|
101
|
+
|
|
102
|
+
For components, Modern.js's Runtime API provides functionality for testing UI components, which is provided by `@modern-js/runtime/testing`.
|
|
103
103
|
|
|
104
104
|
:::tip
|
|
105
|
-
If you need to use the Runtime API, then you can turn it on via [microgenerator](/
|
|
105
|
+
If you need to use the Runtime API, then you can turn it on via [microgenerator](/guide/basic/command-preview).
|
|
106
106
|
:::
|
|
107
107
|
|
|
108
108
|
<CH.Spotlight>
|
|
@@ -12,7 +12,11 @@ The Module Engineering solution provides the Microgenerator tool, which allows f
|
|
|
12
12
|
|
|
13
13
|
Thus with these capabilities, **Microgenerator can enable additional feature functionality for the project**.
|
|
14
14
|
|
|
15
|
-
The microgenerator can be started via [`modern new`](/
|
|
15
|
+
The microgenerator can be started via [`modern new`](/guide/basic/command-preview). The current Microgenerator features supported by the Module Engineering program are:
|
|
16
|
+
|
|
17
|
+
## Test
|
|
18
|
+
|
|
19
|
+
When we want to test some modules, we can enable the test test feature. When this feature is enabled, **a `tests` directory and related files will be created in the project directory, and a new `"@modern-js/plugin-testing"` dependency will be added to package.json**.
|
|
16
20
|
|
|
17
21
|
## Storybook
|
|
18
22
|
|
|
@@ -20,8 +24,8 @@ The **Storybook feature** can be enabled when we want to debug a component or a
|
|
|
20
24
|
|
|
21
25
|
For more information on how to start Storybook and how to use it, check out the following link.
|
|
22
26
|
|
|
23
|
-
- [`modern dev`](/en/guide/command-preview#modern-dev)
|
|
24
|
-
- [using Storybook](
|
|
27
|
+
- [`modern dev`](/en/guide/basic/command-preview#modern-dev)
|
|
28
|
+
- [`using Storybook`](/en/guide/basic/using-storybook)
|
|
25
29
|
|
|
26
30
|
## Tailwind CSS support
|
|
27
31
|
|
|
@@ -29,10 +33,14 @@ This can be enabled when we want to add [Tailwind CSS](https://v2.tailwindcss.co
|
|
|
29
33
|
|
|
30
34
|
For more information on how to use Tailwind CSS in your module projects, check out.
|
|
31
35
|
|
|
32
|
-
|
|
36
|
+
<!-- 链接待补充 -->
|
|
37
|
+
|
|
38
|
+
- Using Tailwind CSS
|
|
33
39
|
|
|
34
40
|
## Modern.js Runtime API
|
|
35
41
|
|
|
36
|
-
|
|
42
|
+
<!-- 链接待补充 -->
|
|
43
|
+
|
|
44
|
+
**Modern.js provides Runtime API capabilities that can only be used in the Modern.js application project environment**. If you need to develop a component for use in a Modern.js application environment, then you can turn on this feature and the microgenerator will add the `"@modern-js/runtime"` dependency.
|
|
37
45
|
|
|
38
46
|
Also, the Storybook debugging tool will determine if the project needs to use the Runtime API by checking the project's dependencies and providing the same Runtime API runtime environment as the Modern.js application project.
|
|
@@ -6,8 +6,8 @@ sidebar_position: 5
|
|
|
6
6
|
|
|
7
7
|
First of all, if you haven't read the following, take a few minutes to understand it first.
|
|
8
8
|
|
|
9
|
-
- [use micro-generator to enable Storybook debugging](/en/guide/use-micro-generator#storybook-debug)
|
|
10
|
-
- [`modern dev`](/en/guide/command-preview#modern-dev)
|
|
9
|
+
- [use micro-generator to enable Storybook debugging](/en/guide/basic/use-micro-generator#storybook-debug)
|
|
10
|
+
- [`modern dev`](/en/guide/basic/command-preview#modern-dev)
|
|
11
11
|
|
|
12
12
|
[Storybook](https://storybook.js.org/) is a tool dedicated to component debugging, providing around component development.
|
|
13
13
|
|
|
@@ -150,8 +150,6 @@ Not only is it impossible to verify that the component product is correct using
|
|
|
150
150
|
|
|
151
151
|
## Configure Storybook
|
|
152
152
|
|
|
153
|
-
### Configuration file
|
|
154
|
-
|
|
155
153
|
Storybook is officially configured for projects through a folder called `.storybook`, which contains various configuration files. **In a module project scenario, Storybook configuration files can be added to the `config/storybook` directory of the project.**
|
|
156
154
|
|
|
157
155
|
For more information on how to use the various Storybook configuration files, see the following links:
|
|
@@ -165,15 +163,7 @@ For more information on how to use the various Storybook configuration files, se
|
|
|
165
163
|
|
|
166
164
|
In the future we will consider whether these configurations can be allowed to be modified, but for now we are limiting their use to reduce unpredictable issues.
|
|
167
165
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
In addition to the configuration file, the module engineering solution also provides a `dev.storybook` configuration item in the `modern.config.(j|t)s` project configuration file.
|
|
171
|
-
|
|
172
|
-
The webpack configuration of Storybook can be modified via this configuration.
|
|
173
|
-
|
|
174
|
-
- [`dev.storybook.webpack`](xxx)
|
|
175
|
-
|
|
176
|
-
### Building Storybook Products
|
|
166
|
+
## Building Storybook Products
|
|
177
167
|
|
|
178
168
|
In addition to Storybook debugging of components or common modules, you can also perform Storybook build tasks with the following commands.
|
|
179
169
|
|
|
@@ -183,6 +173,6 @@ modern build --platform storybook
|
|
|
183
173
|
|
|
184
174
|
For the `modern build --platform` command you can see.
|
|
185
175
|
|
|
186
|
-
- [`modern build`](/en/guide/command-preview#modern-build)
|
|
176
|
+
- [`modern build`](/en/guide/basic/command-preview#modern-build)
|
|
187
177
|
|
|
188
178
|
After the build is complete, you can see the build product files in the `dist/storybook-static` directory.
|