@modern-js/module-tools-docs 2.0.2 → 2.2.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/api/config/build-config.html +332 -0
- package/doc_build/api/config/build-preset.html +43 -0
- package/doc_build/api/config/design-system.html +103 -0
- package/doc_build/api/config/plugins.html +7 -0
- package/doc_build/api/config/testing.html +21 -0
- package/doc_build/api/index.html +1 -0
- package/doc_build/api/plugin-api/plugin-hooks.html +113 -0
- package/doc_build/en/api/config/build-config.html +316 -0
- package/doc_build/en/api/config/build-preset.html +43 -0
- package/doc_build/en/api/config/design-system.html +117 -0
- package/doc_build/en/api/config/plugins.html +7 -0
- package/doc_build/en/api/config/testing.html +21 -0
- package/doc_build/en/api/index.html +1 -0
- package/doc_build/en/api/plugin-api/plugin-hooks.html +113 -0
- package/doc_build/en/guide/advance/asset.html +25 -0
- package/doc_build/en/guide/advance/build-umd.html +32 -0
- package/doc_build/en/guide/advance/copy.html +42 -0
- package/doc_build/en/guide/advance/external-dependency.html +31 -0
- package/doc_build/en/guide/advance/in-depth-about-build.html +112 -0
- package/doc_build/en/guide/advance/in-depth-about-dev-command.html +12 -0
- package/doc_build/en/guide/advance/theme-config.html +29 -0
- package/doc_build/en/guide/basic/before-getting-started.html +89 -0
- package/doc_build/en/guide/basic/command-preview.html +63 -0
- package/doc_build/en/guide/basic/modify-output-product.html +98 -0
- package/doc_build/en/guide/basic/publish-your-project.html +50 -0
- package/doc_build/en/guide/basic/test-your-project.html +31 -0
- package/doc_build/en/guide/basic/use-micro-generator.html +29 -0
- package/doc_build/en/guide/basic/using-storybook.html +66 -0
- package/doc_build/en/guide/best-practices/components.html +111 -0
- package/doc_build/en/guide/intro/getting-started.html +36 -0
- package/doc_build/en/guide/intro/welcome.html +13 -0
- package/doc_build/en/guide/intro/why-module-engineering-solution.html +9 -0
- package/doc_build/en/index.html +1 -0
- package/doc_build/en/plugins/guide/getting-started.html +15 -0
- package/doc_build/en/plugins/guide/plugin-object.html +14 -0
- package/doc_build/en/plugins/guide/setup-function.html +30 -0
- package/doc_build/en/plugins/official-list/overview.html +3 -0
- package/doc_build/guide/advance/asset.html +25 -0
- package/doc_build/guide/advance/build-umd.html +32 -0
- package/doc_build/guide/advance/copy.html +42 -0
- package/doc_build/guide/advance/external-dependency.html +31 -0
- package/doc_build/guide/advance/in-depth-about-build.html +112 -0
- package/doc_build/guide/advance/in-depth-about-dev-command.html +14 -0
- package/doc_build/guide/advance/theme-config.html +28 -0
- package/doc_build/guide/basic/before-getting-started.html +89 -0
- package/doc_build/guide/basic/command-preview.html +63 -0
- package/doc_build/guide/basic/modify-output-product.html +97 -0
- package/doc_build/guide/basic/publish-your-project.html +52 -0
- package/doc_build/guide/basic/test-your-project.html +32 -0
- package/doc_build/guide/basic/use-micro-generator.html +27 -0
- package/doc_build/guide/basic/using-storybook.html +67 -0
- package/doc_build/guide/best-practices/components.html +111 -0
- package/doc_build/guide/intro/getting-started.html +39 -0
- package/doc_build/guide/intro/welcome.html +13 -0
- package/doc_build/guide/intro/why-module-engineering-solution.html +9 -0
- package/doc_build/index.html +1 -0
- package/doc_build/plugins/guide/getting-started.html +15 -0
- package/doc_build/plugins/guide/plugin-object.html +14 -0
- package/doc_build/plugins/guide/setup-function.html +30 -0
- package/doc_build/plugins/official-list/overview.html +3 -0
- package/doc_build/static/css/main.edaad072.css +1 -0
- package/doc_build/static/js/1607.70af642a.js +2 -0
- package/doc_build/static/js/1607.70af642a.js.LICENSE.txt +23 -0
- package/doc_build/static/js/async/3799.e31e8293.js +1 -0
- package/doc_build/static/js/async/8652.6fbf1cb7.js +1 -0
- package/doc_build/static/js/async/en_api_config_build-config.367a5701.js +1 -0
- package/doc_build/static/js/async/en_api_config_build-preset.0d78b268.js +1 -0
- package/doc_build/static/js/async/en_api_config_design-system.b28d6723.js +1 -0
- package/doc_build/static/js/async/en_api_config_plugins.fc95fb77.js +1 -0
- package/doc_build/static/js/async/en_api_config_testing.8bc7f316.js +1 -0
- package/doc_build/static/js/async/en_api_index.669f0a56.js +1 -0
- package/doc_build/static/js/async/en_api_plugin-api_plugin-hooks.60d0260c.js +1 -0
- package/doc_build/static/js/async/en_guide_advance_asset.5ff1d623.js +1 -0
- package/doc_build/static/js/async/en_guide_advance_build-umd.c254ed46.js +1 -0
- package/doc_build/static/js/async/en_guide_advance_copy.45c0a51d.js +1 -0
- package/doc_build/static/js/async/en_guide_advance_external-dependency.a52d3247.js +1 -0
- package/doc_build/static/js/async/en_guide_advance_in-depth-about-build.51bf3569.js +1 -0
- package/doc_build/static/js/async/en_guide_advance_in-depth-about-dev-command.aec0b4e1.js +1 -0
- package/doc_build/static/js/async/en_guide_advance_theme-config.db0ad9fc.js +1 -0
- package/doc_build/static/js/async/en_guide_basic_before-getting-started.a22fc49a.js +1 -0
- package/doc_build/static/js/async/en_guide_basic_command-preview.1707ed29.js +1 -0
- package/doc_build/static/js/async/en_guide_basic_modify-output-product.ad453d13.js +1 -0
- package/doc_build/static/js/async/en_guide_basic_publish-your-project.08c5112f.js +1 -0
- package/doc_build/static/js/async/en_guide_basic_test-your-project.f5f6b204.js +1 -0
- package/doc_build/static/js/async/en_guide_basic_use-micro-generator.56325139.js +1 -0
- package/doc_build/static/js/async/en_guide_basic_using-storybook.9d721554.js +1 -0
- package/doc_build/static/js/async/en_guide_best-practices_components.45155af9.js +1 -0
- package/doc_build/static/js/async/en_guide_intro_getting-started.f8682be3.js +1 -0
- package/doc_build/static/js/async/en_guide_intro_welcome.9cc45924.js +1 -0
- package/doc_build/static/js/async/en_guide_intro_why-module-engineering-solution.7f2dae5c.js +1 -0
- package/doc_build/static/js/async/en_index.7bd869c4.js +1 -0
- package/doc_build/static/js/async/en_plugins_guide_getting-started.b850249c.js +1 -0
- package/doc_build/static/js/async/en_plugins_guide_plugin-object.bf6c6221.js +1 -0
- package/doc_build/static/js/async/en_plugins_guide_setup-function.80a2bd97.js +1 -0
- package/doc_build/static/js/async/en_plugins_official-list_overview.84e5cea0.js +1 -0
- package/doc_build/static/js/async/zh_api_config_build-config.048fd5ec.js +1 -0
- package/doc_build/static/js/async/zh_api_config_build-preset.7c13584d.js +1 -0
- package/doc_build/static/js/async/zh_api_config_design-system.1eecd474.js +1 -0
- package/doc_build/static/js/async/zh_api_config_plugins.c22dc4be.js +1 -0
- package/doc_build/static/js/async/zh_api_config_testing.a9888eed.js +1 -0
- package/doc_build/static/js/async/zh_api_index.22957707.js +1 -0
- package/doc_build/static/js/async/zh_api_plugin-api_plugin-hooks.a4d81bf6.js +1 -0
- package/doc_build/static/js/async/zh_guide_advance_asset.5b936003.js +1 -0
- package/doc_build/static/js/async/zh_guide_advance_build-umd.b6d541ff.js +1 -0
- package/doc_build/static/js/async/zh_guide_advance_copy.21a1aea4.js +1 -0
- package/doc_build/static/js/async/zh_guide_advance_external-dependency.c7cf5d4b.js +1 -0
- package/doc_build/static/js/async/zh_guide_advance_in-depth-about-build.64e795f3.js +1 -0
- package/doc_build/static/js/async/zh_guide_advance_in-depth-about-dev-command.168ce7dd.js +1 -0
- package/doc_build/static/js/async/zh_guide_advance_theme-config.b9570109.js +1 -0
- package/doc_build/static/js/async/zh_guide_basic_before-getting-started.6b06b54a.js +1 -0
- package/doc_build/static/js/async/zh_guide_basic_command-preview.1199124a.js +1 -0
- package/doc_build/static/js/async/zh_guide_basic_modify-output-product.8ccbc8d1.js +1 -0
- package/doc_build/static/js/async/zh_guide_basic_publish-your-project.bf11b1c4.js +1 -0
- package/doc_build/static/js/async/zh_guide_basic_test-your-project.ae52c47a.js +1 -0
- package/doc_build/static/js/async/zh_guide_basic_use-micro-generator.a091d57d.js +1 -0
- package/doc_build/static/js/async/zh_guide_basic_using-storybook.27829e44.js +1 -0
- package/doc_build/static/js/async/zh_guide_best-practices_components.7454d916.js +1 -0
- package/doc_build/static/js/async/zh_guide_intro_getting-started.a4c00d9a.js +1 -0
- package/doc_build/static/js/async/zh_guide_intro_welcome.71c3fe16.js +1 -0
- package/doc_build/static/js/async/zh_guide_intro_why-module-engineering-solution.6f8b5ff6.js +1 -0
- package/doc_build/static/js/async/zh_index.c19f9dcf.js +1 -0
- package/doc_build/static/js/async/zh_plugins_guide_getting-started.099dfaea.js +1 -0
- package/doc_build/static/js/async/zh_plugins_guide_plugin-object.963289d5.js +1 -0
- package/doc_build/static/js/async/zh_plugins_guide_setup-function.67d07b91.js +1 -0
- package/doc_build/static/js/async/zh_plugins_official-list_overview.a7635714.js +1 -0
- package/doc_build/static/js/lib-lodash.c5845536.js +1 -0
- package/doc_build/static/js/lib-polyfill.b3038509.js +1 -0
- package/doc_build/static/js/lib-react.d41ace5e.js +2 -0
- package/doc_build/static/js/lib-react.d41ace5e.js.LICENSE.txt +29 -0
- package/doc_build/static/js/main.2d3257a4.js +1 -0
- package/doc_build/static/search_index.json +1 -0
- package/docs/en/api/config/build-config.md +15 -5
- 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/guide/advance/asset.mdx +0 -4
- package/docs/en/guide/advance/build-umd.mdx +3 -3
- package/docs/en/guide/advance/in-depth-about-build.md +14 -13
- package/docs/en/guide/advance/in-depth-about-dev-command.md +2 -1
- package/docs/en/guide/basic/before-getting-started.md +16 -9
- package/docs/en/guide/basic/command-preview.md +2 -2
- package/docs/en/guide/basic/modify-output-product.md +65 -69
- package/docs/en/guide/basic/test-your-project.mdx +1 -3
- package/docs/en/guide/basic/use-micro-generator.md +4 -0
- package/docs/en/guide/basic/using-storybook.mdx +1 -13
- package/docs/en/plugins/guide/getting-started.mdx +2 -2
- package/docs/en/plugins/guide/plugin-object.mdx +5 -5
- package/docs/zh/api/config/build-config.md +18 -6
- 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 +2 -2
- package/docs/zh/api/config/testing.md +3 -2
- package/docs/zh/guide/advance/asset.mdx +0 -5
- package/docs/zh/guide/advance/build-umd.mdx +3 -3
- package/docs/zh/guide/advance/in-depth-about-build.md +14 -13
- package/docs/zh/guide/advance/in-depth-about-dev-command.md +2 -1
- package/docs/zh/guide/basic/before-getting-started.md +15 -8
- package/docs/zh/guide/basic/command-preview.md +2 -2
- package/docs/zh/guide/basic/modify-output-product.md +17 -19
- package/docs/zh/guide/basic/test-your-project.mdx +1 -3
- package/docs/zh/guide/basic/use-micro-generator.md +5 -1
- package/docs/zh/guide/basic/using-storybook.mdx +9 -19
- package/docs/zh/guide/intro/getting-started.md +1 -1
- package/docs/zh/plugins/guide/getting-started.mdx +2 -2
- package/docs/zh/plugins/guide/plugin-object.mdx +5 -5
- package/modern.config.ts +11 -5
- package/package.json +3 -3
- package/LICENSE +0 -144
- package/doc_build/html/main/index.html +0 -16
- package/doc_build/route.json +0 -10
- package/doc_build/static/css/main.css +0 -3370
- package/doc_build/static/css/main.css.map +0 -1
- 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 +0 -85
- 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 +0 -1
- package/doc_build/static/js/async/api_.js +0 -56
- package/doc_build/static/js/async/api_.js.map +0 -1
- package/doc_build/static/js/async/api_config_build-config.js +0 -11309
- package/doc_build/static/js/async/api_config_build-config.js.map +0 -1
- package/doc_build/static/js/async/api_config_build-preset.js +0 -7849
- package/doc_build/static/js/async/api_config_build-preset.js.map +0 -1
- package/doc_build/static/js/async/api_config_design-system.js +0 -48708
- package/doc_build/static/js/async/api_config_design-system.js.map +0 -1
- package/doc_build/static/js/async/api_config_plugins.js +0 -1492
- package/doc_build/static/js/async/api_config_plugins.js.map +0 -1
- package/doc_build/static/js/async/api_config_testing.js +0 -2130
- package/doc_build/static/js/async/api_config_testing.js.map +0 -1
- package/doc_build/static/js/async/api_plugin-api_plugin-hooks.js +0 -14394
- package/doc_build/static/js/async/api_plugin-api_plugin-hooks.js.map +0 -1
- package/doc_build/static/js/async/en_.js +0 -85
- package/doc_build/static/js/async/en_.js.map +0 -1
- package/doc_build/static/js/async/en_api_.js +0 -55
- package/doc_build/static/js/async/en_api_.js.map +0 -1
- package/doc_build/static/js/async/en_api_config_build-config.js +0 -8363
- package/doc_build/static/js/async/en_api_config_build-config.js.map +0 -1
- package/doc_build/static/js/async/en_api_config_build-preset.js +0 -7845
- package/doc_build/static/js/async/en_api_config_build-preset.js.map +0 -1
- package/doc_build/static/js/async/en_api_config_design-system.js +0 -16345
- package/doc_build/static/js/async/en_api_config_design-system.js.map +0 -1
- package/doc_build/static/js/async/en_api_config_plugins.js +0 -1492
- package/doc_build/static/js/async/en_api_config_plugins.js.map +0 -1
- package/doc_build/static/js/async/en_api_config_testing.js +0 -2137
- package/doc_build/static/js/async/en_api_config_testing.js.map +0 -1
- package/doc_build/static/js/async/en_api_plugin-api_plugin-hooks.js +0 -14362
- package/doc_build/static/js/async/en_api_plugin-api_plugin-hooks.js.map +0 -1
- package/doc_build/static/js/async/en_guide_advance_asset.js +0 -3997
- package/doc_build/static/js/async/en_guide_advance_asset.js.map +0 -1
- package/doc_build/static/js/async/en_guide_advance_build-umd.js +0 -9861
- package/doc_build/static/js/async/en_guide_advance_build-umd.js.map +0 -1
- package/doc_build/static/js/async/en_guide_advance_copy.js +0 -6539
- package/doc_build/static/js/async/en_guide_advance_copy.js.map +0 -1
- package/doc_build/static/js/async/en_guide_advance_external-dependency.js +0 -3810
- package/doc_build/static/js/async/en_guide_advance_external-dependency.js.map +0 -1
- package/doc_build/static/js/async/en_guide_advance_in-depth-about-build.js +0 -5046
- package/doc_build/static/js/async/en_guide_advance_in-depth-about-build.js.map +0 -1
- package/doc_build/static/js/async/en_guide_advance_in-depth-about-dev-command.js +0 -150
- package/doc_build/static/js/async/en_guide_advance_in-depth-about-dev-command.js.map +0 -1
- package/doc_build/static/js/async/en_guide_advance_theme-config.js +0 -2484
- package/doc_build/static/js/async/en_guide_advance_theme-config.js.map +0 -1
- package/doc_build/static/js/async/en_guide_basic_before-getting-started.js +0 -3671
- package/doc_build/static/js/async/en_guide_basic_before-getting-started.js.map +0 -1
- package/doc_build/static/js/async/en_guide_basic_command-preview.js +0 -3961
- package/doc_build/static/js/async/en_guide_basic_command-preview.js.map +0 -1
- package/doc_build/static/js/async/en_guide_basic_modify-output-product.js +0 -2970
- package/doc_build/static/js/async/en_guide_basic_modify-output-product.js.map +0 -1
- package/doc_build/static/js/async/en_guide_basic_publish-your-project.js +0 -2182
- package/doc_build/static/js/async/en_guide_basic_publish-your-project.js.map +0 -1
- package/doc_build/static/js/async/en_guide_basic_test-your-project.js +0 -3892
- package/doc_build/static/js/async/en_guide_basic_test-your-project.js.map +0 -1
- package/doc_build/static/js/async/en_guide_basic_use-micro-generator.js +0 -168
- package/doc_build/static/js/async/en_guide_basic_use-micro-generator.js.map +0 -1
- package/doc_build/static/js/async/en_guide_basic_using-storybook.js +0 -4762
- package/doc_build/static/js/async/en_guide_basic_using-storybook.js.map +0 -1
- package/doc_build/static/js/async/en_guide_best-practices_components.js +0 -21388
- package/doc_build/static/js/async/en_guide_best-practices_components.js.map +0 -1
- package/doc_build/static/js/async/en_guide_intro_getting-started.js +0 -1906
- package/doc_build/static/js/async/en_guide_intro_getting-started.js.map +0 -1
- package/doc_build/static/js/async/en_guide_intro_welcome.js +0 -148
- package/doc_build/static/js/async/en_guide_intro_welcome.js.map +0 -1
- package/doc_build/static/js/async/en_guide_intro_why-module-engineering-solution.js +0 -92
- package/doc_build/static/js/async/en_guide_intro_why-module-engineering-solution.js.map +0 -1
- package/doc_build/static/js/async/en_plugins_guide_getting-started.js +0 -2560
- package/doc_build/static/js/async/en_plugins_guide_getting-started.js.map +0 -1
- package/doc_build/static/js/async/en_plugins_guide_plugin-object.js +0 -4177
- package/doc_build/static/js/async/en_plugins_guide_plugin-object.js.map +0 -1
- package/doc_build/static/js/async/en_plugins_guide_setup-function.js +0 -3819
- package/doc_build/static/js/async/en_plugins_guide_setup-function.js.map +0 -1
- package/doc_build/static/js/async/en_plugins_official-list_overview.js +0 -70
- package/doc_build/static/js/async/en_plugins_official-list_overview.js.map +0 -1
- package/doc_build/static/js/async/guide_advance_asset.js +0 -3997
- package/doc_build/static/js/async/guide_advance_asset.js.map +0 -1
- package/doc_build/static/js/async/guide_advance_build-umd.js +0 -9863
- package/doc_build/static/js/async/guide_advance_build-umd.js.map +0 -1
- package/doc_build/static/js/async/guide_advance_copy.js +0 -6539
- package/doc_build/static/js/async/guide_advance_copy.js.map +0 -1
- package/doc_build/static/js/async/guide_advance_external-dependency.js +0 -3812
- package/doc_build/static/js/async/guide_advance_external-dependency.js.map +0 -1
- package/doc_build/static/js/async/guide_advance_in-depth-about-build.js +0 -5046
- package/doc_build/static/js/async/guide_advance_in-depth-about-build.js.map +0 -1
- package/doc_build/static/js/async/guide_advance_in-depth-about-dev-command.js +0 -152
- package/doc_build/static/js/async/guide_advance_in-depth-about-dev-command.js.map +0 -1
- package/doc_build/static/js/async/guide_advance_theme-config.js +0 -2475
- package/doc_build/static/js/async/guide_advance_theme-config.js.map +0 -1
- package/doc_build/static/js/async/guide_basic_before-getting-started.js +0 -3662
- package/doc_build/static/js/async/guide_basic_before-getting-started.js.map +0 -1
- package/doc_build/static/js/async/guide_basic_command-preview.js +0 -3793
- package/doc_build/static/js/async/guide_basic_command-preview.js.map +0 -1
- package/doc_build/static/js/async/guide_basic_modify-output-product.js +0 -2949
- package/doc_build/static/js/async/guide_basic_modify-output-product.js.map +0 -1
- package/doc_build/static/js/async/guide_basic_publish-your-project.js +0 -2243
- package/doc_build/static/js/async/guide_basic_publish-your-project.js.map +0 -1
- package/doc_build/static/js/async/guide_basic_test-your-project.js +0 -3892
- package/doc_build/static/js/async/guide_basic_test-your-project.js.map +0 -1
- package/doc_build/static/js/async/guide_basic_use-micro-generator.js +0 -172
- package/doc_build/static/js/async/guide_basic_use-micro-generator.js.map +0 -1
- package/doc_build/static/js/async/guide_basic_using-storybook.js +0 -4762
- package/doc_build/static/js/async/guide_basic_using-storybook.js.map +0 -1
- package/doc_build/static/js/async/guide_best-practices_components.js +0 -21088
- package/doc_build/static/js/async/guide_best-practices_components.js.map +0 -1
- package/doc_build/static/js/async/guide_intro_getting-started.js +0 -1782
- package/doc_build/static/js/async/guide_intro_getting-started.js.map +0 -1
- package/doc_build/static/js/async/guide_intro_welcome.js +0 -148
- package/doc_build/static/js/async/guide_intro_welcome.js.map +0 -1
- package/doc_build/static/js/async/guide_intro_why-module-engineering-solution.js +0 -92
- package/doc_build/static/js/async/guide_intro_why-module-engineering-solution.js.map +0 -1
- package/doc_build/static/js/async/index.js +0 -85
- package/doc_build/static/js/async/index.js.map +0 -1
- package/doc_build/static/js/async/packages_cli_doc-core_src_theme-default_components_Search_logic_search_ts.js +0 -447
- package/doc_build/static/js/async/packages_cli_doc-core_src_theme-default_components_Search_logic_search_ts.js.map +0 -1
- package/doc_build/static/js/async/plugins_guide_getting-started.js +0 -2608
- package/doc_build/static/js/async/plugins_guide_getting-started.js.map +0 -1
- package/doc_build/static/js/async/plugins_guide_plugin-object.js +0 -4173
- package/doc_build/static/js/async/plugins_guide_plugin-object.js.map +0 -1
- package/doc_build/static/js/async/plugins_guide_setup-function.js +0 -3819
- package/doc_build/static/js/async/plugins_guide_setup-function.js.map +0 -1
- package/doc_build/static/js/async/plugins_official-list_overview.js +0 -70
- package/doc_build/static/js/async/plugins_official-list_overview.js.map +0 -1
- 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 +0 -6656
- 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 +0 -1
- package/doc_build/static/js/async/vendors-node_modules_pnpm_flexsearch_0_6_32_node_modules_flexsearch_dist_flexsearch_min_js.js +0 -54
- package/doc_build/static/js/async/vendors-node_modules_pnpm_flexsearch_0_6_32_node_modules_flexsearch_dist_flexsearch_min_js.js.map +0 -1
- package/doc_build/static/js/builder-runtime.js +0 -1375
- package/doc_build/static/js/builder-runtime.js.map +0 -1
- package/doc_build/static/js/lib-lodash.js +0 -4907
- package/doc_build/static/js/lib-lodash.js.map +0 -1
- package/doc_build/static/js/lib-polyfill.js +0 -24769
- package/doc_build/static/js/lib-polyfill.js.map +0 -1
- package/doc_build/static/js/lib-react.js +0 -39510
- package/doc_build/static/js/lib-react.js.map +0 -1
- package/doc_build/static/js/main.js +0 -9237
- package/doc_build/static/js/main.js.map +0 -1
- 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 +0 -8532
- 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 +0 -1
|
@@ -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
|
|
|
@@ -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
|
|
@@ -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);
|
|
@@ -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);
|
|
@@ -10,7 +10,8 @@ In the [Basic Usage] section, we already knew that you can modify the output pro
|
|
|
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
12
|
- [[modify-output-product](/en/guide/basic/modify-output-product)]
|
|
13
|
-
|
|
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
|
|
|
@@ -34,7 +35,7 @@ In `buildConfig` you can specify whether the current build task is Bundle or Bun
|
|
|
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({
|
|
@@ -79,7 +80,7 @@ The [`buildConfig.dts`](/en/api/config/build-config#dts) configuration is mainly
|
|
|
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({
|
|
@@ -106,7 +107,7 @@ The **module engineering solution also supports packaging of type files**, altho
|
|
|
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({
|
|
@@ -169,7 +170,7 @@ export default defineConfig({
|
|
|
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
|
```
|
|
@@ -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
|
|
|
@@ -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
|
```
|
|
@@ -55,6 +55,7 @@ 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
|
|
@@ -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`.
|
|
@@ -2,143 +2,139 @@
|
|
|
2
2
|
sidebar_position: 3
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
## Modify output product
|
|
5
|
+
## Modify the output product
|
|
8
6
|
|
|
9
7
|
## Default output products
|
|
10
8
|
|
|
11
|
-
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.
|
|
12
10
|
|
|
13
11
|
```typescript
|
|
14
|
-
import { defineConfig } from '@modern-js/module-tools';
|
|
12
|
+
import moduleTools, { defineConfig } from '@modern-js/module-tools';
|
|
15
13
|
|
|
16
14
|
export default defineConfig({
|
|
17
|
-
|
|
15
|
+
plugins: [moduleTools()],
|
|
16
|
+
buildPreset: 'npm-library',
|
|
18
17
|
});
|
|
19
18
|
```
|
|
20
19
|
|
|
21
|
-
**The default
|
|
22
|
-
|
|
23
|
-
- The code format is [CommonJS](https://nodejs.org/api/modules.html#modules-commonjs-modules), or simply `cjs`.
|
|
24
|
-
- Code syntax is supported up to `ES6`.
|
|
25
|
-
- All code is packaged into a single file, i.e. **bundle** processing is performed.
|
|
26
|
-
- The output root directory is the `dist` directory under the project, and the output directory for type files is `dist/types`.
|
|
20
|
+
**The default generation product has the following characteristics**.
|
|
27
21
|
|
|
28
|
-
|
|
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`.
|
|
29
26
|
|
|
30
|
-
|
|
31
|
-
:::
|
|
32
|
-
|
|
33
|
-
You may have the following questions when you see this:
|
|
27
|
+
You may have the following questions when you see this.
|
|
34
28
|
|
|
35
29
|
1. what is `buildPreset`?
|
|
36
|
-
2. what determines these characteristics of the
|
|
30
|
+
2. what determines these characteristics of the product?
|
|
37
31
|
|
|
38
32
|
Then the next step is to first explain `buildPreset`.
|
|
39
33
|
|
|
40
34
|
## buildPreset
|
|
41
35
|
|
|
42
|
-
`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.
|
|
43
37
|
|
|
44
|
-
### String form of
|
|
38
|
+
### String form of build preset
|
|
45
39
|
|
|
46
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.
|
|
47
41
|
|
|
48
|
-
The module engineering solution provides generic build preset strings and corresponding variants, depending on the generic scenario in which the npm package is used. All currently supported preset strings can be viewed via the [BuildPreset API](/
|
|
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**.
|
|
49
43
|
|
|
50
|
-
Among the generic preset strings, `"npm-library"` can be used in the scenario of developing npm packages of the library type, which is suitable for most common module type projects. When `"npm-library"` is set, the output product of the project will have the following characteristics
|
|
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.
|
|
51
45
|
|
|
52
|
-
- In the `dist/lib` directory you will get
|
|
53
|
-
- 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.
|
|
54
48
|
- In the `dist/types` directory, you get the type files. If it is not a TypeScript project, there is no such directory.
|
|
55
49
|
|
|
56
|
-
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]"`.
|
|
57
51
|
|
|
58
|
-
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.
|
|
59
53
|
|
|
60
|
-
###
|
|
54
|
+
### Build pre-defined function forms
|
|
61
55
|
|
|
62
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**.
|
|
63
57
|
|
|
64
|
-
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.
|
|
65
59
|
|
|
66
60
|
```typescript
|
|
67
|
-
import { defineConfig } from
|
|
61
|
+
import { defineConfig } from '@modern-js/module-tools';
|
|
68
62
|
|
|
69
63
|
export default defineConfig({
|
|
70
64
|
buildPreset({ preset }) {
|
|
71
65
|
return preset.NPM_LIBRARY.map(config => {
|
|
72
|
-
return { ... .config, target: '
|
|
66
|
+
return { ... .config, target: 'es5' }
|
|
73
67
|
});
|
|
74
68
|
},
|
|
75
69
|
});
|
|
76
70
|
```
|
|
77
71
|
|
|
78
|
-
In the above code implementation, `preset.NPM_LIBRARY` corresponds to the preset string `"npm-library"`, which represents the `"npm-library"` equivalent of a multi-group build-related configuration. We traverse the `NPM_LIBRARY` array, which contains multiple `buildConfig` objects, with the `map` method. We make a shallow copy of the original `buildConfig` object and modify the shallow copy to get `buildConfig.target`, specifying it as `
|
|
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`.
|
|
79
73
|
|
|
80
|
-
>
|
|
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.
|
|
81
75
|
|
|
82
|
-
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?
|
|
83
77
|
|
|
84
|
-
|
|
78
|
+
Let's explain next.
|
|
85
79
|
|
|
86
80
|
## Build configuration (object)
|
|
87
81
|
|
|
88
|
-
**`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.
|
|
89
83
|
|
|
90
84
|
**The basic attributes of a build product include:**
|
|
91
85
|
|
|
92
|
-
- Whether the product is packaged or not: the corresponding API is [`buildConfig.buildType`](/
|
|
93
|
-
- Product support for syntax: the corresponding API is [`buildConfig.target`](/
|
|
94
|
-
- Output format:
|
|
95
|
-
- How
|
|
96
|
-
- How the sourceMap of the product is handled: the corresponding API is [`buildConfig.sourceMap`](/
|
|
97
|
-
- The input (or source file) corresponding to the output: the corresponding API is [`buildConfig.input`](/
|
|
98
|
-
- The directory of the output of the product: the corresponding API is [`buildConfig.outDir`](/
|
|
99
|
-
-
|
|
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).
|
|
100
94
|
|
|
101
|
-
**Common functions
|
|
95
|
+
**Common functions required for build products include:**
|
|
102
96
|
|
|
103
|
-
- Alias: The corresponding API is [`buildConfig.alias`](/
|
|
104
|
-
- 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).
|
|
105
99
|
- Third-party dependency handling: The corresponding APIs are
|
|
106
|
-
- [`buildConfig.autoExternal`](/
|
|
107
|
-
- [`buildConfig.externals`](/
|
|
108
|
-
- Copy: The corresponding API is [`buildConfig.copy`](/
|
|
109
|
-
- Global variable substitution: the corresponding API is [`buildConfig.define`](/
|
|
110
|
-
- Specify [JSX](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html) compilation method, the corresponding API is [`buildConfig.jsx`](/
|
|
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).
|
|
111
105
|
|
|
112
106
|
**Some advanced properties or less frequently used functions:**
|
|
113
107
|
|
|
114
|
-
- Product code compression: The corresponding API is [`buildConfig.minify`](/
|
|
115
|
-
- Code splitting: [`buildConfig.splitting`](/
|
|
116
|
-
- 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).
|
|
117
111
|
- umd product-related.
|
|
118
|
-
- Specifies the global variables imported externally to the umd product: the corresponding API is [`buildConfig.umdGlobals`](/
|
|
119
|
-
- 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).
|
|
120
114
|
|
|
121
|
-
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
|
|
122
116
|
|
|
123
|
-
- [What are `bundle` and `bundleless`?](/
|
|
124
|
-
- [
|
|
125
|
-
- [
|
|
126
|
-
- [
|
|
127
|
-
- [How to handle third-party dependencies?](/
|
|
128
|
-
- [How to use copy?](/
|
|
129
|
-
-
|
|
130
|
-
- [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)
|
|
131
125
|
|
|
132
126
|
## When to use `buildConfig`
|
|
133
127
|
|
|
134
|
-
`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.
|
|
135
129
|
|
|
136
130
|
```typescript
|
|
137
131
|
import { defineConfig } from '@modern-js/module-tools';
|
|
138
132
|
|
|
139
133
|
export default defineConfig({
|
|
140
|
-
buildConfig:
|
|
141
|
-
|
|
134
|
+
buildConfig: {
|
|
135
|
+
format: 'umd',
|
|
136
|
+
},
|
|
137
|
+
buildPreset: 'npm-library',
|
|
142
138
|
});
|
|
143
139
|
```
|
|
144
140
|
|
|
@@ -150,4 +146,4 @@ Since both 'buildConfig' and 'buildPreset' are present, only the 'buildConfig' c
|
|
|
150
146
|
|
|
151
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`.
|
|
152
148
|
|
|
153
|
-
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**.
|
|
@@ -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
|
|
|
@@ -14,6 +14,10 @@ Thus with these capabilities, **Microgenerator can enable additional feature fun
|
|
|
14
14
|
|
|
15
15
|
The microgenerator can be started via [`modern new`](/guide/basic/command-preview). The current Microgenerator features supported by the Module Engineering program are:
|
|
16
16
|
|
|
17
|
+
## 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**.
|
|
20
|
+
|
|
17
21
|
## Storybook
|
|
18
22
|
|
|
19
23
|
The **Storybook feature** can be enabled when we want to debug a component or a common module. When this feature is enabled, **the `stories` directory and related files are created in the project directory, and a new `"@modern-js/plugin-storybook"` dependency is added to package.json**.
|
|
@@ -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,17 +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
|
-
{/* 链接待补充 */}
|
|
175
|
-
|
|
176
|
-
- `dev.storybook.webpack`
|
|
177
|
-
|
|
178
|
-
### Building Storybook Products
|
|
166
|
+
## Building Storybook Products
|
|
179
167
|
|
|
180
168
|
In addition to Storybook debugging of components or common modules, you can also perform Storybook build tasks with the following commands.
|
|
181
169
|
|
|
@@ -54,9 +54,9 @@ export const ExamplePlugin = (): CliPlugin<ModuleTools> => {
|
|
|
54
54
|
Then we register the plugin we just wrote via the [`plugins`](/en/api/config/plugins) API.
|
|
55
55
|
|
|
56
56
|
```ts . /modern.config.ts
|
|
57
|
-
import {
|
|
57
|
+
import { examplePlugin } from '. /plugins/example';
|
|
58
58
|
export default defineConfig({
|
|
59
|
-
plugins: [
|
|
59
|
+
plugins: [examplePlugin()],
|
|
60
60
|
});
|
|
61
61
|
```
|
|
62
62
|
|
|
@@ -16,7 +16,7 @@ For example, in the following plugin code example, the `beforeBuild` function is
|
|
|
16
16
|
```ts . /plugins/demo.tsx
|
|
17
17
|
import type { CliPlugin, ModuleTools } from '@modern-js/module-tools';
|
|
18
18
|
|
|
19
|
-
const
|
|
19
|
+
const myPlugin: CliPlugin<ModuleTools> = {
|
|
20
20
|
name: 'my-plugin',
|
|
21
21
|
|
|
22
22
|
setup() {
|
|
@@ -33,9 +33,9 @@ const MyPlugin: CliPlugin<ModuleTools> = {
|
|
|
33
33
|
---
|
|
34
34
|
|
|
35
35
|
```ts . /modern.config.ts
|
|
36
|
-
import {
|
|
36
|
+
import { myPlugin } from '. /plugins/demo';
|
|
37
37
|
export default {
|
|
38
|
-
plugins: [
|
|
38
|
+
plugins: [myPlugin()],
|
|
39
39
|
};
|
|
40
40
|
```
|
|
41
41
|
|
|
@@ -48,7 +48,7 @@ When using TypeScript, you can introduce the built-in `CliPlugin` and `ModuleToo
|
|
|
48
48
|
```ts
|
|
49
49
|
import type { CliPlugin, ModuleTools } from '@modern-js/module-tools';
|
|
50
50
|
|
|
51
|
-
const
|
|
51
|
+
const myPlugin: CliPlugin<ModuleTools> = {
|
|
52
52
|
name: 'my-plugin',
|
|
53
53
|
|
|
54
54
|
setup() {
|
|
@@ -75,7 +75,7 @@ type MyPluginOptions = {
|
|
|
75
75
|
foo: string;
|
|
76
76
|
};
|
|
77
77
|
|
|
78
|
-
const
|
|
78
|
+
const myPlugin = (options: MyPluginOptions): CliPlugin<ModuleTools> => ({
|
|
79
79
|
name: 'my-plugin',
|
|
80
80
|
|
|
81
81
|
setup() {
|