@modern-js/module-tools-docs 2.0.0-beta.4 → 2.0.2
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/.eslintrc.js +13 -0
- package/doc_build/html/main/index.html +16 -0
- package/doc_build/route.json +10 -0
- package/doc_build/static/css/main.css +3370 -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 +85 -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/api_.js +56 -0
- package/doc_build/static/js/async/api_.js.map +1 -0
- package/doc_build/static/js/async/api_config_build-config.js +11309 -0
- package/doc_build/static/js/async/api_config_build-config.js.map +1 -0
- package/doc_build/static/js/async/api_config_build-preset.js +7849 -0
- package/doc_build/static/js/async/api_config_build-preset.js.map +1 -0
- package/doc_build/static/js/async/api_config_design-system.js +48708 -0
- package/doc_build/static/js/async/api_config_design-system.js.map +1 -0
- package/doc_build/static/js/async/api_config_plugins.js +1492 -0
- package/doc_build/static/js/async/api_config_plugins.js.map +1 -0
- package/doc_build/static/js/async/api_config_testing.js +2130 -0
- package/doc_build/static/js/async/api_config_testing.js.map +1 -0
- package/doc_build/static/js/async/api_plugin-api_plugin-hooks.js +14394 -0
- package/doc_build/static/js/async/api_plugin-api_plugin-hooks.js.map +1 -0
- package/doc_build/static/js/async/en_.js +85 -0
- package/doc_build/static/js/async/en_.js.map +1 -0
- package/doc_build/static/js/async/en_api_.js +55 -0
- package/doc_build/static/js/async/en_api_.js.map +1 -0
- package/doc_build/static/js/async/en_api_config_build-config.js +8363 -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 +7845 -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 +16345 -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 +1492 -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 +2137 -0
- package/doc_build/static/js/async/en_api_config_testing.js.map +1 -0
- package/doc_build/static/js/async/en_api_plugin-api_plugin-hooks.js +14362 -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 +3997 -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 +9861 -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 +6539 -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 +3810 -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 +5046 -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 +150 -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 +2484 -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 +3671 -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 +3961 -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 +2970 -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 +2182 -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 +3892 -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 +168 -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 +4762 -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 +21388 -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 +1906 -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 +148 -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 +92 -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_plugins_guide_getting-started.js +2560 -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 +4177 -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 +3819 -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 +70 -0
- package/doc_build/static/js/async/en_plugins_official-list_overview.js.map +1 -0
- package/doc_build/static/js/async/guide_advance_asset.js +3997 -0
- package/doc_build/static/js/async/guide_advance_asset.js.map +1 -0
- package/doc_build/static/js/async/guide_advance_build-umd.js +9863 -0
- package/doc_build/static/js/async/guide_advance_build-umd.js.map +1 -0
- package/doc_build/static/js/async/guide_advance_copy.js +6539 -0
- package/doc_build/static/js/async/guide_advance_copy.js.map +1 -0
- package/doc_build/static/js/async/guide_advance_external-dependency.js +3812 -0
- package/doc_build/static/js/async/guide_advance_external-dependency.js.map +1 -0
- package/doc_build/static/js/async/guide_advance_in-depth-about-build.js +5046 -0
- package/doc_build/static/js/async/guide_advance_in-depth-about-build.js.map +1 -0
- package/doc_build/static/js/async/guide_advance_in-depth-about-dev-command.js +152 -0
- package/doc_build/static/js/async/guide_advance_in-depth-about-dev-command.js.map +1 -0
- package/doc_build/static/js/async/guide_advance_theme-config.js +2475 -0
- package/doc_build/static/js/async/guide_advance_theme-config.js.map +1 -0
- package/doc_build/static/js/async/guide_basic_before-getting-started.js +3662 -0
- package/doc_build/static/js/async/guide_basic_before-getting-started.js.map +1 -0
- package/doc_build/static/js/async/guide_basic_command-preview.js +3793 -0
- package/doc_build/static/js/async/guide_basic_command-preview.js.map +1 -0
- package/doc_build/static/js/async/guide_basic_modify-output-product.js +2949 -0
- package/doc_build/static/js/async/guide_basic_modify-output-product.js.map +1 -0
- package/doc_build/static/js/async/guide_basic_publish-your-project.js +2243 -0
- package/doc_build/static/js/async/guide_basic_publish-your-project.js.map +1 -0
- package/doc_build/static/js/async/guide_basic_test-your-project.js +3892 -0
- package/doc_build/static/js/async/guide_basic_test-your-project.js.map +1 -0
- package/doc_build/static/js/async/guide_basic_use-micro-generator.js +172 -0
- package/doc_build/static/js/async/guide_basic_use-micro-generator.js.map +1 -0
- package/doc_build/static/js/async/guide_basic_using-storybook.js +4762 -0
- package/doc_build/static/js/async/guide_basic_using-storybook.js.map +1 -0
- package/doc_build/static/js/async/guide_best-practices_components.js +21088 -0
- package/doc_build/static/js/async/guide_best-practices_components.js.map +1 -0
- package/doc_build/static/js/async/guide_intro_getting-started.js +1782 -0
- package/doc_build/static/js/async/guide_intro_getting-started.js.map +1 -0
- package/doc_build/static/js/async/guide_intro_welcome.js +148 -0
- package/doc_build/static/js/async/guide_intro_welcome.js.map +1 -0
- package/doc_build/static/js/async/guide_intro_why-module-engineering-solution.js +92 -0
- package/doc_build/static/js/async/guide_intro_why-module-engineering-solution.js.map +1 -0
- package/doc_build/static/js/async/index.js +85 -0
- package/doc_build/static/js/async/index.js.map +1 -0
- package/doc_build/static/js/async/packages_cli_doc-core_src_theme-default_components_Search_logic_search_ts.js +447 -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/plugins_guide_getting-started.js +2608 -0
- package/doc_build/static/js/async/plugins_guide_getting-started.js.map +1 -0
- package/doc_build/static/js/async/plugins_guide_plugin-object.js +4173 -0
- package/doc_build/static/js/async/plugins_guide_plugin-object.js.map +1 -0
- package/doc_build/static/js/async/plugins_guide_setup-function.js +3819 -0
- package/doc_build/static/js/async/plugins_guide_setup-function.js.map +1 -0
- package/doc_build/static/js/async/plugins_official-list_overview.js +70 -0
- package/doc_build/static/js/async/plugins_official-list_overview.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/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 +24769 -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 +9237 -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 +8532 -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/docs/en/api/config/_category_.json +4 -0
- package/docs/en/api/{build-config.md → config/build-config.md} +201 -108
- package/docs/en/api/{build-preset.md → config/build-preset.md} +65 -46
- package/docs/{zh/api → en/api/config}/design-system.md +130 -127
- package/docs/en/api/config/plugins.md +18 -0
- package/docs/en/api/{test.md → config/testing.md} +21 -12
- package/docs/en/api/index.md +3 -1
- package/docs/en/api/plugin-api/_category_.json +4 -0
- package/docs/en/api/plugin-api/plugin-hooks.md +501 -0
- package/docs/en/guide/advance/_category_.json +4 -0
- package/docs/en/guide/advance/asset.mdx +48 -31
- package/docs/en/guide/advance/build-umd.mdx +91 -83
- package/docs/en/guide/advance/copy.md +33 -30
- package/docs/en/guide/advance/external-dependency.mdx +27 -23
- package/docs/en/guide/advance/in-depth-about-build.md +61 -55
- package/docs/en/guide/advance/in-depth-about-dev-command.md +7 -4
- package/docs/en/guide/advance/theme-config.mdx +80 -0
- package/docs/en/guide/basic/_category_.json +4 -0
- package/docs/en/guide/basic/before-getting-started.md +29 -24
- package/docs/en/guide/basic/command-preview.md +20 -16
- package/docs/en/guide/basic/modify-output-product.md +45 -37
- package/docs/en/guide/basic/publish-your-project.md +21 -19
- package/docs/en/guide/basic/test-your-project.mdx +23 -18
- package/docs/en/guide/basic/use-micro-generator.md +15 -8
- package/docs/en/guide/basic/using-storybook.mdx +29 -26
- package/docs/en/guide/best-practices/_category_.json +4 -0
- package/docs/en/guide/best-practices/components.mdx +789 -0
- package/docs/en/guide/intro/_category_.json +4 -0
- package/docs/en/guide/intro/getting-started.md +11 -6
- package/docs/en/guide/intro/welcome.md +4 -0
- package/docs/en/guide/intro/why-module-engineering-solution.md +5 -1
- package/docs/en/index.md +15 -20
- package/docs/en/plugins/guide/_category_.json +4 -0
- package/docs/en/plugins/guide/getting-started.mdx +84 -0
- package/docs/en/plugins/guide/plugin-object.mdx +85 -0
- package/docs/en/plugins/guide/setup-function.mdx +117 -0
- package/docs/en/plugins/official-list/_category_.json +4 -0
- package/docs/en/plugins/official-list/overview.md +6 -0
- package/docs/zh/api/config/_category_.json +4 -0
- package/docs/zh/api/config/build-config.md +669 -0
- package/docs/zh/api/{build-preset.md → config/build-preset.md} +49 -36
- package/docs/zh/api/config/design-system.md +1166 -0
- package/docs/zh/api/config/plugins.md +18 -0
- package/docs/zh/api/{testing.md → config/testing.md} +18 -13
- package/docs/zh/api/index.md +5 -1
- package/docs/zh/api/plugin-api/_category_.json +4 -0
- package/docs/zh/api/plugin-api/plugin-hooks.md +501 -0
- package/docs/zh/guide/advance/_category_.json +4 -0
- package/docs/zh/guide/advance/asset.mdx +48 -31
- package/docs/zh/guide/advance/build-umd.mdx +91 -74
- package/docs/zh/guide/advance/copy.md +33 -30
- package/docs/zh/guide/advance/external-dependency.mdx +28 -24
- package/docs/zh/guide/advance/in-depth-about-build.md +60 -55
- package/docs/zh/guide/advance/in-depth-about-dev-command.md +7 -4
- package/docs/zh/guide/advance/theme-config.mdx +78 -0
- package/docs/zh/guide/basic/_category_.json +4 -0
- package/docs/zh/guide/basic/before-getting-started.md +28 -23
- package/docs/zh/guide/basic/command-preview.md +19 -15
- package/docs/zh/guide/basic/modify-output-product.md +45 -38
- package/docs/zh/guide/basic/publish-your-project.md +22 -17
- package/docs/zh/guide/basic/test-your-project.mdx +24 -18
- package/docs/zh/guide/basic/use-micro-generator.md +12 -9
- package/docs/zh/guide/basic/using-storybook.mdx +29 -24
- package/docs/zh/guide/best-practices/_category_.json +4 -0
- package/docs/zh/guide/best-practices/components.mdx +793 -0
- package/docs/zh/guide/intro/_category_.json +4 -0
- package/docs/zh/guide/intro/getting-started.md +12 -6
- package/docs/zh/guide/intro/welcome.md +4 -0
- package/docs/zh/guide/intro/why-module-engineering-solution.md +5 -1
- package/docs/zh/index.md +3 -2
- package/docs/zh/plugins/guide/_category_.json +4 -0
- package/docs/zh/plugins/guide/getting-started.mdx +84 -0
- package/docs/zh/plugins/guide/plugin-object.mdx +85 -0
- package/docs/zh/plugins/guide/setup-function.mdx +117 -0
- package/docs/zh/plugins/official-list/_category_.json +4 -0
- package/docs/zh/plugins/official-list/overview.md +5 -0
- package/modern.config.ts +119 -0
- package/package.json +8 -6
- package/{docs/.island/styles → theme}/index.css +0 -1
- package/theme/index.ts +4 -0
- package/tsconfig.json +7 -0
- package/docs/.island/config.ts +0 -245
- package/docs/.island/dist/404.html +0 -41
- package/docs/.island/dist/assets/before-getting-started.1b82b538.js +0 -87
- package/docs/.island/dist/assets/before-getting-started.582a31cc.js +0 -87
- package/docs/.island/dist/assets/build-config.72eb0918.js +0 -804
- package/docs/.island/dist/assets/build-config.d8bb1658.js +0 -809
- package/docs/.island/dist/assets/build-preset.96805d7d.js +0 -256
- package/docs/.island/dist/assets/build-preset.c20dcd40.js +0 -256
- package/docs/.island/dist/assets/build-your-ui.7f349247.js +0 -2
- package/docs/.island/dist/assets/build-your-ui.a8361604.js +0 -2
- package/docs/.island/dist/assets/command-preview.2d45fc82.js +0 -264
- package/docs/.island/dist/assets/command-preview.dc51b953.js +0 -264
- package/docs/.island/dist/assets/components.esm.03560353.js +0 -9
- package/docs/.island/dist/assets/design-system.86694ff5.js +0 -1254
- package/docs/.island/dist/assets/design-system.c4745cce.js +0 -639
- package/docs/.island/dist/assets/dev.1d326a37.js +0 -37
- package/docs/.island/dist/assets/dev.1fd06000.js +0 -37
- package/docs/.island/dist/assets/down.f35427d3.svg +0 -1
- package/docs/.island/dist/assets/extension.12299fd6.js +0 -2
- package/docs/.island/dist/assets/extension.96dc63a4.js +0 -2
- package/docs/.island/dist/assets/getting-started.40e9218d.js +0 -117
- package/docs/.island/dist/assets/getting-started.b1ed3f10.js +0 -114
- package/docs/.island/dist/assets/github.3bf8ccee.svg +0 -1
- package/docs/.island/dist/assets/index.2b2347ea.js +0 -33
- package/docs/.island/dist/assets/index.6cef6f5f.js +0 -4
- package/docs/.island/dist/assets/index.cb118238.js +0 -36
- package/docs/.island/dist/assets/index.ccb6ce27.js +0 -4
- package/docs/.island/dist/assets/island_inject.11a12ecc.js +0 -1
- package/docs/.island/dist/assets/island_inject.b13deaee.js +0 -1
- package/docs/.island/dist/assets/loading.8c9bb911.svg +0 -1
- package/docs/.island/dist/assets/modify-output-product.7f6bff35.js +0 -100
- package/docs/.island/dist/assets/modify-output-product.b91eff1f.js +0 -100
- package/docs/.island/dist/assets/moon.6b705924.svg +0 -3
- package/docs/.island/dist/assets/plugin.895932d8.js +0 -42
- package/docs/.island/dist/assets/plugin.d2fbc531.js +0 -42
- package/docs/.island/dist/assets/publish-your-project.21b8309f.js +0 -164
- package/docs/.island/dist/assets/publish-your-project.8d398b17.js +0 -166
- package/docs/.island/dist/assets/right.89674cd7.svg +0 -1
- package/docs/.island/dist/assets/search.0aea6901.svg +0 -1
- package/docs/.island/dist/assets/search.1c85d17c.js +0 -3
- package/docs/.island/dist/assets/search.484eca11.js +0 -222
- package/docs/.island/dist/assets/search.54fca8d0.js +0 -3
- package/docs/.island/dist/assets/style.09015a4b.css +0 -1
- package/docs/.island/dist/assets/style.2e5f7bc2.css +0 -1970
- package/docs/.island/dist/assets/sun.841dac10.svg +0 -11
- package/docs/.island/dist/assets/test-your-project.18bd4582.js +0 -190
- package/docs/.island/dist/assets/test-your-project.f53bebf7.js +0 -190
- package/docs/.island/dist/assets/test.0da1f99f.js +0 -67
- package/docs/.island/dist/assets/test.0e81f002.js +0 -66
- package/docs/.island/dist/assets/translator.b1077c44.svg +0 -1
- package/docs/.island/dist/assets/use-micro-generator.7d9e4016.js +0 -60
- package/docs/.island/dist/assets/use-micro-generator.db5520c1.js +0 -60
- package/docs/.island/dist/assets/using-storybook.57ea6b77.js +0 -260
- package/docs/.island/dist/assets/using-storybook.a2212f2e.js +0 -260
- package/docs/.island/dist/assets/welcome.0449a9c8.js +0 -13
- package/docs/.island/dist/assets/welcome.a8448931.js +0 -13
- package/docs/.island/dist/assets/why-module-engineering-solution.6ae8c0e3.js +0 -26
- package/docs/.island/dist/assets/why-module-engineering-solution.c9a45cbd.js +0 -26
- package/docs/.island/dist/chunk-COLCRJ2V.js +0 -1
- package/docs/.island/dist/chunk-K5FMOYDC.js +0 -10
- package/docs/.island/dist/chunk-WE42KMYS.js +0 -26
- package/docs/.island/dist/client-entry.js +0 -3
- package/docs/.island/dist/en/api/build-config.html +0 -344
- package/docs/.island/dist/en/api/build-preset.html +0 -82
- package/docs/.island/dist/en/api/design-system.html +0 -155
- package/docs/.island/dist/en/api/dev.html +0 -45
- package/docs/.island/dist/en/api/index.html +0 -41
- package/docs/.island/dist/en/api/plugin.html +0 -48
- package/docs/.island/dist/en/api/test.html +0 -58
- package/docs/.island/dist/en/guide/before-getting-started.html +0 -127
- package/docs/.island/dist/en/guide/build-your-ui.html +0 -41
- package/docs/.island/dist/en/guide/command-preview.html +0 -100
- package/docs/.island/dist/en/guide/extension.html +0 -41
- package/docs/.island/dist/en/guide/getting-started.html +0 -76
- package/docs/.island/dist/en/guide/modify-output-product.html +0 -140
- package/docs/.island/dist/en/guide/publish-your-project.html +0 -91
- package/docs/.island/dist/en/guide/test-your-project.html +0 -72
- package/docs/.island/dist/en/guide/use-micro-generator.html +0 -65
- package/docs/.island/dist/en/guide/using-storybook.html +0 -113
- package/docs/.island/dist/en/guide/welcome.html +0 -53
- package/docs/.island/dist/en/guide/why-module-engineering-solution.html +0 -49
- package/docs/.island/dist/en/index.html +0 -42
- package/docs/.island/dist/react-dom.js +0 -1
- package/docs/.island/dist/react-dom_client.js +0 -1
- package/docs/.island/dist/react.js +0 -1
- package/docs/.island/dist/react_jsx-runtime.js +0 -10
- package/docs/.island/dist/ssr-manifest.json +0 -57
- 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 +0 -347
- package/docs/.island/dist/zh/api/build-preset.html +0 -82
- package/docs/.island/dist/zh/api/design-system.html +0 -149
- package/docs/.island/dist/zh/api/dev.html +0 -46
- package/docs/.island/dist/zh/api/index.html +0 -41
- package/docs/.island/dist/zh/api/plugin.html +0 -48
- package/docs/.island/dist/zh/api/test.html +0 -59
- package/docs/.island/dist/zh/guide/before-getting-started.html +0 -127
- package/docs/.island/dist/zh/guide/build-your-ui.html +0 -41
- package/docs/.island/dist/zh/guide/command-preview.html +0 -100
- package/docs/.island/dist/zh/guide/extension.html +0 -41
- package/docs/.island/dist/zh/guide/getting-started.html +0 -79
- package/docs/.island/dist/zh/guide/modify-output-product.html +0 -140
- package/docs/.island/dist/zh/guide/publish-your-project.html +0 -92
- package/docs/.island/dist/zh/guide/test-your-project.html +0 -72
- package/docs/.island/dist/zh/guide/use-micro-generator.html +0 -65
- package/docs/.island/dist/zh/guide/using-storybook.html +0 -114
- package/docs/.island/dist/zh/guide/welcome.html +0 -53
- package/docs/.island/dist/zh/guide/why-module-engineering-solution.html +0 -49
- package/docs/.island/dist/zh/index.html +0 -42
- package/docs/.island/index.html +0 -39
- package/docs/en/api/design-system.md +0 -524
- package/docs/en/api/dev.md +0 -32
- package/docs/en/api/plugin.md +0 -34
- package/docs/zh/api/build-config.md +0 -570
- package/docs/zh/api/dev.md +0 -33
- package/docs/zh/api/plugins.md +0 -108
|
@@ -1,24 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 5
|
|
3
|
+
---
|
|
4
|
+
|
|
1
5
|
# Build umd products
|
|
2
6
|
|
|
3
7
|
The full name of umd is **Universal Module Definition**, and JS files in this format can run in multiple runtime environments: the
|
|
4
8
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
9
|
+
- Browser environment: module loading based on AMD specification
|
|
10
|
+
- Node.js environment: module loading based on CommonJS
|
|
11
|
+
- Other cases: mount the module on a global object.
|
|
8
12
|
|
|
9
13
|
We can therefore specify the build product of the project as an umd product in the following way:
|
|
10
14
|
|
|
11
|
-
```
|
|
15
|
+
```ts
|
|
12
16
|
export default defineConfig({
|
|
13
17
|
buildConfig: {
|
|
14
18
|
format: 'umd',
|
|
15
|
-
}
|
|
19
|
+
},
|
|
16
20
|
});
|
|
17
21
|
```
|
|
18
22
|
|
|
19
23
|
## Third-party dependency handling for umd products
|
|
20
24
|
|
|
21
|
-
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.
|
|
22
26
|
So when building umd products, we can also use it like this:
|
|
23
27
|
|
|
24
28
|
<CH.Spotlight>
|
|
@@ -49,13 +53,13 @@ If the project depends on `react`.
|
|
|
49
53
|
|
|
50
54
|
`modern.config.ts`.
|
|
51
55
|
|
|
52
|
-
```
|
|
56
|
+
```ts
|
|
53
57
|
export default defineConfig({
|
|
54
58
|
buildConfig: {
|
|
55
59
|
format: 'umd',
|
|
56
60
|
autoExternal: false,
|
|
57
61
|
externals: ['react'],
|
|
58
|
-
}
|
|
62
|
+
},
|
|
59
63
|
});
|
|
60
64
|
```
|
|
61
65
|
|
|
@@ -63,8 +67,8 @@ export default defineConfig({
|
|
|
63
67
|
|
|
64
68
|
When a `react` dependency is used in the source code.
|
|
65
69
|
|
|
66
|
-
```
|
|
67
|
-
import React from
|
|
70
|
+
```tsx src/index.ts
|
|
71
|
+
import React from 'react';
|
|
68
72
|
console.info(React);
|
|
69
73
|
```
|
|
70
74
|
|
|
@@ -72,26 +76,30 @@ console.info(React);
|
|
|
72
76
|
|
|
73
77
|
The `react` code is not packaged into the product at this point.
|
|
74
78
|
|
|
75
|
-
```
|
|
76
|
-
(function(global, factory) {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
79
|
+
```js dist/index.js focus=1:7
|
|
80
|
+
(function (global, factory) {
|
|
81
|
+
if (typeof module === 'object' && typeof module.exports === 'object')
|
|
82
|
+
factory(exports, require('react'));
|
|
83
|
+
else if (typeof define === 'function' && define.amd)
|
|
84
|
+
define(['exports', 'react'], factory);
|
|
85
|
+
else if (
|
|
86
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self)
|
|
87
|
+
)
|
|
88
|
+
factory((global.index = {}), global.react);
|
|
89
|
+
})(this, function (exports, _react) {
|
|
90
|
+
'use strict';
|
|
91
|
+
Object.defineProperty(exports, '__esModule', {
|
|
92
|
+
value: true,
|
|
93
|
+
});
|
|
94
|
+
_react = /*#__PURE__*/ _interopRequireDefault(_react);
|
|
95
|
+
function _interopRequireDefault(obj) {
|
|
96
|
+
return obj && obj.__esModule
|
|
97
|
+
? obj
|
|
98
|
+
: {
|
|
99
|
+
default: obj,
|
|
92
100
|
};
|
|
93
|
-
|
|
94
|
-
|
|
101
|
+
}
|
|
102
|
+
console.info(_react.default);
|
|
95
103
|
});
|
|
96
104
|
```
|
|
97
105
|
|
|
@@ -99,14 +107,13 @@ The `react` code is not packaged into the product at this point.
|
|
|
99
107
|
|
|
100
108
|
We know from the above example that when using the `autoExternal` and `externals` APIs.
|
|
101
109
|
|
|
102
|
-
|
|
103
|
-
|
|
110
|
+
- In a Node.js environment, you can get the react dependency with `require('react')`.
|
|
111
|
+
- In a browser environment, you can get the react dependency via `global.react`.
|
|
104
112
|
|
|
105
|
-
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.
|
|
106
114
|
|
|
107
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:
|
|
108
116
|
|
|
109
|
-
|
|
110
117
|
<CH.Spotlight>
|
|
111
118
|
|
|
112
119
|
```json package.json
|
|
@@ -133,14 +140,14 @@ If the project depends on `react`.
|
|
|
133
140
|
|
|
134
141
|
`modern.config.ts` config file。
|
|
135
142
|
|
|
136
|
-
```
|
|
143
|
+
```ts
|
|
137
144
|
export default defineConfig({
|
|
138
145
|
buildConfig: {
|
|
139
146
|
format: 'umd',
|
|
140
147
|
umdGlobals: {
|
|
141
148
|
react: 'React',
|
|
142
149
|
},
|
|
143
|
-
}
|
|
150
|
+
},
|
|
144
151
|
});
|
|
145
152
|
```
|
|
146
153
|
|
|
@@ -148,8 +155,8 @@ export default defineConfig({
|
|
|
148
155
|
|
|
149
156
|
When a `react` dependency is used in the source code.
|
|
150
157
|
|
|
151
|
-
```
|
|
152
|
-
import React from
|
|
158
|
+
```tsx src/index.ts
|
|
159
|
+
import React from 'react';
|
|
153
160
|
console.info(React);
|
|
154
161
|
```
|
|
155
162
|
|
|
@@ -157,22 +164,26 @@ console.info(React);
|
|
|
157
164
|
|
|
158
165
|
At this point we will see the product code like this.
|
|
159
166
|
|
|
160
|
-
```
|
|
161
|
-
(function(global, factory) {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
167
|
+
```js dist/index.js focus=7:12
|
|
168
|
+
(function (global, factory) {
|
|
169
|
+
if (typeof module === 'object' && typeof module.exports === 'object')
|
|
170
|
+
factory();
|
|
171
|
+
else if (typeof define === 'function' && define.amd) define([], factory);
|
|
172
|
+
else if (
|
|
173
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self)
|
|
174
|
+
)
|
|
175
|
+
factory();
|
|
176
|
+
})(this, function () {
|
|
177
|
+
// ...
|
|
178
|
+
// libuild:globals:react
|
|
179
|
+
var require_react = __commonJS({
|
|
180
|
+
'libuild:globals:react'(exports, module1) {
|
|
181
|
+
module1.exports = Function('return this')()['React'];
|
|
182
|
+
},
|
|
183
|
+
});
|
|
184
|
+
// src/index.ts
|
|
185
|
+
var import_react = __toESM(require_react());
|
|
186
|
+
console.info(import_react.default);
|
|
176
187
|
});
|
|
177
188
|
```
|
|
178
189
|
|
|
@@ -180,62 +191,59 @@ At this point we will see the product code like this.
|
|
|
180
191
|
|
|
181
192
|
The project can then run in the browser and use the `React` variables that exist on the global object.
|
|
182
193
|
|
|
183
|
-
|
|
184
194
|
## Changing the name of a global variable in a project
|
|
185
195
|
|
|
186
196
|
When we package the following code into an umd product and run it in the browser, we can use the module via `window.index`.
|
|
187
197
|
|
|
188
|
-
```
|
|
198
|
+
```ts ./src/index.ts
|
|
189
199
|
export default () => {
|
|
190
200
|
console.info('hello world');
|
|
191
|
-
}
|
|
201
|
+
};
|
|
192
202
|
```
|
|
193
203
|
|
|
194
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:
|
|
195
205
|
|
|
196
|
-
```
|
|
197
|
-
(function(global, factory) {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
], factory);
|
|
202
|
-
|
|
203
|
-
|
|
206
|
+
```js ./dist/index.js focus=6:6
|
|
207
|
+
(function (global, factory) {
|
|
208
|
+
if (typeof module === 'object' && typeof module.exports === 'object')
|
|
209
|
+
factory(exports);
|
|
210
|
+
else if (typeof define === 'function' && define.amd)
|
|
211
|
+
define(['exports'], factory);
|
|
212
|
+
else if (
|
|
213
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self)
|
|
214
|
+
)
|
|
215
|
+
factory((global.index = {}));
|
|
216
|
+
})(this, function (exports) {
|
|
204
217
|
//...
|
|
205
218
|
});
|
|
206
219
|
```
|
|
207
220
|
|
|
208
|
-
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.
|
|
209
222
|
|
|
210
223
|
When this API is used:
|
|
211
224
|
|
|
212
|
-
```
|
|
225
|
+
```ts
|
|
213
226
|
export default defineConfig({
|
|
214
227
|
buildConfig: {
|
|
215
228
|
format: 'umd',
|
|
216
229
|
umdModuleName: 'myLib',
|
|
217
|
-
}
|
|
230
|
+
},
|
|
218
231
|
});
|
|
219
232
|
```
|
|
220
233
|
|
|
221
234
|
The construction products at this point are:
|
|
222
235
|
|
|
223
|
-
```
|
|
224
|
-
(function(global, factory) {
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
], factory);
|
|
229
|
-
|
|
230
|
-
|
|
236
|
+
```js ./dist/index.js focus=6:6
|
|
237
|
+
(function (global, factory) {
|
|
238
|
+
if (typeof module === 'object' && typeof module.exports === 'object')
|
|
239
|
+
factory(exports);
|
|
240
|
+
else if (typeof define === 'function' && define.amd)
|
|
241
|
+
define(['exports'], factory);
|
|
242
|
+
else if (
|
|
243
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self)
|
|
244
|
+
)
|
|
245
|
+
factory((global.myLib = {}));
|
|
246
|
+
})(this, function (exports) {
|
|
231
247
|
//...
|
|
232
248
|
});
|
|
233
249
|
```
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 3
|
|
3
|
+
---
|
|
4
|
+
|
|
1
5
|
# Use the Copy Tools
|
|
2
6
|
|
|
3
7
|
The Module Project provides the Copy utility for copying already existing individual files or entire directories into the product directory. Next we learn how to use it.
|
|
4
8
|
|
|
5
9
|
## Understanding the Copy API
|
|
6
10
|
|
|
7
|
-
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.
|
|
8
12
|
|
|
9
|
-
|
|
10
|
-
|
|
13
|
+
- [`patterns`](/en/api/config/build-config#copypatterns)
|
|
14
|
+
- [`options`](/en/api/config/build-config#copyoptions)
|
|
11
15
|
|
|
12
16
|
It is recommended to spend some time getting to know them before you start learning.
|
|
13
17
|
|
|
@@ -17,23 +21,24 @@ It is recommended to spend some time getting to know them before you start learn
|
|
|
17
21
|
|
|
18
22
|
其中 `patterns.from` 用于指定要复制的文件或者目录。它接收 Glob 形式字符串或具体路径。Glob 形式字符串是指 [fast-glob pattern-syntax](https://github.com/mrmlnc/fast-glob#pattern-syntax)。因此我们可以按照如下两种方式使用它:
|
|
19
23
|
|
|
20
|
-
```
|
|
24
|
+
```ts
|
|
21
25
|
export default defineConfig({
|
|
22
26
|
buildConfig: {
|
|
23
27
|
copy: {
|
|
24
28
|
patterns: [
|
|
25
|
-
{ from: './index.html', to: ''},
|
|
26
|
-
{ from: './*.html', to: ''},
|
|
27
|
-
]
|
|
28
|
-
}
|
|
29
|
-
}
|
|
29
|
+
{ from: './index.html', to: '' },
|
|
30
|
+
{ from: './*.html', to: '' },
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
},
|
|
30
34
|
});
|
|
31
35
|
```
|
|
32
36
|
|
|
33
|
-
`patterns.context` 一般和 `patterns.from` 配合使用,默认情况下它的值与 [`buildConfig.sourceDir`](/
|
|
37
|
+
`patterns.context` 一般和 `patterns.from` 配合使用,默认情况下它的值与 [`buildConfig.sourceDir`](/api/config/build-config#sourcedir) 相同,因此我们可以按照如下方式指定 `src/data.json` 文件为要复制的文件:
|
|
38
|
+
|
|
34
39
|
> 默认情况下,`buildConfig.sourceDir` 为 `src`
|
|
35
40
|
|
|
36
|
-
```
|
|
41
|
+
```ts
|
|
37
42
|
export default defineConfig({
|
|
38
43
|
buildConfig: {
|
|
39
44
|
copy: {
|
|
@@ -65,15 +70,13 @@ export default defineConfig({
|
|
|
65
70
|
});
|
|
66
71
|
```
|
|
67
72
|
|
|
68
|
-
`patterns.to` 用于指定复制文件的输出路径,默认情况下它的值为 [`buildConfig.
|
|
73
|
+
`patterns.to` 用于指定复制文件的输出路径,默认情况下它的值为 [`buildConfig.outDir`](/api/config/build-config#outDir)对应的值。因此我们按照如下方式将 `src/index.html` 复制到 `dist` 目录下:
|
|
69
74
|
|
|
70
|
-
```
|
|
75
|
+
```ts
|
|
71
76
|
export default defineConfig({
|
|
72
77
|
buildConfig: {
|
|
73
78
|
copy: {
|
|
74
|
-
patterns: [
|
|
75
|
-
{ from: './index.html', }
|
|
76
|
-
],
|
|
79
|
+
patterns: [{ from: './index.html' }],
|
|
77
80
|
},
|
|
78
81
|
},
|
|
79
82
|
});
|
|
@@ -81,22 +84,22 @@ export default defineConfig({
|
|
|
81
84
|
|
|
82
85
|
当我们配置了 `patterns.to` 的时候:
|
|
83
86
|
|
|
84
|
-
|
|
85
|
-
|
|
87
|
+
- 如果是相对路径,则该路径会相对于 `buildConfig.outDir` 计算出复制文件输出的绝对路径。
|
|
88
|
+
- 如果是绝对路径,则会直接使用该值。
|
|
86
89
|
|
|
87
90
|
最后 `patterns.globOptions` 用于配置寻找复制文件 [globby](https://github.com/sindresorhus/globby) 对象,其配置可参考:
|
|
88
91
|
|
|
89
|
-
|
|
92
|
+
- [globby.options](https://github.com/sindresorhus/globby#options)
|
|
90
93
|
|
|
91
94
|
## 不同场景使用示例
|
|
92
95
|
|
|
93
96
|
### 将文件复制文件
|
|
94
97
|
|
|
95
|
-
```
|
|
98
|
+
```ts
|
|
96
99
|
export default defineConfig({
|
|
97
100
|
buildConfig: [
|
|
98
101
|
{
|
|
99
|
-
|
|
102
|
+
outDir: 'dist',
|
|
100
103
|
copy: {
|
|
101
104
|
patterns: [
|
|
102
105
|
/**
|
|
@@ -110,17 +113,17 @@ export default defineConfig({
|
|
|
110
113
|
],
|
|
111
114
|
},
|
|
112
115
|
},
|
|
113
|
-
]
|
|
116
|
+
],
|
|
114
117
|
});
|
|
115
118
|
```
|
|
116
119
|
|
|
117
120
|
### 将文件复制到目录
|
|
118
121
|
|
|
119
|
-
```
|
|
122
|
+
```ts
|
|
120
123
|
export default defineConfig({
|
|
121
124
|
buildConfig: [
|
|
122
125
|
{
|
|
123
|
-
|
|
126
|
+
outDir: 'dist',
|
|
124
127
|
copy: {
|
|
125
128
|
patterns: [
|
|
126
129
|
/**
|
|
@@ -140,11 +143,11 @@ export default defineConfig({
|
|
|
140
143
|
|
|
141
144
|
### 从目录复制到目录
|
|
142
145
|
|
|
143
|
-
```
|
|
146
|
+
```ts
|
|
144
147
|
export default defineConfig({
|
|
145
148
|
buildConfig: [
|
|
146
149
|
{
|
|
147
|
-
|
|
150
|
+
outDir: 'dist',
|
|
148
151
|
copy: {
|
|
149
152
|
patterns: [
|
|
150
153
|
/**
|
|
@@ -167,11 +170,11 @@ export default defineConfig({
|
|
|
167
170
|
|
|
168
171
|
### 从目录到文件
|
|
169
172
|
|
|
170
|
-
```
|
|
173
|
+
```ts
|
|
171
174
|
export default defineConfig({
|
|
172
175
|
buildConfig: [
|
|
173
176
|
{
|
|
174
|
-
|
|
177
|
+
outDir: 'dist',
|
|
175
178
|
copy: {
|
|
176
179
|
patterns: [
|
|
177
180
|
/**
|
|
@@ -194,11 +197,11 @@ export default defineConfig({
|
|
|
194
197
|
|
|
195
198
|
### 使用 Glob
|
|
196
199
|
|
|
197
|
-
```
|
|
200
|
+
```ts
|
|
198
201
|
export default defineConfig({
|
|
199
202
|
buildConfig: [
|
|
200
203
|
{
|
|
201
|
-
|
|
204
|
+
outDir: 'dist',
|
|
202
205
|
copy: {
|
|
203
206
|
patterns: [
|
|
204
207
|
/**
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 4
|
|
3
|
+
---
|
|
4
|
+
|
|
1
5
|
# How to handle third-party dependencies
|
|
2
6
|
|
|
3
7
|
Generally, third-party dependencies required by a project can be installed via the `install` command in the package manager. After the third-party dependencies are successfully installed, they will generally appear under `dependencies` and `devDependencies` in the project `package.json`.
|
|
4
8
|
|
|
5
|
-
```
|
|
9
|
+
```json pacakge.json
|
|
6
10
|
{
|
|
7
|
-
|
|
8
|
-
|
|
11
|
+
"dependencies": {},
|
|
12
|
+
"devDependencies": {}
|
|
9
13
|
}
|
|
10
14
|
```
|
|
11
15
|
|
|
@@ -15,19 +19,19 @@ In addition to `"dependencies"`, [`"peerDependencies"`](/en/guide/basic/before-g
|
|
|
15
19
|
|
|
16
20
|
## Default handling of third-party dependencies
|
|
17
21
|
|
|
18
|
-
By default, third-party dependencies under `"dependencies"` and `"peerDependencies"` are not packaged in the module project
|
|
22
|
+
By default, third-party dependencies under `"dependencies"` and `"peerDependencies"` are not packaged in the module project\*\*, so:
|
|
19
23
|
|
|
20
24
|
<CH.Spotlight>
|
|
21
25
|
|
|
22
26
|
```json ./v1/package.json
|
|
23
27
|
{
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"react": "^17"
|
|
30
|
+
},
|
|
31
|
+
// or
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"react": "^17"
|
|
34
|
+
}
|
|
31
35
|
}
|
|
32
36
|
```
|
|
33
37
|
|
|
@@ -42,7 +46,7 @@ If the project has a dependency on `react`.
|
|
|
42
46
|
},
|
|
43
47
|
// or
|
|
44
48
|
"peerDependencies": {
|
|
45
|
-
|
|
49
|
+
"react": "^17"
|
|
46
50
|
}
|
|
47
51
|
}
|
|
48
52
|
```
|
|
@@ -51,8 +55,8 @@ If the project has a dependency on `react`.
|
|
|
51
55
|
|
|
52
56
|
When a `react` dependency is used in the source code.
|
|
53
57
|
|
|
54
|
-
```
|
|
55
|
-
import React from
|
|
58
|
+
```tsx src/index.ts
|
|
59
|
+
import React from 'react';
|
|
56
60
|
console.info(React);
|
|
57
61
|
```
|
|
58
62
|
|
|
@@ -60,8 +64,8 @@ console.info(React);
|
|
|
60
64
|
|
|
61
65
|
The `react` code is not packaged into the product at this point.
|
|
62
66
|
|
|
63
|
-
```
|
|
64
|
-
import React from
|
|
67
|
+
```js dist/index.js
|
|
68
|
+
import React from 'react';
|
|
65
69
|
console.info(React);
|
|
66
70
|
```
|
|
67
71
|
|
|
@@ -77,32 +81,32 @@ So how do you enable the packaging of third-party dependencies in your module pr
|
|
|
77
81
|
|
|
78
82
|
The following APIs are provided in the build configuration to handle third-party dependencies:
|
|
79
83
|
|
|
80
|
-
|
|
81
|
-
|
|
84
|
+
- [`buildConfig.autoExternal`](/en/api/config/build-config#autoexternal)
|
|
85
|
+
- [`buildConfig.externals`](/en/api/config/build-config#externals)
|
|
82
86
|
|
|
83
87
|
### Turn off default behavior
|
|
84
88
|
|
|
85
89
|
When we want to turn off the default handling behavior for third-party dependencies, we can do so by:
|
|
86
90
|
|
|
87
|
-
```
|
|
91
|
+
```ts
|
|
88
92
|
export default defineConfig({
|
|
89
93
|
buildConfig: {
|
|
90
94
|
autoExternal: false,
|
|
91
|
-
}
|
|
95
|
+
},
|
|
92
96
|
});
|
|
93
97
|
```
|
|
94
98
|
|
|
95
99
|
This way the dependencies under `"dependencies"` and `"peerDependencies"` will be packaged. If you want to turn off the processing of only one of these dependencies, you can use the
|
|
96
100
|
`buildConfig.autoExternal` in the form of an object.
|
|
97
101
|
|
|
98
|
-
```
|
|
102
|
+
```ts
|
|
99
103
|
export default defineConfig({
|
|
100
104
|
buildConfig: {
|
|
101
105
|
autoExternal: {
|
|
102
106
|
dependencies: false,
|
|
103
107
|
peerDependencies: false,
|
|
104
108
|
},
|
|
105
|
-
}
|
|
109
|
+
},
|
|
106
110
|
});
|
|
107
111
|
```
|
|
108
112
|
|
|
@@ -115,7 +119,7 @@ For example, when we need to leave only certain dependencies unpacked, we can co
|
|
|
115
119
|
|
|
116
120
|
> In this case, it is likely that some dependencies are not suitable for packaging. If this is the case, then you can handle it as follows.
|
|
117
121
|
|
|
118
|
-
```
|
|
122
|
+
```ts
|
|
119
123
|
epxort default defineConfig({
|
|
120
124
|
buildConfig: {
|
|
121
125
|
autoExternal: false,
|