@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
|
@@ -9,9 +9,9 @@ This chapter describes the configuration of the registered module-tools plugin.
|
|
|
9
9
|
- type: `Array<ModuleToolsPlugin>`
|
|
10
10
|
|
|
11
11
|
```js modern.config.ts
|
|
12
|
-
import {
|
|
12
|
+
import { examplePlugin } from '. /plugins/example';
|
|
13
13
|
export default defineConfig({
|
|
14
|
-
plugins: [
|
|
14
|
+
plugins: [examplePlugin()],
|
|
15
15
|
});
|
|
16
16
|
```
|
|
17
17
|
|
|
@@ -56,7 +56,7 @@ type Return = BuildConfig;
|
|
|
56
56
|
|
|
57
57
|
### `beforeBuildTask`
|
|
58
58
|
|
|
59
|
-
Based on the build configuration,
|
|
59
|
+
Based on the build configuration, Module Tools will split the overall build into multiple sub-build tasks. The Hook will be triggered before each build subtask.
|
|
60
60
|
|
|
61
61
|
``` ts
|
|
62
62
|
export default (): CliPlugin<ModuleTools> => ({
|
|
@@ -4,7 +4,7 @@ sidebar_position: 6
|
|
|
4
4
|
|
|
5
5
|
# Handle static resource files
|
|
6
6
|
|
|
7
|
-
The module project will handle static resources used in the code. If configuration is required, then the [`buildConfig.asset`](/en/api/build-config#asset) API can be used.
|
|
7
|
+
The module project will handle static resources used in the code. If configuration is required, then the [`buildConfig.asset`](/en/api/config/build-config#asset) API can be used.
|
|
8
8
|
|
|
9
9
|
## Default behavior
|
|
10
10
|
|
|
@@ -18,7 +18,6 @@ For the handling of static files, the module project currently supports the foll
|
|
|
18
18
|
|
|
19
19
|
- Set the static resource path to `. /assets`.
|
|
20
20
|
- For files over **10kb** they are inlined into the code.
|
|
21
|
-
- Use [SVGR](https://react-svgr.com/) for files with the `.svg` suffix.
|
|
22
21
|
|
|
23
22
|
Let us look at the following example:
|
|
24
23
|
|
|
@@ -144,6 +143,3 @@ If the size of `bg.png` is larger than 10 kb, then the product content will be.
|
|
|
144
143
|
|
|
145
144
|
</CH.Spotlight>
|
|
146
145
|
|
|
147
|
-
## SVGR
|
|
148
|
-
|
|
149
|
-
WIP
|
|
@@ -22,7 +22,7 @@ export default defineConfig({
|
|
|
22
22
|
|
|
23
23
|
## Third-party dependency handling for umd products
|
|
24
24
|
|
|
25
|
-
In the [[How to handle third-party dependencies]](/en/guide/advance/external-dependency) chapter, we know that we can control whether or not the project packages third-party dependencies via the [`autoExternals`](/en/api/build-config#autoexternal) and [`externals`](/en/api/build-config#externals) APIs.
|
|
25
|
+
In the [[How to handle third-party dependencies]](/en/guide/advance/external-dependency) chapter, we know that we can control whether or not the project packages third-party dependencies via the [`autoExternals`](/en/api/config/build-config#autoexternal) and [`externals`](/en/api/config/build-config#externals) APIs.
|
|
26
26
|
So when building umd products, we can also use it like this:
|
|
27
27
|
|
|
28
28
|
<CH.Spotlight>
|
|
@@ -110,7 +110,7 @@ We know from the above example that when using the `autoExternal` and `externals
|
|
|
110
110
|
- In a Node.js environment, you can get the react dependency with `require('react')`.
|
|
111
111
|
- In a browser environment, you can get the react dependency via `global.react`.
|
|
112
112
|
|
|
113
|
-
However, in the browser environment, when getting third-party dependencies, **global variable names are not necessarily identical to the dependency names**, so you have to use the [`buildConfig.umdGlobals`](/en/api/build-config#umdglobals) API.
|
|
113
|
+
However, in the browser environment, when getting third-party dependencies, **global variable names are not necessarily identical to the dependency names**, so you have to use the [`buildConfig.umdGlobals`](/en/api/config/build-config#umdglobals) API.
|
|
114
114
|
|
|
115
115
|
Again using the previous example, when the `react` dependency exists in the browser environment as a `windows.React` or `global.React` global variable, then:
|
|
116
116
|
|
|
@@ -164,7 +164,7 @@ console.info(React);
|
|
|
164
164
|
|
|
165
165
|
At this point we will see the product code like this.
|
|
166
166
|
|
|
167
|
-
```js dist/index.js focus=
|
|
167
|
+
```js dist/index.js focus=12:18
|
|
168
168
|
(function (global, factory) {
|
|
169
169
|
if (typeof module === 'object' && typeof module.exports === 'object')
|
|
170
170
|
factory();
|
|
@@ -203,7 +203,7 @@ export default () => {
|
|
|
203
203
|
|
|
204
204
|
** By default, the name of the source file is used as the name of the module's global variable in the browser. **For the above example, the product would read as follows:
|
|
205
205
|
|
|
206
|
-
```js ./dist/index.js focus=
|
|
206
|
+
```js ./dist/index.js focus=9:9
|
|
207
207
|
(function (global, factory) {
|
|
208
208
|
if (typeof module === 'object' && typeof module.exports === 'object')
|
|
209
209
|
factory(exports);
|
|
@@ -218,7 +218,7 @@ export default () => {
|
|
|
218
218
|
});
|
|
219
219
|
```
|
|
220
220
|
|
|
221
|
-
If you need to modify it, you need to use the [`buildConfig.umdModuleName`](/en/api/build-config#umdmodulename) API.
|
|
221
|
+
If you need to modify it, you need to use the [`buildConfig.umdModuleName`](/en/api/config/build-config#umdmodulename) API.
|
|
222
222
|
|
|
223
223
|
When this API is used:
|
|
224
224
|
|
|
@@ -233,7 +233,7 @@ export default defineConfig({
|
|
|
233
233
|
|
|
234
234
|
The construction products at this point are:
|
|
235
235
|
|
|
236
|
-
```js ./dist/index.js focus=
|
|
236
|
+
```js ./dist/index.js focus=9:9
|
|
237
237
|
(function (global, factory) {
|
|
238
238
|
if (typeof module === 'object' && typeof module.exports === 'object')
|
|
239
239
|
factory(exports);
|
|
@@ -8,10 +8,10 @@ The Module Project provides the Copy utility for copying already existing indivi
|
|
|
8
8
|
|
|
9
9
|
## Understanding the Copy API
|
|
10
10
|
|
|
11
|
-
We can use the Copy tool via the [`buildConfig.copy`](/en/api/build-config#copy) API, which contains the following two main configurations.
|
|
11
|
+
We can use the Copy tool via the [`buildConfig.copy`](/en/api/config/build-config#copy) API, which contains the following two main configurations.
|
|
12
12
|
|
|
13
|
-
- [`patterns`](/en/api/build-config#copypatterns)
|
|
14
|
-
- [`options`](/en/api/build-config#copyoptions)
|
|
13
|
+
- [`patterns`](/en/api/config/build-config#copypatterns)
|
|
14
|
+
- [`options`](/en/api/config/build-config#copyoptions)
|
|
15
15
|
|
|
16
16
|
It is recommended to spend some time getting to know them before you start learning.
|
|
17
17
|
|
|
@@ -34,7 +34,7 @@ export default defineConfig({
|
|
|
34
34
|
});
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
`patterns.context` 一般和 `patterns.from` 配合使用,默认情况下它的值与 [`buildConfig.sourceDir`](/
|
|
37
|
+
`patterns.context` 一般和 `patterns.from` 配合使用,默认情况下它的值与 [`buildConfig.sourceDir`](/api/config/build-config#sourcedir) 相同,因此我们可以按照如下方式指定 `src/data.json` 文件为要复制的文件:
|
|
38
38
|
|
|
39
39
|
> 默认情况下,`buildConfig.sourceDir` 为 `src`
|
|
40
40
|
|
|
@@ -70,7 +70,7 @@ export default defineConfig({
|
|
|
70
70
|
});
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
-
`patterns.to` 用于指定复制文件的输出路径,默认情况下它的值为 [`buildConfig.outDir`](
|
|
73
|
+
`patterns.to` 用于指定复制文件的输出路径,默认情况下它的值为 [`buildConfig.outDir`](/api/config/build-config#outDir)对应的值。因此我们按照如下方式将 `src/index.html` 复制到 `dist` 目录下:
|
|
74
74
|
|
|
75
75
|
```ts
|
|
76
76
|
export default defineConfig({
|
|
@@ -81,8 +81,8 @@ So how do you enable the packaging of third-party dependencies in your module pr
|
|
|
81
81
|
|
|
82
82
|
The following APIs are provided in the build configuration to handle third-party dependencies:
|
|
83
83
|
|
|
84
|
-
- [`buildConfig.autoExternal`](/en/api/build-config#autoexternal)
|
|
85
|
-
- [`buildConfig.externals`](/en/api/build-config#externals)
|
|
84
|
+
- [`buildConfig.autoExternal`](/en/api/config/build-config#autoexternal)
|
|
85
|
+
- [`buildConfig.externals`](/en/api/config/build-config#externals)
|
|
86
86
|
|
|
87
87
|
### Turn off default behavior
|
|
88
88
|
|
|
@@ -9,8 +9,9 @@ In the [Basic Usage] section, we already knew that you can modify the output pro
|
|
|
9
9
|
:::tip{title=notes}
|
|
10
10
|
If you are not sure what `buildConfig` is, it is recommended to take some time to understand it by following this link.
|
|
11
11
|
|
|
12
|
-
- [[modify-output-product](/en/guide/modify-output-product)]
|
|
13
|
-
|
|
12
|
+
- [[modify-output-product](/en/guide/basic/modify-output-product)]
|
|
13
|
+
|
|
14
|
+
:::
|
|
14
15
|
|
|
15
16
|
In this chapter we'll dive into the use of certain build configurations and understand what happens when the `modern build` command is executed.
|
|
16
17
|
|
|
@@ -24,17 +25,17 @@ A Bundle is a package of build products, which may be a single file or multiple
|
|
|
24
25
|
|
|
25
26
|
Bundleless, on the other hand, means that each source file is compiled and built separately, but not packaged together. Each product file can be found with its corresponding source code file. The process of **Bundleless build can also be understood as the process of code conversion of source files only**.
|
|
26
27
|
|
|
27
|
-
In `buildConfig` you can specify whether the current build task is Bundle or Bundleless by using [`buildConfig.buildType`](/en/api/build-config#buildtype).
|
|
28
|
+
In `buildConfig` you can specify whether the current build task is Bundle or Bundleless by using [`buildConfig.buildType`](/en/api/config/build-config#buildtype).
|
|
28
29
|
|
|
29
30
|
### Relationship between `input` and `sourceDir`
|
|
30
31
|
|
|
31
|
-
[`buildConfig.input`](/en/api/build-config#input) is used to specify the file path or directory path where the source code is read, and its default value differs between Bundle and Bundleless builds.
|
|
32
|
+
[`buildConfig.input`](/en/api/config/build-config#input) is used to specify the file path or directory path where the source code is read, and its default value differs between Bundle and Bundleless builds.
|
|
32
33
|
|
|
33
34
|
- When `buildType: 'bundle'`, `input` defaults to `['src/index.ts']`
|
|
34
35
|
- When `buildType: 'bundleless'`, `input` defaults to `['src']`
|
|
35
36
|
> In fact, at `buildType: 'bundle'`, the build tool detects the existence of a file matching the name rule `src/index.(j|t)sx?` and uses it as an entry file.
|
|
36
37
|
|
|
37
|
-
:::
|
|
38
|
+
:::warning{title=notes}
|
|
38
39
|
It is recommended that you do not specify multiple source file directories during a Bundleless build, as unintended results may occur. Bundleless builds with multiple source directories are currently in an unstable stage.
|
|
39
40
|
:::
|
|
40
41
|
|
|
@@ -44,7 +45,7 @@ We know from the defaults: **Bundle builds can generally specify a file path as
|
|
|
44
45
|
|
|
45
46
|
In addition to setting `input` to an array, you can also set it to an object during the Bundle build process. **By using the object form, we can modify the name of the file that the build product outputs**. So for the following example, `. /src/index.ts` corresponds to the path of the build product file as `. /dist/main.js`.
|
|
46
47
|
|
|
47
|
-
```
|
|
48
|
+
```js modern.config.ts
|
|
48
49
|
import { defineConfig } from '@modern-js/module-tools';
|
|
49
50
|
|
|
50
51
|
export default defineConfig({
|
|
@@ -61,7 +62,7 @@ The Bundleless build process also supports such use, but it is not recommended.
|
|
|
61
62
|
|
|
62
63
|
#### `sourceDir`
|
|
63
64
|
|
|
64
|
-
[`sourceDir`](/en/api/build-config#sourcedir) is used to specify the source code directory, which is related to both.
|
|
65
|
+
[`sourceDir`](/en/api/config/build-config#sourcedir) is used to specify the source code directory, which is related to both.
|
|
65
66
|
|
|
66
67
|
- type file generation
|
|
67
68
|
- [`outbase`](https://esbuild.github.io/api/#outbase) for specifying the build process
|
|
@@ -73,13 +74,13 @@ In general:
|
|
|
73
74
|
|
|
74
75
|
### Declaration Type Files
|
|
75
76
|
|
|
76
|
-
The [`buildConfig.dts`](/en/api/build-config#dts) configuration is mainly used for type file generation.
|
|
77
|
+
The [`buildConfig.dts`](/en/api/config/build-config#dts) configuration is mainly used for type file generation.
|
|
77
78
|
|
|
78
79
|
#### Turn off type generation
|
|
79
80
|
|
|
80
81
|
Type generation is turned on by default, if you need to turn it off, you can configure it as follows:
|
|
81
82
|
|
|
82
|
-
```
|
|
83
|
+
```js modern.config.ts
|
|
83
84
|
import { defineConfig } from '@modern-js/module-tools';
|
|
84
85
|
|
|
85
86
|
export default defineConfig({
|
|
@@ -99,14 +100,14 @@ With `buildType: 'bundleless'`, type files are generated using the project's `ts
|
|
|
99
100
|
|
|
100
101
|
The **module engineering solution also supports packaging of type files**, although care needs to be taken when using this feature.
|
|
101
102
|
|
|
102
|
-
- Some third-party dependencies have incorrect syntax that can cause the packaging process to fail. So in this case, you need to exclude such third-party packages manually with [`buildConfig.externals`](/en/api/build-config#externals).
|
|
103
|
+
- Some third-party dependencies have incorrect syntax that can cause the packaging process to fail. So in this case, you need to exclude such third-party packages manually with [`buildConfig.externals`](/en/api/config/build-config#externals).
|
|
103
104
|
- It is not possible to handle the case where the type file of a third-party dependency points to a `.ts` file. For example, the `package.json` of a third-party dependency contains something like this: `{"types": ". /src/index.ts"}`.
|
|
104
105
|
|
|
105
106
|
#### Alias Conversion
|
|
106
107
|
|
|
107
108
|
During the Bundleless build process, if an alias appears in the source code, e.g.
|
|
108
109
|
|
|
109
|
-
```
|
|
110
|
+
```js ./src/index.ts
|
|
110
111
|
import utils from '@common/utils';
|
|
111
112
|
```
|
|
112
113
|
|
|
@@ -123,7 +124,7 @@ However, there are some cases that cannot be handled at this time.
|
|
|
123
124
|
|
|
124
125
|
General usage:
|
|
125
126
|
|
|
126
|
-
```
|
|
127
|
+
```js
|
|
127
128
|
import { defineConfig } from '@modern-js/module-tools';
|
|
128
129
|
|
|
129
130
|
export default defineConfig({
|
|
@@ -141,7 +142,7 @@ export default defineConfig({
|
|
|
141
142
|
|
|
142
143
|
For the use of `dts.only`:
|
|
143
144
|
|
|
144
|
-
```
|
|
145
|
+
```js
|
|
145
146
|
import { defineConfig } from '@modern-js/module-tools';
|
|
146
147
|
|
|
147
148
|
export default defineConfig({
|
|
@@ -165,11 +166,11 @@ export default defineConfig({
|
|
|
165
166
|
|
|
166
167
|
### `buildConfig.define` Usage for different scenarios
|
|
167
168
|
|
|
168
|
-
[`buildConfig.define`](/en/api/build-config#define) functions somewhat similar to [`webpack.DefinePlugin`](https://webpack.js.org/plugins/define-plugin/). A few usage scenarios are described here.
|
|
169
|
+
[`buildConfig.define`](/en/api/config/build-config#define) functions somewhat similar to [`webpack.DefinePlugin`](https://webpack.js.org/plugins/define-plugin/). A few usage scenarios are described here.
|
|
169
170
|
|
|
170
171
|
#### Environment variable replacement
|
|
171
172
|
|
|
172
|
-
```
|
|
173
|
+
```js
|
|
173
174
|
import { defineConfig } from '@modern-js/module-tools';
|
|
174
175
|
export default defineConfig({
|
|
175
176
|
buildConfig: {
|
|
@@ -182,21 +183,21 @@ export default defineConfig({
|
|
|
182
183
|
|
|
183
184
|
With the above configuration, we can put the following code.
|
|
184
185
|
|
|
185
|
-
```
|
|
186
|
+
```js
|
|
186
187
|
// pre-compiler code
|
|
187
188
|
console.log(process.env.VERSION);
|
|
188
189
|
```
|
|
189
190
|
|
|
190
191
|
When executing `VERSION=1.0.0 modern build`, the conversion is:
|
|
191
192
|
|
|
192
|
-
```
|
|
193
|
+
```js
|
|
193
194
|
// compiled code
|
|
194
195
|
console.log('1.0.0');
|
|
195
196
|
```
|
|
196
197
|
|
|
197
198
|
#### Global variable replacement
|
|
198
199
|
|
|
199
|
-
```
|
|
200
|
+
```js
|
|
200
201
|
import { defineConfig } from '@modern-js/module-tools';
|
|
201
202
|
export default defineConfig({
|
|
202
203
|
buildConfig: {
|
|
@@ -209,14 +210,14 @@ export default defineConfig({
|
|
|
209
210
|
|
|
210
211
|
With the above configuration, we can put the following code.
|
|
211
212
|
|
|
212
|
-
```
|
|
213
|
+
```js
|
|
213
214
|
// pre-compile code
|
|
214
215
|
console.log(VERSION);
|
|
215
216
|
```
|
|
216
217
|
|
|
217
218
|
Convert to:
|
|
218
219
|
|
|
219
|
-
```
|
|
220
|
+
```js
|
|
220
221
|
// post-compile code
|
|
221
222
|
console.log('1.0.0');
|
|
222
223
|
```
|
|
@@ -9,8 +9,9 @@ sidebar_position: 2
|
|
|
9
9
|
:::tip{title=注意}
|
|
10
10
|
如果你还不清楚 `buildConfig` 是什么,建议花一些时间通过下面的链接了解一下:
|
|
11
11
|
|
|
12
|
-
- 【[修改输出产物](/
|
|
13
|
-
|
|
12
|
+
- 【[修改输出产物](/guide/basic/modify-output-product)】
|
|
13
|
+
|
|
14
|
+
:::
|
|
14
15
|
|
|
15
16
|
而在本章里我们将要深入理解某些构建配置的使用以及了解执行 `modern build` 命令的时候发生了什么。
|
|
16
17
|
|
|
@@ -4,7 +4,7 @@ sidebar_position: 7
|
|
|
4
4
|
|
|
5
5
|
# Theme Configuration
|
|
6
6
|
|
|
7
|
-
The module project provides the ability to configure themes through the [`designSystem`](/en/api/design-system) API.
|
|
7
|
+
The module project provides the ability to configure themes through the [`designSystem`](/en/api/config/design-system) API.
|
|
8
8
|
|
|
9
9
|
## Motivation and rationale
|
|
10
10
|
|
|
@@ -17,7 +17,7 @@ The so-called `designToken` corresponds to different things in different style d
|
|
|
17
17
|
- `@apply` custom directive under css/less/sass to use a string with the same name as the HTML class name supported by tailwindcss.
|
|
18
18
|
- css/less/scss: Generate global style variables via `designSystem`.
|
|
19
19
|
|
|
20
|
-
The data structure of the `designSystem` API is borrowed from the [theme API](https://tailwindcss.com/docs/theme) in the `tailwindcss` configuration object, so a default set of `designToken` exists. For the default values, see the [`designSystem` API](/
|
|
20
|
+
The data structure of the `designSystem` API is borrowed from the [theme API](https://tailwindcss.com/docs/theme) in the `tailwindcss` configuration object, so a default set of `designToken` exists. For the default values, see the [`designSystem` API](/api/config/design-system).
|
|
21
21
|
|
|
22
22
|
:::info
|
|
23
23
|
The css/less/sass global variables are not supported yet.
|
|
@@ -6,7 +6,7 @@ sidebar_position: 1
|
|
|
6
6
|
|
|
7
7
|
## Environment preparation
|
|
8
8
|
|
|
9
|
-
In order to use the Modern.js module engineering solution, you first need [NodeJS](https://nodejs.org/zh/) engine, we recommend the latest [LTS version](https://github.com/nodejs/Release), and make sure the Node version is **>=14.
|
|
9
|
+
In order to use the Modern.js module engineering solution, you first need [NodeJS](https://nodejs.org/zh/) engine, we recommend the latest [LTS version](https://github.com/nodejs/Release), and make sure the Node version is **>=14.18.0**. because non-stable NodeJS releases frequently have bugs. You might consider installing via [nvm-windows](https://github.com/coreybutler/nvm-windows) and [nvm](https://github.com/nvm-sh/nvm) (Mac/linux), so you can easily switch to different NodeJS versions that might be required for different projects that you work on.
|
|
10
10
|
|
|
11
11
|
## Getting Started with npm
|
|
12
12
|
|
|
@@ -14,7 +14,7 @@ Once NodeJS is installed, not only can you access the `node` executable from the
|
|
|
14
14
|
|
|
15
15
|
Npm is the standard package manager for NodeJS. It started out as a tool for downloading and managing NodeJS package dependencies, but it has since evolved into a tool for front-end JavaScript.
|
|
16
16
|
|
|
17
|
-
**If you already know something about usage of npm and npm packages, then you can directly see [npm package manager](/en/guide/before-getting-started#npm-package-manager) section.**
|
|
17
|
+
**If you already know something about usage of npm and npm packages, then you can directly see [npm package manager](/en/guide/basic/before-getting-started#npm-package-manager) section.**
|
|
18
18
|
|
|
19
19
|
## npm package type project
|
|
20
20
|
|
|
@@ -71,6 +71,7 @@ Similarly, you can install **only packages needed for local development and test
|
|
|
71
71
|
```
|
|
72
72
|
|
|
73
73
|
**When installing or using third-party npm packages be sure to determine what they are for and whether they should be placed in `"dependencies"` or `"devDependencies"` by distinguishing between their types.**
|
|
74
|
+
|
|
74
75
|
:::tip
|
|
75
76
|
In general, packages that need to be used in source code are `dependencies` dependencies. Unless you are exporting dependent code locally via packaging, in which case it can be treated as a `devDependencies` dependency.
|
|
76
77
|
:::
|
|
@@ -161,25 +162,31 @@ npm install -g pnpm
|
|
|
161
162
|
|
|
162
163
|
## Module Tools configuration file
|
|
163
164
|
|
|
164
|
-
|
|
165
|
+
The Module Tools configuration file - `modern.config.(j|t)s` - is provided in the project directory of the module project created with `@modern-js/create`. However, the `modern.config` configuration file is not required to exist.
|
|
165
166
|
|
|
166
|
-
|
|
167
|
+
By default, the contents of the generated configuration file are as follows.
|
|
167
168
|
|
|
168
169
|
```typescript
|
|
169
170
|
// modern.config.ts
|
|
170
|
-
import { defineConfig } from '@modern-js/module-tools';
|
|
171
|
+
import moduleTools, { defineConfig } from '@modern-js/module-tools';
|
|
171
172
|
|
|
172
|
-
export default defineConfig({
|
|
173
|
+
export default defineConfig({
|
|
174
|
+
plugins: [moduleTools()],
|
|
175
|
+
buildPreset: 'npm-library',
|
|
176
|
+
});
|
|
173
177
|
```
|
|
174
178
|
|
|
175
179
|
```js
|
|
176
180
|
// modern.config.js
|
|
177
|
-
|
|
181
|
+
import moduleTools from '@modern-js/module-tools';
|
|
178
182
|
|
|
179
|
-
|
|
183
|
+
export default {
|
|
184
|
+
plugins: [moduleTools()],
|
|
185
|
+
buildPreset: 'npm-library',
|
|
186
|
+
};
|
|
180
187
|
```
|
|
181
188
|
|
|
182
|
-
**We recommend using the `defineConfig` function**, but it is not mandatory to use it. So you can also return an object directly in the
|
|
189
|
+
**We recommend using the `defineConfig` function**, but it is not mandatory to use it. So you can also return an object directly in the config file: the
|
|
183
190
|
|
|
184
191
|
```typescript
|
|
185
192
|
// modern.config.ts
|
|
@@ -188,5 +195,5 @@ export default {};
|
|
|
188
195
|
|
|
189
196
|
```js
|
|
190
197
|
// modern.config.js
|
|
191
|
-
|
|
198
|
+
export default {};
|
|
192
199
|
```
|
|
@@ -26,7 +26,7 @@ Options:
|
|
|
26
26
|
When you want to start a project build, you can execute the `modern build` command. When using this command, we can:
|
|
27
27
|
|
|
28
28
|
- When wanting to start a build in watch mode, use the `--watch` option.
|
|
29
|
-
- When you want to specify the path to the TypeScript configuration file read by the project build, use `-build --tsconfig . /path/config.json` option. This option overrides all [`buildConfig`](/
|
|
29
|
+
- When you want to specify the path to the TypeScript configuration file read by the project build, use `-build --tsconfig . /path/config.json` option. This option overrides all [`buildConfig`](/api/config/build-config) configurations in [`dts.tsconfigPath`](/api/config/build-config).
|
|
30
30
|
- The `-no-dts` option can be used when the DTS type file generation and type checking behavior of the project needs to be turned off. **Note: The generation of type files depends on the results of type checking. If type checking is turned off, then type files will not be generated either**.
|
|
31
31
|
- The `--no-clear` option can be used when the automatic clearing of the product output directory needs to be turned off.
|
|
32
32
|
|
|
@@ -55,11 +55,12 @@ The `modern new` command is used to start the microgenerator functionality, whic
|
|
|
55
55
|
|
|
56
56
|
The following features can currently be enabled.
|
|
57
57
|
|
|
58
|
+
- Testing support
|
|
58
59
|
- Storybook debugging
|
|
59
60
|
- Tailwind CSS support
|
|
60
61
|
- Modern.js Runtime API
|
|
61
62
|
|
|
62
|
-
You can learn more about these features in the [Using the micro generator](/
|
|
63
|
+
You can learn more about these features in the [Using the micro generator](/guide/basic/use-micro-generator) section.
|
|
63
64
|
|
|
64
65
|
## `modern dev`
|
|
65
66
|
|
|
@@ -88,6 +89,7 @@ Options:
|
|
|
88
89
|
-h, --help display help for command
|
|
89
90
|
```
|
|
90
91
|
|
|
92
|
+
You need to execute `modern new` to turn on the test function before you can execute the `modern test` command.
|
|
91
93
|
The `modern test` command will automatically run the `src/tests/*.test.(js|ts|jsx|tsx)` file as a test case.
|
|
92
94
|
|
|
93
95
|
## `modern lint`
|
|
@@ -204,5 +206,3 @@ Options:
|
|
|
204
206
|
The `modern upgrade` command is used to upgrade the project Modern.js related dependencies to the latest version.
|
|
205
207
|
|
|
206
208
|
Executing the command `npx modern upgrade` in the project root directory will update the Modern.js dependencies in `package.json` of the currently executing project to the latest version by default.
|
|
207
|
-
|
|
208
|
-
command is provided in `@modern-js/module-tools` version **>= 1.17.0**, previous versions can be upgraded using `npx @modern-js/upgrade`.
|