@modern-js/module-tools-docs 2.0.2 → 2.2.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/doc_build/html/main/index.html +1 -1
- package/doc_build/static/css/main.css +267 -660
- package/doc_build/static/css/main.css.map +1 -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 +6 -23
- package/doc_build/static/css/vendors-node_modules_pnpm_remix-run_router_1_2_0_node_modules_remix-run_router_dist_router_js-9d5e9c.css.map +1 -1
- package/doc_build/static/js/async/en_api_config_build-config.js +79 -36
- package/doc_build/static/js/async/en_api_config_build-config.js.map +1 -1
- package/doc_build/static/js/async/en_api_config_build-preset.js +40 -20
- package/doc_build/static/js/async/en_api_config_build-preset.js.map +1 -1
- package/doc_build/static/js/async/en_api_config_design-system.js +33800 -2340
- package/doc_build/static/js/async/en_api_config_design-system.js.map +1 -1
- package/doc_build/static/js/async/en_api_config_plugins.js +15 -19
- package/doc_build/static/js/async/en_api_config_testing.js +26 -24
- package/doc_build/static/js/async/en_api_config_testing.js.map +1 -1
- package/doc_build/static/js/async/{en_api_.js → en_api_index.js} +10 -14
- package/doc_build/static/js/async/en_api_index.js.map +1 -0
- package/doc_build/static/js/async/en_api_plugin-api_plugin-hooks.js +24 -26
- package/doc_build/static/js/async/en_api_plugin-api_plugin-hooks.js.map +1 -1
- package/doc_build/static/js/async/en_guide_advance_asset.js +16 -41
- package/doc_build/static/js/async/en_guide_advance_asset.js.map +1 -1
- package/doc_build/static/js/async/en_guide_advance_build-umd.js +20 -24
- package/doc_build/static/js/async/en_guide_advance_copy.js +25 -23
- package/doc_build/static/js/async/en_guide_advance_copy.js.map +1 -1
- package/doc_build/static/js/async/en_guide_advance_external-dependency.js +15 -19
- package/doc_build/static/js/async/en_guide_advance_in-depth-about-build.js +352 -94
- package/doc_build/static/js/async/en_guide_advance_in-depth-about-build.js.map +1 -1
- package/doc_build/static/js/async/en_guide_advance_in-depth-about-dev-command.js +11 -15
- package/doc_build/static/js/async/en_guide_advance_in-depth-about-dev-command.js.map +1 -1
- package/doc_build/static/js/async/en_guide_advance_theme-config.js +26 -24
- package/doc_build/static/js/async/en_guide_advance_theme-config.js.map +1 -1
- package/doc_build/static/js/async/en_guide_basic_before-getting-started.js +275 -88
- package/doc_build/static/js/async/en_guide_basic_before-getting-started.js.map +1 -1
- package/doc_build/static/js/async/en_guide_basic_command-preview.js +45 -33
- package/doc_build/static/js/async/en_guide_basic_command-preview.js.map +1 -1
- package/doc_build/static/js/async/en_guide_basic_modify-output-product.js +274 -196
- package/doc_build/static/js/async/en_guide_basic_modify-output-product.js.map +1 -1
- package/doc_build/static/js/async/en_guide_basic_publish-your-project.js +18 -20
- package/doc_build/static/js/async/en_guide_basic_publish-your-project.js.map +1 -1
- package/doc_build/static/js/async/en_guide_basic_test-your-project.js +27 -32
- package/doc_build/static/js/async/en_guide_basic_test-your-project.js.map +1 -1
- package/doc_build/static/js/async/en_guide_basic_use-micro-generator.js +33 -15
- package/doc_build/static/js/async/en_guide_basic_use-micro-generator.js.map +1 -1
- package/doc_build/static/js/async/en_guide_basic_using-storybook.js +24 -63
- package/doc_build/static/js/async/en_guide_basic_using-storybook.js.map +1 -1
- package/doc_build/static/js/async/en_guide_best-practices_components.js +39 -27
- package/doc_build/static/js/async/en_guide_best-practices_components.js.map +1 -1
- package/doc_build/static/js/async/en_guide_intro_getting-started.js +288 -45
- package/doc_build/static/js/async/en_guide_intro_getting-started.js.map +1 -1
- package/doc_build/static/js/async/en_guide_intro_welcome.js +27 -13
- package/doc_build/static/js/async/en_guide_intro_welcome.js.map +1 -1
- package/doc_build/static/js/async/en_guide_intro_why-module-engineering-solution.js +16 -12
- package/doc_build/static/js/async/en_guide_intro_why-module-engineering-solution.js.map +1 -1
- package/doc_build/static/js/async/{en_.js → en_index.js} +12 -16
- package/doc_build/static/js/async/en_index.js.map +1 -0
- package/doc_build/static/js/async/en_plugins_guide_getting-started.js +17 -21
- package/doc_build/static/js/async/en_plugins_guide_plugin-object.js +20 -24
- package/doc_build/static/js/async/en_plugins_guide_setup-function.js +19 -23
- package/doc_build/static/js/async/en_plugins_guide_setup-function.js.map +1 -1
- package/doc_build/static/js/async/en_plugins_official-list_overview.js +8 -12
- package/doc_build/static/js/async/packages_cli_doc-core_src_theme-default_components_Search_logic_search_ts.js +166 -367
- package/doc_build/static/js/async/packages_cli_doc-core_src_theme-default_components_Search_logic_search_ts.js.map +1 -1
- package/doc_build/static/js/async/{api_config_build-config.js → zh_api_config_build-config.js} +80 -35
- package/doc_build/static/js/async/{api_config_build-config.js.map → zh_api_config_build-config.js.map} +1 -1
- package/doc_build/static/js/async/{api_config_build-preset.js → zh_api_config_build-preset.js} +39 -21
- package/doc_build/static/js/async/{api_config_build-preset.js.map → zh_api_config_build-preset.js.map} +1 -1
- package/doc_build/static/js/async/{api_config_design-system.js → zh_api_config_design-system.js} +27 -23
- package/doc_build/static/js/async/{api_config_design-system.js.map → zh_api_config_design-system.js.map} +1 -1
- package/doc_build/static/js/async/{api_config_plugins.js → zh_api_config_plugins.js} +17 -21
- package/doc_build/static/js/async/{api_config_plugins.js.map → zh_api_config_plugins.js.map} +1 -1
- package/doc_build/static/js/async/{api_config_testing.js → zh_api_config_testing.js} +28 -26
- package/doc_build/static/js/async/{api_config_testing.js.map → zh_api_config_testing.js.map} +1 -1
- package/doc_build/static/js/async/{api_.js → zh_api_index.js} +10 -14
- package/doc_build/static/js/async/zh_api_index.js.map +1 -0
- package/doc_build/static/js/async/{api_plugin-api_plugin-hooks.js → zh_api_plugin-api_plugin-hooks.js} +25 -27
- package/doc_build/static/js/async/{api_plugin-api_plugin-hooks.js.map → zh_api_plugin-api_plugin-hooks.js.map} +1 -1
- package/doc_build/static/js/async/{guide_advance_asset.js → zh_guide_advance_asset.js} +18 -43
- package/doc_build/static/js/async/{guide_advance_asset.js.map → zh_guide_advance_asset.js.map} +1 -1
- package/doc_build/static/js/async/{guide_advance_build-umd.js → zh_guide_advance_build-umd.js} +22 -26
- package/doc_build/static/js/async/{guide_advance_build-umd.js.map → zh_guide_advance_build-umd.js.map} +1 -1
- package/doc_build/static/js/async/{guide_advance_copy.js → zh_guide_advance_copy.js} +26 -24
- package/doc_build/static/js/async/{guide_advance_copy.js.map → zh_guide_advance_copy.js.map} +1 -1
- package/doc_build/static/js/async/{guide_advance_external-dependency.js → zh_guide_advance_external-dependency.js} +17 -21
- package/doc_build/static/js/async/{guide_advance_external-dependency.js.map → zh_guide_advance_external-dependency.js.map} +1 -1
- package/doc_build/static/js/async/{guide_advance_in-depth-about-build.js → zh_guide_advance_in-depth-about-build.js} +353 -95
- package/doc_build/static/js/async/{guide_advance_in-depth-about-build.js.map → zh_guide_advance_in-depth-about-build.js.map} +1 -1
- package/doc_build/static/js/async/{guide_advance_in-depth-about-dev-command.js → zh_guide_advance_in-depth-about-dev-command.js} +16 -18
- package/doc_build/static/js/async/zh_guide_advance_in-depth-about-dev-command.js.map +1 -0
- package/doc_build/static/js/async/{guide_advance_theme-config.js → zh_guide_advance_theme-config.js} +24 -22
- package/doc_build/static/js/async/{guide_advance_theme-config.js.map → zh_guide_advance_theme-config.js.map} +1 -1
- package/doc_build/static/js/async/{guide_basic_before-getting-started.js → zh_guide_basic_before-getting-started.js} +272 -85
- package/doc_build/static/js/async/zh_guide_basic_before-getting-started.js.map +1 -0
- package/doc_build/static/js/async/{guide_basic_command-preview.js → zh_guide_basic_command-preview.js} +47 -35
- package/doc_build/static/js/async/zh_guide_basic_command-preview.js.map +1 -0
- package/doc_build/static/js/async/{guide_basic_modify-output-product.js → zh_guide_basic_modify-output-product.js} +203 -88
- package/doc_build/static/js/async/zh_guide_basic_modify-output-product.js.map +1 -0
- package/doc_build/static/js/async/{guide_basic_publish-your-project.js → zh_guide_basic_publish-your-project.js} +20 -22
- package/doc_build/static/js/async/{guide_basic_publish-your-project.js.map → zh_guide_basic_publish-your-project.js.map} +1 -1
- package/doc_build/static/js/async/{guide_basic_test-your-project.js → zh_guide_basic_test-your-project.js} +30 -35
- package/doc_build/static/js/async/{guide_basic_test-your-project.js.map → zh_guide_basic_test-your-project.js.map} +1 -1
- package/doc_build/static/js/async/{guide_basic_use-micro-generator.js → zh_guide_basic_use-micro-generator.js} +40 -20
- package/doc_build/static/js/async/zh_guide_basic_use-micro-generator.js.map +1 -0
- package/doc_build/static/js/async/{guide_basic_using-storybook.js → zh_guide_basic_using-storybook.js} +78 -171
- package/doc_build/static/js/async/{guide_basic_using-storybook.js.map → zh_guide_basic_using-storybook.js.map} +1 -1
- package/doc_build/static/js/async/{guide_best-practices_components.js → zh_guide_best-practices_components.js} +41 -29
- package/doc_build/static/js/async/{guide_best-practices_components.js.map → zh_guide_best-practices_components.js.map} +1 -1
- package/doc_build/static/js/async/{guide_intro_getting-started.js → zh_guide_intro_getting-started.js} +291 -42
- package/doc_build/static/js/async/{guide_intro_getting-started.js.map → zh_guide_intro_getting-started.js.map} +1 -1
- package/doc_build/static/js/async/{guide_intro_welcome.js → zh_guide_intro_welcome.js} +28 -14
- package/doc_build/static/js/async/zh_guide_intro_welcome.js.map +1 -0
- package/doc_build/static/js/async/{guide_intro_why-module-engineering-solution.js → zh_guide_intro_why-module-engineering-solution.js} +18 -14
- package/doc_build/static/js/async/zh_guide_intro_why-module-engineering-solution.js.map +1 -0
- package/doc_build/static/js/async/{index.js → zh_index.js} +11 -15
- package/doc_build/static/js/async/zh_index.js.map +1 -0
- package/doc_build/static/js/async/{plugins_guide_getting-started.js → zh_plugins_guide_getting-started.js} +19 -23
- package/doc_build/static/js/async/{plugins_guide_getting-started.js.map → zh_plugins_guide_getting-started.js.map} +1 -1
- package/doc_build/static/js/async/{plugins_guide_plugin-object.js → zh_plugins_guide_plugin-object.js} +22 -26
- package/doc_build/static/js/async/{plugins_guide_plugin-object.js.map → zh_plugins_guide_plugin-object.js.map} +1 -1
- package/doc_build/static/js/async/{plugins_guide_setup-function.js → zh_plugins_guide_setup-function.js} +21 -25
- package/doc_build/static/js/async/{plugins_guide_setup-function.js.map → zh_plugins_guide_setup-function.js.map} +1 -1
- package/doc_build/static/js/async/{plugins_official-list_overview.js → zh_plugins_official-list_overview.js} +10 -14
- package/doc_build/static/js/async/zh_plugins_official-list_overview.js.map +1 -0
- package/doc_build/static/js/builder-runtime.js +1 -1
- package/doc_build/static/js/builder-runtime.js.map +1 -1
- package/doc_build/static/js/lib-polyfill.js +3433 -16355
- package/doc_build/static/js/lib-polyfill.js.map +1 -1
- package/doc_build/static/js/main.js +2073 -2700
- package/doc_build/static/js/main.js.map +1 -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 +485 -1689
- package/doc_build/static/js/vendors-node_modules_pnpm_remix-run_router_1_2_0_node_modules_remix-run_router_dist_router_js-9d5e9c.js.map +1 -1
- package/doc_build/static/search_index.json +1 -0
- package/docs/.island/dist/404.html +41 -0
- package/docs/.island/dist/assets/asset.26aea654.js +160 -0
- package/docs/.island/dist/assets/asset.36e3d3c9.js +160 -0
- package/docs/.island/dist/assets/before-getting-started.0e863740.js +87 -0
- package/docs/.island/dist/assets/before-getting-started.2c6e6b8a.js +87 -0
- package/docs/.island/dist/assets/build-config.460d11d9.js +804 -0
- package/docs/.island/dist/assets/build-config.e155e534.js +854 -0
- package/docs/.island/dist/assets/build-preset.6c2c6c62.js +256 -0
- package/docs/.island/dist/assets/build-preset.d3da921d.js +256 -0
- package/docs/.island/dist/assets/build-umd.ba00f028.js +264 -0
- package/docs/.island/dist/assets/build-umd.edb9d163.js +273 -0
- package/docs/.island/dist/assets/command-preview.1dc93921.js +264 -0
- package/docs/.island/dist/assets/command-preview.ef7a9d01.js +264 -0
- package/docs/.island/dist/assets/components.esm.03560353.js +9 -0
- package/docs/.island/dist/assets/copy.28dc4d5f.js +277 -0
- package/docs/.island/dist/assets/copy.f4625565.js +277 -0
- package/docs/.island/dist/assets/design-system.8993234c.js +1254 -0
- package/docs/.island/dist/assets/design-system.b0ba163f.js +639 -0
- package/docs/.island/dist/assets/dev.b373b152.js +37 -0
- package/docs/.island/dist/assets/dev.b39fd42a.js +37 -0
- package/docs/.island/dist/assets/down.f35427d3.svg +1 -0
- package/docs/.island/dist/assets/extension.4bf3526b.js +1 -0
- package/docs/.island/dist/assets/extension.d64ed0b8.js +469 -0
- package/docs/.island/dist/assets/external-dependency.2ede7532.js +156 -0
- package/docs/.island/dist/assets/external-dependency.92ca89e0.js +156 -0
- package/docs/.island/dist/assets/getting-started.822cf0b2.js +117 -0
- package/docs/.island/dist/assets/getting-started.e2764829.js +114 -0
- package/docs/.island/dist/assets/github.3bf8ccee.svg +1 -0
- package/docs/.island/dist/assets/in-depth-about-build.94cc902d.js +375 -0
- package/docs/.island/dist/assets/in-depth-about-build.aa74de10.js +374 -0
- package/docs/.island/dist/assets/in-depth-about-dev-command.877bdb83.js +33 -0
- package/docs/.island/dist/assets/in-depth-about-dev-command.9736befd.js +39 -0
- package/docs/.island/dist/assets/index.01786ba7.js +30 -0
- package/docs/.island/dist/assets/index.6cef6f5f.js +4 -0
- package/docs/.island/dist/assets/index.cb118238.js +36 -0
- package/docs/.island/dist/assets/index.ccb6ce27.js +4 -0
- package/docs/.island/dist/assets/island_inject.69495876.js +1 -0
- package/docs/.island/dist/assets/island_inject.cdfb22d9.js +1 -0
- package/docs/.island/dist/assets/loading.8c9bb911.svg +1 -0
- package/docs/.island/dist/assets/modify-output-product.9e2394d7.js +100 -0
- package/docs/.island/dist/assets/modify-output-product.f363845a.js +100 -0
- package/docs/.island/dist/assets/moon.6b705924.svg +3 -0
- package/docs/.island/dist/assets/plugin.70a61997.js +42 -0
- package/docs/.island/dist/assets/plugin.80b12ee2.js +42 -0
- package/docs/.island/dist/assets/publish-your-project.7321c10e.js +164 -0
- package/docs/.island/dist/assets/publish-your-project.7326359f.js +166 -0
- package/docs/.island/dist/assets/right.89674cd7.svg +1 -0
- package/docs/.island/dist/assets/search.0aea6901.svg +1 -0
- package/docs/.island/dist/assets/search.11353245.js +222 -0
- package/docs/.island/dist/assets/search.a1b1cff3.js +3 -0
- package/docs/.island/dist/assets/search.f9025ced.js +3 -0
- package/docs/.island/dist/assets/style.09015a4b.css +1 -0
- package/docs/.island/dist/assets/style.2e5f7bc2.css +1970 -0
- package/docs/.island/dist/assets/sun.841dac10.svg +11 -0
- package/docs/.island/dist/assets/test-your-project.8ab2809e.js +190 -0
- package/docs/.island/dist/assets/test-your-project.9ae2a49e.js +190 -0
- package/docs/.island/dist/assets/test.2bfe276b.js +66 -0
- package/docs/.island/dist/assets/test.a2c00a3f.js +67 -0
- package/docs/.island/dist/assets/translator.b1077c44.svg +1 -0
- package/docs/.island/dist/assets/use-micro-generator.13c1a09f.js +60 -0
- package/docs/.island/dist/assets/use-micro-generator.dfe877f6.js +60 -0
- package/docs/.island/dist/assets/using-storybook.adb88cb8.js +260 -0
- package/docs/.island/dist/assets/using-storybook.b8e7dd04.js +260 -0
- package/docs/.island/dist/assets/welcome.94880043.js +13 -0
- package/docs/.island/dist/assets/welcome.b2140e7e.js +13 -0
- package/docs/.island/dist/assets/why-module-engineering-solution.bfe7981a.js +26 -0
- package/docs/.island/dist/assets/why-module-engineering-solution.e31cd19f.js +26 -0
- package/docs/.island/dist/chunk-COLCRJ2V.js +1 -0
- package/docs/.island/dist/chunk-K5FMOYDC.js +10 -0
- package/docs/.island/dist/chunk-WE42KMYS.js +26 -0
- package/docs/.island/dist/client-entry.js +3 -0
- package/docs/.island/dist/en/api/build-config.html +344 -0
- package/docs/.island/dist/en/api/build-preset.html +82 -0
- package/docs/.island/dist/en/api/design-system.html +155 -0
- package/docs/.island/dist/en/api/dev.html +45 -0
- package/docs/.island/dist/en/api/index.html +41 -0
- package/docs/.island/dist/en/api/plugin.html +48 -0
- package/docs/.island/dist/en/api/test.html +58 -0
- package/docs/.island/dist/en/guide/advance/asset.html +68 -0
- package/docs/.island/dist/en/guide/advance/build-umd.html +72 -0
- package/docs/.island/dist/en/guide/advance/copy.html +82 -0
- package/docs/.island/dist/en/guide/advance/extension.html +41 -0
- package/docs/.island/dist/en/guide/advance/external-dependency.html +71 -0
- package/docs/.island/dist/en/guide/advance/in-depth-about-build.html +148 -0
- package/docs/.island/dist/en/guide/advance/in-depth-about-dev-command.html +51 -0
- package/docs/.island/dist/en/guide/basic/before-getting-started.html +127 -0
- package/docs/.island/dist/en/guide/basic/command-preview.html +100 -0
- package/docs/.island/dist/en/guide/basic/modify-output-product.html +140 -0
- package/docs/.island/dist/en/guide/basic/publish-your-project.html +91 -0
- package/docs/.island/dist/en/guide/basic/test-your-project.html +72 -0
- package/docs/.island/dist/en/guide/basic/use-micro-generator.html +65 -0
- package/docs/.island/dist/en/guide/basic/using-storybook.html +113 -0
- package/docs/.island/dist/en/guide/intro/getting-started.html +76 -0
- package/docs/.island/dist/en/guide/intro/welcome.html +53 -0
- package/docs/.island/dist/en/guide/intro/why-module-engineering-solution.html +49 -0
- package/docs/.island/dist/en/index.html +42 -0
- package/docs/.island/dist/react-dom.js +1 -0
- package/docs/.island/dist/react-dom_client.js +1 -0
- package/docs/.island/dist/react.js +1 -0
- package/docs/.island/dist/react_jsx-runtime.js +10 -0
- package/docs/.island/dist/ssr-manifest.json +57 -0
- package/docs/.island/dist/test-result.png +0 -0
- package/docs/.island/dist/why-module-solution.png +0 -0
- package/docs/.island/dist/zh/api/build-config.html +361 -0
- package/docs/.island/dist/zh/api/build-preset.html +82 -0
- package/docs/.island/dist/zh/api/design-system.html +149 -0
- package/docs/.island/dist/zh/api/dev.html +46 -0
- package/docs/.island/dist/zh/api/index.html +41 -0
- package/docs/.island/dist/zh/api/plugin.html +48 -0
- package/docs/.island/dist/zh/api/test.html +59 -0
- package/docs/.island/dist/zh/guide/advance/asset.html +68 -0
- package/docs/.island/dist/zh/guide/advance/build-umd.html +72 -0
- package/docs/.island/dist/zh/guide/advance/copy.html +82 -0
- package/docs/.island/dist/zh/guide/advance/extension.html +127 -0
- package/docs/.island/dist/zh/guide/advance/external-dependency.html +71 -0
- package/docs/.island/dist/zh/guide/advance/in-depth-about-build.html +148 -0
- package/docs/.island/dist/zh/guide/advance/in-depth-about-dev-command.html +53 -0
- package/docs/.island/dist/zh/guide/basic/before-getting-started.html +127 -0
- package/docs/.island/dist/zh/guide/basic/command-preview.html +100 -0
- package/docs/.island/dist/zh/guide/basic/modify-output-product.html +140 -0
- package/docs/.island/dist/zh/guide/basic/publish-your-project.html +92 -0
- package/docs/.island/dist/zh/guide/basic/test-your-project.html +72 -0
- package/docs/.island/dist/zh/guide/basic/use-micro-generator.html +65 -0
- package/docs/.island/dist/zh/guide/basic/using-storybook.html +114 -0
- package/docs/.island/dist/zh/guide/intro/getting-started.html +79 -0
- package/docs/.island/dist/zh/guide/intro/welcome.html +53 -0
- package/docs/.island/dist/zh/guide/intro/why-module-engineering-solution.html +49 -0
- package/docs/.island/dist/zh/index.html +42 -0
- package/docs/en/api/config/build-config.md +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/guide/intro/getting-started.md +16 -7
- 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 +17 -11
- 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 +4 -4
- package/doc_build/static/js/async/api_.js.map +0 -1
- package/doc_build/static/js/async/en_.js.map +0 -1
- package/doc_build/static/js/async/en_api_.js.map +0 -1
- package/doc_build/static/js/async/guide_advance_in-depth-about-dev-command.js.map +0 -1
- 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.map +0 -1
- package/doc_build/static/js/async/guide_basic_modify-output-product.js.map +0 -1
- package/doc_build/static/js/async/guide_basic_use-micro-generator.js.map +0 -1
- 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.map +0 -1
- package/doc_build/static/js/async/index.js.map +0 -1
- package/doc_build/static/js/async/plugins_official-list_overview.js.map +0 -1
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import{jsx as o,jsxs as n,Fragment as a}from"react/jsx-runtime";import{a as d,C as p}from"./components.esm.03560353.js";import"react";import"react-dom";const t={annotations:d,Code:p},r={staticMediaQuery:"not screen, (max-width: 768px)",theme:{name:"nord",type:"dark",semanticHighlighting:!0,colors:{focusBorder:"#3b4252",foreground:"#d8dee9","activityBar.background":"#2e3440","activityBar.dropBackground":"#3b4252","activityBar.foreground":"#d8dee9","activityBar.activeBorder":"#88c0d0","activityBar.activeBackground":"#3b4252","activityBarBadge.background":"#88c0d0","activityBarBadge.foreground":"#2e3440","badge.foreground":"#2e3440","badge.background":"#88c0d0","button.background":"#88c0d0ee","button.foreground":"#2e3440","button.hoverBackground":"#88c0d0","button.secondaryBackground":"#434c5e","button.secondaryForeground":"#d8dee9","button.secondaryHoverBackground":"#4c566a","charts.red":"#bf616a","charts.blue":"#81a1c1","charts.yellow":"#ebcb8b","charts.orange":"#d08770","charts.green":"#a3be8c","charts.purple":"#b48ead","charts.foreground":"#d8dee9","charts.lines":"#88c0d0","debugConsole.infoForeground":"#88c0d0","debugConsole.warningForeground":"#ebcb8b","debugConsole.errorForeground":"#bf616a","debugConsole.sourceForeground":"#616e88","debugConsoleInputIcon.foreground":"#81a1c1","debugExceptionWidget.background":"#4c566a","debugExceptionWidget.border":"#2e3440","debugToolBar.background":"#3b4252",descriptionForeground:"#d8dee9e6","diffEditor.insertedTextBackground":"#81a1c133","diffEditor.removedTextBackground":"#bf616a4d","dropdown.background":"#3b4252","dropdown.border":"#3b4252","dropdown.foreground":"#d8dee9","editorActiveLineNumber.foreground":"#d8dee9cc","editorCursor.foreground":"#d8dee9","editorHint.border":"#ebcb8b00","editorHint.foreground":"#ebcb8b","editorIndentGuide.background":"#434c5eb3","editorIndentGuide.activeBackground":"#4c566a","editorInlayHint.background":"#434c5e","editorInlayHint.foreground":"#d8dee9","editorLineNumber.foreground":"#4c566a","editorLineNumber.activeForeground":"#d8dee9","editorWhitespace.foreground":"#4c566ab3","editorWidget.background":"#2e3440","editorWidget.border":"#3b4252","editor.background":"#2e3440","editor.foreground":"#d8dee9","editor.hoverHighlightBackground":"#3b4252","editor.findMatchBackground":"#88c0d066","editor.findMatchHighlightBackground":"#88c0d033","editor.findRangeHighlightBackground":"#88c0d033","editor.lineHighlightBackground":"#3b4252","editor.lineHighlightBorder":"#3b4252","editor.inactiveSelectionBackground":"#434c5ecc","editor.inlineValuesBackground":"#4c566a","editor.inlineValuesForeground":"#eceff4","editor.selectionBackground":"#434c5ecc","editor.selectionHighlightBackground":"#434c5ecc","editor.rangeHighlightBackground":"#434c5e52","editor.wordHighlightBackground":"#81a1c166","editor.wordHighlightStrongBackground":"#81a1c199","editor.stackFrameHighlightBackground":"#5e81ac","editor.focusedStackFrameHighlightBackground":"#5e81ac","editorError.foreground":"#bf616a","editorError.border":"#bf616a00","editorWarning.foreground":"#ebcb8b","editorWarning.border":"#ebcb8b00","editorBracketMatch.background":"#2e344000","editorBracketMatch.border":"#88c0d0","editorBracketHighlight.foreground1":"#8fbcbb","editorBracketHighlight.foreground2":"#88c0d0","editorBracketHighlight.foreground3":"#81a1c1","editorBracketHighlight.foreground4":"#5e81ac","editorBracketHighlight.foreground5":"#8fbcbb","editorBracketHighlight.foreground6":"#88c0d0","editorBracketHighlight.unexpectedBracket.foreground":"#bf616a","editorCodeLens.foreground":"#4c566a","editorGroup.background":"#2e3440","editorGroup.border":"#3b425201","editorGroup.dropBackground":"#3b425299","editorGroupHeader.border":"#3b425200","editorGroupHeader.noTabsBackground":"#2e3440","editorGroupHeader.tabsBackground":"#2e3440","editorGroupHeader.tabsBorder":"#3b425200","editorGutter.background":"#2e3440","editorGutter.modifiedBackground":"#ebcb8b","editorGutter.addedBackground":"#a3be8c","editorGutter.deletedBackground":"#bf616a","editorHoverWidget.background":"#3b4252","editorHoverWidget.border":"#3b4252","editorLink.activeForeground":"#88c0d0","editorMarkerNavigation.background":"#5e81acc0","editorMarkerNavigationError.background":"#bf616ac0","editorMarkerNavigationWarning.background":"#ebcb8bc0","editorOverviewRuler.border":"#3b4252","editorOverviewRuler.currentContentForeground":"#3b4252","editorOverviewRuler.incomingContentForeground":"#3b4252","editorOverviewRuler.findMatchForeground":"#88c0d066","editorOverviewRuler.rangeHighlightForeground":"#88c0d066","editorOverviewRuler.selectionHighlightForeground":"#88c0d066","editorOverviewRuler.wordHighlightForeground":"#88c0d066","editorOverviewRuler.wordHighlightStrongForeground":"#88c0d066","editorOverviewRuler.modifiedForeground":"#ebcb8b","editorOverviewRuler.addedForeground":"#a3be8c","editorOverviewRuler.deletedForeground":"#bf616a","editorOverviewRuler.errorForeground":"#bf616a","editorOverviewRuler.warningForeground":"#ebcb8b","editorOverviewRuler.infoForeground":"#81a1c1","editorRuler.foreground":"#434c5e","editorSuggestWidget.background":"#2e3440","editorSuggestWidget.border":"#3b4252","editorSuggestWidget.foreground":"#d8dee9","editorSuggestWidget.focusHighlightForeground":"#88c0d0","editorSuggestWidget.highlightForeground":"#88c0d0","editorSuggestWidget.selectedBackground":"#434c5e","editorSuggestWidget.selectedForeground":"#d8dee9","extensionButton.prominentForeground":"#d8dee9","extensionButton.prominentBackground":"#434c5e","extensionButton.prominentHoverBackground":"#4c566a",errorForeground:"#bf616a","gitDecoration.modifiedResourceForeground":"#ebcb8b","gitDecoration.deletedResourceForeground":"#bf616a","gitDecoration.untrackedResourceForeground":"#a3be8c","gitDecoration.ignoredResourceForeground":"#d8dee966","gitDecoration.conflictingResourceForeground":"#5e81ac","gitDecoration.submoduleResourceForeground":"#8fbcbb","gitDecoration.stageDeletedResourceForeground":"#bf616a","gitDecoration.stageModifiedResourceForeground":"#ebcb8b","input.background":"#3b4252","input.foreground":"#d8dee9","input.placeholderForeground":"#d8dee999","input.border":"#3b4252","inputOption.activeBackground":"#5e81ac","inputOption.activeBorder":"#5e81ac","inputOption.activeForeground":"#eceff4","inputValidation.errorBackground":"#bf616a","inputValidation.errorBorder":"#bf616a","inputValidation.infoBackground":"#81a1c1","inputValidation.infoBorder":"#81a1c1","inputValidation.warningBackground":"#d08770","inputValidation.warningBorder":"#d08770","keybindingLabel.background":"#4c566a","keybindingLabel.border":"#4c566a","keybindingLabel.bottomBorder":"#4c566a","keybindingLabel.foreground":"#d8dee9","list.activeSelectionBackground":"#88c0d0","list.activeSelectionForeground":"#2e3440","list.inactiveSelectionBackground":"#434c5e","list.inactiveSelectionForeground":"#d8dee9","list.inactiveFocusBackground":"#434c5ecc","list.hoverForeground":"#eceff4","list.focusForeground":"#d8dee9","list.focusBackground":"#88c0d099","list.focusHighlightForeground":"#eceff4","list.hoverBackground":"#3b4252","list.dropBackground":"#88c0d099","list.highlightForeground":"#88c0d0","list.errorForeground":"#bf616a","list.warningForeground":"#ebcb8b","merge.currentHeaderBackground":"#81a1c166","merge.currentContentBackground":"#81a1c14d","merge.incomingHeaderBackground":"#8fbcbb66","merge.incomingContentBackground":"#8fbcbb4d","merge.border":"#3b425200","minimap.background":"#2e3440","minimap.errorHighlight":"#bf616acc","minimap.findMatchHighlight":"#88c0d0","minimap.selectionHighlight":"#88c0d0cc","minimap.warningHighlight":"#ebcb8bcc","minimapGutter.addedBackground":"#a3be8c","minimapGutter.deletedBackground":"#bf616a","minimapGutter.modifiedBackground":"#ebcb8b","minimapSlider.activeBackground":"#434c5eaa","minimapSlider.background":"#434c5e99","minimapSlider.hoverBackground":"#434c5eaa","notification.background":"#3b4252","notification.buttonBackground":"#434c5e","notification.buttonForeground":"#d8dee9","notification.buttonHoverBackground":"#4c566a","notification.errorBackground":"#bf616a","notification.errorForeground":"#2e3440","notification.foreground":"#d8dee9","notification.infoBackground":"#88c0d0","notification.infoForeground":"#2e3440","notification.warningBackground":"#ebcb8b","notification.warningForeground":"#2e3440","notificationCenter.border":"#3b425200","notificationCenterHeader.background":"#2e3440","notificationCenterHeader.foreground":"#88c0d0","notificationLink.foreground":"#88c0d0","notifications.background":"#3b4252","notifications.border":"#2e3440","notifications.foreground":"#d8dee9","notificationToast.border":"#3b425200","panel.background":"#2e3440","panel.border":"#3b4252","panelTitle.activeBorder":"#88c0d000","panelTitle.activeForeground":"#88c0d0","panelTitle.inactiveForeground":"#d8dee9","peekView.border":"#4c566a","peekViewEditor.background":"#2e3440","peekViewEditorGutter.background":"#2e3440","peekViewEditor.matchHighlightBackground":"#88c0d04d","peekViewResult.background":"#2e3440","peekViewResult.fileForeground":"#88c0d0","peekViewResult.lineForeground":"#d8dee966","peekViewResult.matchHighlightBackground":"#88c0d0cc","peekViewResult.selectionBackground":"#434c5e","peekViewResult.selectionForeground":"#d8dee9","peekViewTitle.background":"#3b4252","peekViewTitleDescription.foreground":"#d8dee9","peekViewTitleLabel.foreground":"#88c0d0","pickerGroup.border":"#3b4252","pickerGroup.foreground":"#88c0d0","progressBar.background":"#88c0d0","quickInputList.focusBackground":"#88c0d0","quickInputList.focusForeground":"#2e3440","sash.hoverBorder":"#88c0d0","scrollbar.shadow":"#00000066","scrollbarSlider.activeBackground":"#434c5eaa","scrollbarSlider.background":"#434c5e99","scrollbarSlider.hoverBackground":"#434c5eaa","selection.background":"#88c0d099","sideBar.background":"#2e3440","sideBar.foreground":"#d8dee9","sideBar.border":"#3b4252","sideBarSectionHeader.background":"#3b4252","sideBarSectionHeader.foreground":"#d8dee9","sideBarTitle.foreground":"#d8dee9","statusBar.background":"#3b4252","statusBar.debuggingBackground":"#5e81ac","statusBar.debuggingForeground":"#d8dee9","statusBar.noFolderForeground":"#d8dee9","statusBar.noFolderBackground":"#3b4252","statusBar.foreground":"#d8dee9","statusBarItem.activeBackground":"#4c566a","statusBarItem.hoverBackground":"#434c5e","statusBarItem.prominentBackground":"#3b4252","statusBarItem.prominentHoverBackground":"#434c5e","statusBarItem.errorBackground":"#3b4252","statusBarItem.errorForeground":"#bf616a","statusBarItem.warningBackground":"#ebcb8b","statusBarItem.warningForeground":"#2e3440","statusBar.border":"#3b425200","tab.activeBackground":"#3b4252","tab.activeForeground":"#d8dee9","tab.border":"#3b425200","tab.activeBorder":"#88c0d000","tab.unfocusedActiveBorder":"#88c0d000","tab.inactiveBackground":"#2e3440","tab.inactiveForeground":"#d8dee966","tab.unfocusedActiveForeground":"#d8dee999","tab.unfocusedInactiveForeground":"#d8dee966","tab.hoverBackground":"#3b4252cc","tab.unfocusedHoverBackground":"#3b4252b3","tab.hoverBorder":"#88c0d000","tab.unfocusedHoverBorder":"#88c0d000","tab.activeBorderTop":"#88c0d000","tab.unfocusedActiveBorderTop":"#88c0d000","tab.lastPinnedBorder":"#4c566a","terminal.background":"#2e3440","terminal.foreground":"#d8dee9","terminal.ansiBlack":"#3b4252","terminal.ansiRed":"#bf616a","terminal.ansiGreen":"#a3be8c","terminal.ansiYellow":"#ebcb8b","terminal.ansiBlue":"#81a1c1","terminal.ansiMagenta":"#b48ead","terminal.ansiCyan":"#88c0d0","terminal.ansiWhite":"#e5e9f0","terminal.ansiBrightBlack":"#4c566a","terminal.ansiBrightRed":"#bf616a","terminal.ansiBrightGreen":"#a3be8c","terminal.ansiBrightYellow":"#ebcb8b","terminal.ansiBrightBlue":"#81a1c1","terminal.ansiBrightMagenta":"#b48ead","terminal.ansiBrightCyan":"#8fbcbb","terminal.ansiBrightWhite":"#eceff4","terminal.tab.activeBorder":"#88c0d0","textBlockQuote.background":"#3b4252","textBlockQuote.border":"#81a1c1","textCodeBlock.background":"#4c566a","textLink.activeForeground":"#88c0d0","textLink.foreground":"#88c0d0","textPreformat.foreground":"#8fbcbb","textSeparator.foreground":"#eceff4","titleBar.activeBackground":"#2e3440","titleBar.activeForeground":"#d8dee9","titleBar.border":"#2e344000","titleBar.inactiveBackground":"#2e3440","titleBar.inactiveForeground":"#d8dee966","tree.indentGuidesStroke":"#616e88","walkThrough.embeddedEditorBackground":"#2e3440","welcomePage.buttonBackground":"#434c5e","welcomePage.buttonHoverBackground":"#4c566a","widget.shadow":"#00000066"},tokenColors:[{settings:{foreground:"#d8dee9ff",background:"#2e3440ff"}},{scope:"emphasis",settings:{fontStyle:"italic"}},{scope:"strong",settings:{fontStyle:"bold"}},{name:"Comment",scope:"comment",settings:{foreground:"#616E88"}},{name:"Constant Character",scope:"constant.character",settings:{foreground:"#EBCB8B"}},{name:"Constant Character Escape",scope:"constant.character.escape",settings:{foreground:"#EBCB8B"}},{name:"Constant Language",scope:"constant.language",settings:{foreground:"#81A1C1"}},{name:"Constant Numeric",scope:"constant.numeric",settings:{foreground:"#B48EAD"}},{name:"Constant Regexp",scope:"constant.regexp",settings:{foreground:"#EBCB8B"}},{name:"Entity Name Class/Type",scope:["entity.name.class","entity.name.type.class"],settings:{foreground:"#8FBCBB"}},{name:"Entity Name Function",scope:"entity.name.function",settings:{foreground:"#88C0D0"}},{name:"Entity Name Tag",scope:"entity.name.tag",settings:{foreground:"#81A1C1"}},{name:"Entity Other Attribute Name",scope:"entity.other.attribute-name",settings:{foreground:"#8FBCBB"}},{name:"Entity Other Inherited Class",scope:"entity.other.inherited-class",settings:{fontStyle:"bold",foreground:"#8FBCBB"}},{name:"Invalid Deprecated",scope:"invalid.deprecated",settings:{foreground:"#D8DEE9",background:"#EBCB8B"}},{name:"Invalid Illegal",scope:"invalid.illegal",settings:{foreground:"#D8DEE9",background:"#BF616A"}},{name:"Keyword",scope:"keyword",settings:{foreground:"#81A1C1"}},{name:"Keyword Operator",scope:"keyword.operator",settings:{foreground:"#81A1C1"}},{name:"Keyword Other New",scope:"keyword.other.new",settings:{foreground:"#81A1C1"}},{name:"Markup Bold",scope:"markup.bold",settings:{fontStyle:"bold"}},{name:"Markup Changed",scope:"markup.changed",settings:{foreground:"#EBCB8B"}},{name:"Markup Deleted",scope:"markup.deleted",settings:{foreground:"#BF616A"}},{name:"Markup Inserted",scope:"markup.inserted",settings:{foreground:"#A3BE8C"}},{name:"Meta Preprocessor",scope:"meta.preprocessor",settings:{foreground:"#5E81AC"}},{name:"Punctuation",scope:"punctuation",settings:{foreground:"#ECEFF4"}},{name:"Punctuation Definition Parameters",scope:["punctuation.definition.method-parameters","punctuation.definition.function-parameters","punctuation.definition.parameters"],settings:{foreground:"#ECEFF4"}},{name:"Punctuation Definition Tag",scope:"punctuation.definition.tag",settings:{foreground:"#81A1C1"}},{name:"Punctuation Definition Comment",scope:["punctuation.definition.comment","punctuation.end.definition.comment","punctuation.start.definition.comment"],settings:{foreground:"#616E88"}},{name:"Punctuation Section",scope:"punctuation.section",settings:{foreground:"#ECEFF4"}},{name:"Punctuation Section Embedded",scope:["punctuation.section.embedded.begin","punctuation.section.embedded.end"],settings:{foreground:"#81A1C1"}},{name:"Punctuation Terminator",scope:"punctuation.terminator",settings:{foreground:"#81A1C1"}},{name:"Punctuation Variable",scope:"punctuation.definition.variable",settings:{foreground:"#81A1C1"}},{name:"Storage",scope:"storage",settings:{foreground:"#81A1C1"}},{name:"String",scope:"string",settings:{foreground:"#A3BE8C"}},{name:"String Regexp",scope:"string.regexp",settings:{foreground:"#EBCB8B"}},{name:"Support Class",scope:"support.class",settings:{foreground:"#8FBCBB"}},{name:"Support Constant",scope:"support.constant",settings:{foreground:"#81A1C1"}},{name:"Support Function",scope:"support.function",settings:{foreground:"#88C0D0"}},{name:"Support Function Construct",scope:"support.function.construct",settings:{foreground:"#81A1C1"}},{name:"Support Type",scope:"support.type",settings:{foreground:"#8FBCBB"}},{name:"Support Type Exception",scope:"support.type.exception",settings:{foreground:"#8FBCBB"}},{name:"Token Debug",scope:"token.debug-token",settings:{foreground:"#b48ead"}},{name:"Token Error",scope:"token.error-token",settings:{foreground:"#bf616a"}},{name:"Token Info",scope:"token.info-token",settings:{foreground:"#88c0d0"}},{name:"Token Warning",scope:"token.warn-token",settings:{foreground:"#ebcb8b"}},{name:"Variable",scope:"variable.other",settings:{foreground:"#D8DEE9"}},{name:"Variable Language",scope:"variable.language",settings:{foreground:"#81A1C1"}},{name:"Variable Parameter",scope:"variable.parameter",settings:{foreground:"#D8DEE9"}},{name:"[C/CPP] Punctuation Separator Pointer-Access",scope:"punctuation.separator.pointer-access.c",settings:{foreground:"#81A1C1"}},{name:"[C/CPP] Meta Preprocessor Include",scope:["source.c meta.preprocessor.include","source.c string.quoted.other.lt-gt.include"],settings:{foreground:"#8FBCBB"}},{name:"[C/CPP] Conditional Directive",scope:["source.cpp keyword.control.directive.conditional","source.cpp punctuation.definition.directive","source.c keyword.control.directive.conditional","source.c punctuation.definition.directive"],settings:{foreground:"#5E81AC",fontStyle:"bold"}},{name:"[CSS] Constant Other Color RGB Value",scope:"source.css constant.other.color.rgb-value",settings:{foreground:"#B48EAD"}},{name:"[CSS](Function) Meta Property-Value",scope:"source.css meta.property-value",settings:{foreground:"#88C0D0"}},{name:"[CSS] Media Queries",scope:["source.css keyword.control.at-rule.media","source.css keyword.control.at-rule.media punctuation.definition.keyword"],settings:{foreground:"#D08770"}},{name:"[CSS] Punctuation Definition Keyword",scope:"source.css punctuation.definition.keyword",settings:{foreground:"#81A1C1"}},{name:"[CSS] Support Type Property Name",scope:"source.css support.type.property-name",settings:{foreground:"#D8DEE9"}},{name:"[diff] Meta Range Context",scope:"source.diff meta.diff.range.context",settings:{foreground:"#8FBCBB"}},{name:"[diff] Meta Header From-File",scope:"source.diff meta.diff.header.from-file",settings:{foreground:"#8FBCBB"}},{name:"[diff] Punctuation Definition From-File",scope:"source.diff punctuation.definition.from-file",settings:{foreground:"#8FBCBB"}},{name:"[diff] Punctuation Definition Range",scope:"source.diff punctuation.definition.range",settings:{foreground:"#8FBCBB"}},{name:"[diff] Punctuation Definition Separator",scope:"source.diff punctuation.definition.separator",settings:{foreground:"#81A1C1"}},{name:"[Elixir](JakeBecker.elixir-ls) module names",scope:"entity.name.type.module.elixir",settings:{foreground:"#8FBCBB"}},{name:"[Elixir](JakeBecker.elixir-ls) module attributes",scope:"variable.other.readwrite.module.elixir",settings:{foreground:"#D8DEE9",fontStyle:"bold"}},{name:"[Elixir](JakeBecker.elixir-ls) atoms",scope:"constant.other.symbol.elixir",settings:{foreground:"#D8DEE9",fontStyle:"bold"}},{name:"[Elixir](JakeBecker.elixir-ls) modules",scope:"variable.other.constant.elixir",settings:{foreground:"#8FBCBB"}},{name:"[Go] String Format Placeholder",scope:"source.go constant.other.placeholder.go",settings:{foreground:"#EBCB8B"}},{name:"[Java](JavaDoc) Comment Block Documentation HTML Entities",scope:"source.java comment.block.documentation.javadoc punctuation.definition.entity.html",settings:{foreground:"#81A1C1"}},{name:"[Java](JavaDoc) Constant Other",scope:"source.java constant.other",settings:{foreground:"#D8DEE9"}},{name:"[Java](JavaDoc) Keyword Other Documentation",scope:"source.java keyword.other.documentation",settings:{foreground:"#8FBCBB"}},{name:"[Java](JavaDoc) Keyword Other Documentation Author",scope:"source.java keyword.other.documentation.author.javadoc",settings:{foreground:"#8FBCBB"}},{name:"[Java](JavaDoc) Keyword Other Documentation Directive/Custom",scope:["source.java keyword.other.documentation.directive","source.java keyword.other.documentation.custom"],settings:{foreground:"#8FBCBB"}},{name:"[Java](JavaDoc) Keyword Other Documentation See",scope:"source.java keyword.other.documentation.see.javadoc",settings:{foreground:"#8FBCBB"}},{name:"[Java] Meta Method-Call",scope:"source.java meta.method-call meta.method",settings:{foreground:"#88C0D0"}},{name:"[Java](JavaDoc) Meta Tag Template Link",scope:["source.java meta.tag.template.link.javadoc","source.java string.other.link.title.javadoc"],settings:{foreground:"#8FBCBB"}},{name:"[Java](JavaDoc) Meta Tag Template Value",scope:"source.java meta.tag.template.value.javadoc",settings:{foreground:"#88C0D0"}},{name:"[Java](JavaDoc) Punctuation Definition Keyword",scope:"source.java punctuation.definition.keyword.javadoc",settings:{foreground:"#8FBCBB"}},{name:"[Java](JavaDoc) Punctuation Definition Tag",scope:["source.java punctuation.definition.tag.begin.javadoc","source.java punctuation.definition.tag.end.javadoc"],settings:{foreground:"#616E88"}},{name:"[Java] Storage Modifier Import",scope:"source.java storage.modifier.import",settings:{foreground:"#8FBCBB"}},{name:"[Java] Storage Modifier Package",scope:"source.java storage.modifier.package",settings:{foreground:"#8FBCBB"}},{name:"[Java] Storage Type",scope:"source.java storage.type",settings:{foreground:"#8FBCBB"}},{name:"[Java] Storage Type Annotation",scope:"source.java storage.type.annotation",settings:{foreground:"#D08770"}},{name:"[Java] Storage Type Generic",scope:"source.java storage.type.generic",settings:{foreground:"#8FBCBB"}},{name:"[Java] Storage Type Primitive",scope:"source.java storage.type.primitive",settings:{foreground:"#81A1C1"}},{name:"[JavaScript] Decorator",scope:["source.js punctuation.decorator","source.js meta.decorator variable.other.readwrite","source.js meta.decorator entity.name.function"],settings:{foreground:"#D08770"}},{name:"[JavaScript] Meta Object-Literal Key",scope:"source.js meta.object-literal.key",settings:{foreground:"#88C0D0"}},{name:"[JavaScript](JSDoc) Storage Type Class",scope:"source.js storage.type.class.jsdoc",settings:{foreground:"#8FBCBB"}},{name:"[JavaScript] String Template Literals Punctuation",scope:["source.js string.quoted.template punctuation.quasi.element.begin","source.js string.quoted.template punctuation.quasi.element.end","source.js string.template punctuation.definition.template-expression"],settings:{foreground:"#81A1C1"}},{name:"[JavaScript] Interpolated String Template Punctuation Functions",scope:"source.js string.quoted.template meta.method-call.with-arguments",settings:{foreground:"#ECEFF4"}},{name:"[JavaScript] String Template Literal Variable",scope:["source.js string.template meta.template.expression support.variable.property","source.js string.template meta.template.expression variable.other.object"],settings:{foreground:"#D8DEE9"}},{name:"[JavaScript] Support Type Primitive",scope:"source.js support.type.primitive",settings:{foreground:"#81A1C1"}},{name:"[JavaScript] Variable Other Object",scope:"source.js variable.other.object",settings:{foreground:"#D8DEE9"}},{name:"[JavaScript] Variable Other Read-Write Alias",scope:"source.js variable.other.readwrite.alias",settings:{foreground:"#8FBCBB"}},{name:"[JavaScript] Parentheses in Template Strings",scope:["source.js meta.embedded.line meta.brace.square","source.js meta.embedded.line meta.brace.round","source.js string.quoted.template meta.brace.square","source.js string.quoted.template meta.brace.round"],settings:{foreground:"#ECEFF4"}},{name:"[HTML] Constant Character Entity",scope:"text.html.basic constant.character.entity.html",settings:{foreground:"#EBCB8B"}},{name:"[HTML] Constant Other Inline-Data",scope:"text.html.basic constant.other.inline-data",settings:{foreground:"#D08770",fontStyle:"italic"}},{name:"[HTML] Meta Tag SGML Doctype",scope:"text.html.basic meta.tag.sgml.doctype",settings:{foreground:"#5E81AC"}},{name:"[HTML] Punctuation Definition Entity",scope:"text.html.basic punctuation.definition.entity",settings:{foreground:"#81A1C1"}},{name:"[INI] Entity Name Section Group-Title",scope:"source.properties entity.name.section.group-title.ini",settings:{foreground:"#88C0D0"}},{name:"[INI] Punctuation Separator Key-Value",scope:"source.properties punctuation.separator.key-value.ini",settings:{foreground:"#81A1C1"}},{name:"[Markdown] Markup Fenced Code Block",scope:["text.html.markdown markup.fenced_code.block","text.html.markdown markup.fenced_code.block punctuation.definition"],settings:{foreground:"#8FBCBB"}},{name:"[Markdown] Markup Heading",scope:"markup.heading",settings:{foreground:"#88C0D0"}},{name:"[Markdown] Markup Inline",scope:["text.html.markdown markup.inline.raw","text.html.markdown markup.inline.raw punctuation.definition.raw"],settings:{foreground:"#8FBCBB"}},{name:"[Markdown] Markup Italic",scope:"text.html.markdown markup.italic",settings:{fontStyle:"italic"}},{name:"[Markdown] Markup Link",scope:"text.html.markdown markup.underline.link",settings:{fontStyle:"underline"}},{name:"[Markdown] Markup List Numbered/Unnumbered",scope:"text.html.markdown beginning.punctuation.definition.list",settings:{foreground:"#81A1C1"}},{name:"[Markdown] Markup Quote Punctuation Definition",scope:"text.html.markdown beginning.punctuation.definition.quote",settings:{foreground:"#8FBCBB"}},{name:"[Markdown] Markup Quote Punctuation Definition",scope:"text.html.markdown markup.quote",settings:{foreground:"#616E88"}},{name:"[Markdown] Markup Math Constant",scope:"text.html.markdown constant.character.math.tex",settings:{foreground:"#81A1C1"}},{name:"[Markdown] Markup Math Definition Marker",scope:["text.html.markdown punctuation.definition.math.begin","text.html.markdown punctuation.definition.math.end"],settings:{foreground:"#5E81AC"}},{name:"[Markdown] Markup Math Function Definition Marker",scope:"text.html.markdown punctuation.definition.function.math.tex",settings:{foreground:"#88C0D0"}},{name:"[Markdown] Markup Math Operator",scope:"text.html.markdown punctuation.math.operator.latex",settings:{foreground:"#81A1C1"}},{name:"[Markdown] Punctuation Definition Heading",scope:"text.html.markdown punctuation.definition.heading",settings:{foreground:"#81A1C1"}},{name:"[Markdown] Punctuation Definition Constant/String",scope:["text.html.markdown punctuation.definition.constant","text.html.markdown punctuation.definition.string"],settings:{foreground:"#81A1C1"}},{name:"[Markdown] String Other Link Description/Title",scope:["text.html.markdown constant.other.reference.link","text.html.markdown string.other.link.description","text.html.markdown string.other.link.title"],settings:{foreground:"#88C0D0"}},{name:"[Perl] Perl Sigils",scope:"source.perl punctuation.definition.variable",settings:{foreground:"#D8DEE9"}},{name:"[PHP] Meta Function-Call Object",scope:["source.php meta.function-call","source.php meta.function-call.object"],settings:{foreground:"#88C0D0"}},{name:"[Python] Decorator",scope:["source.python entity.name.function.decorator","source.python meta.function.decorator support.type"],settings:{foreground:"#D08770"}},{name:"[Python] Function Call",scope:"source.python meta.function-call.generic",settings:{foreground:"#88C0D0"}},{name:"[Python] Support Type",scope:"source.python support.type",settings:{foreground:"#88C0D0"}},{name:"[Python] Function Parameter",scope:["source.python variable.parameter.function.language"],settings:{foreground:"#D8DEE9"}},{name:"[Python] Function Parameter Special",scope:["source.python meta.function.parameters variable.parameter.function.language.special.self"],settings:{foreground:"#81A1C1"}},{name:"[Rust] Entity types",scope:"source.rust entity.name.type",settings:{foreground:"#8FBCBB"}},{name:"[Rust] Macro",scope:"source.rust meta.macro entity.name.function",settings:{fontStyle:"bold",foreground:"#88C0D0"}},{name:"[Rust] Attributes",scope:["source.rust meta.attribute","source.rust meta.attribute punctuation","source.rust meta.attribute keyword.operator"],settings:{foreground:"#5E81AC"}},{name:"[Rust] Traits",scope:"source.rust entity.name.type.trait",settings:{fontStyle:"bold"}},{name:"[Rust] Interpolation Bracket Curly",scope:"source.rust punctuation.definition.interpolation",settings:{foreground:"#EBCB8B"}},{name:"[SCSS] Punctuation Definition Interpolation Bracket Curly",scope:["source.css.scss punctuation.definition.interpolation.begin.bracket.curly","source.css.scss punctuation.definition.interpolation.end.bracket.curly"],settings:{foreground:"#81A1C1"}},{name:"[SCSS] Variable Interpolation",scope:"source.css.scss variable.interpolation",settings:{foreground:"#D8DEE9",fontStyle:"italic"}},{name:"[TypeScript] Decorators",scope:["source.ts punctuation.decorator","source.ts meta.decorator variable.other.readwrite","source.ts meta.decorator entity.name.function","source.tsx punctuation.decorator","source.tsx meta.decorator variable.other.readwrite","source.tsx meta.decorator entity.name.function"],settings:{foreground:"#D08770"}},{name:"[TypeScript] Object-literal keys",scope:["source.ts meta.object-literal.key","source.tsx meta.object-literal.key"],settings:{foreground:"#D8DEE9"}},{name:"[TypeScript] Object-literal functions",scope:["source.ts meta.object-literal.key entity.name.function","source.tsx meta.object-literal.key entity.name.function"],settings:{foreground:"#88C0D0"}},{name:"[TypeScript] Type/Class",scope:["source.ts support.class","source.ts support.type","source.ts entity.name.type","source.ts entity.name.class","source.tsx support.class","source.tsx support.type","source.tsx entity.name.type","source.tsx entity.name.class"],settings:{foreground:"#8FBCBB"}},{name:"[TypeScript] Static Class Support",scope:["source.ts support.constant.math","source.ts support.constant.dom","source.ts support.constant.json","source.tsx support.constant.math","source.tsx support.constant.dom","source.tsx support.constant.json"],settings:{foreground:"#8FBCBB"}},{name:"[TypeScript] Variables",scope:["source.ts support.variable","source.tsx support.variable"],settings:{foreground:"#D8DEE9"}},{name:"[TypeScript] Parentheses in Template Strings",scope:["source.ts meta.embedded.line meta.brace.square","source.ts meta.embedded.line meta.brace.round","source.tsx meta.embedded.line meta.brace.square","source.tsx meta.embedded.line meta.brace.round"],settings:{foreground:"#ECEFF4"}},{name:"[XML] Entity Name Tag Namespace",scope:"text.xml entity.name.tag.namespace",settings:{foreground:"#8FBCBB"}},{name:"[XML] Keyword Other Doctype",scope:"text.xml keyword.other.doctype",settings:{foreground:"#5E81AC"}},{name:"[XML] Meta Tag Preprocessor",scope:"text.xml meta.tag.preprocessor entity.name.tag",settings:{foreground:"#5E81AC"}},{name:"[XML] Entity Name Tag Namespace",scope:["text.xml string.unquoted.cdata","text.xml string.unquoted.cdata punctuation.definition.string"],settings:{foreground:"#D08770",fontStyle:"italic"}},{name:"[YAML] Entity Name Tag",scope:"source.yaml entity.name.tag",settings:{foreground:"#8FBCBB"}}]},autoImport:!0,showCopyButton:!0,enableSpa:!0,skipLanguages:[],filepath:"/Users/targeral/github/targeral-modern-js/website/module-tools/docs/zh/guide/basic/before-getting-started.md"},h=void 0,f=[{id:"\u73AF\u5883\u51C6\u5907",text:"\u73AF\u5883\u51C6\u5907",depth:2},{id:"\u521D\u8BC6-npm",text:"\u521D\u8BC6 npm",depth:2},{id:"npm-\u5305\u7C7B\u578B\u9879\u76EE",text:"npm \u5305\u7C7B\u578B\u9879\u76EE",depth:2},{id:"\u4F7F\u7528\u7B2C\u4E09\u65B9-npm-\u5305",text:"\u4F7F\u7528\u7B2C\u4E09\u65B9 npm \u5305",depth:2},{id:"\u8FD8\u9700\u8981\u4E86\u89E3\u7684-npm-\u96F6\u788E\u77E5\u8BC6",text:"\u8FD8\u9700\u8981\u4E86\u89E3\u7684 npm \u96F6\u788E\u77E5\u8BC6",depth:2},{id:"npm-\u5305\u7684\u7A0B\u5E8F\u5165\u53E3",text:"npm \u5305\u7684\u7A0B\u5E8F\u5165\u53E3",depth:3},{id:"scripts",text:'"scripts"',depth:3},{id:"npm-install",text:"npm install",depth:4},{id:"npm-publish",text:"npm publish",depth:4},{id:"peerdependencies",text:"peerDependencies",depth:3},{id:"npm-\u5305\u7BA1\u7406\u5668",text:"npm \u5305\u7BA1\u7406\u5668",depth:2},{id:"module-tools-\u914D\u7F6E\u6587\u4EF6",text:"Module Tools \u914D\u7F6E\u6587\u4EF6",depth:2}],F="\u5F00\u59CB\u4E4B\u524D";function s(c){const e=Object.assign({h1:"h1",a:"a",h2:"h2",p:"p",strong:"strong",code:"code",ul:"ul",li:"li",blockquote:"blockquote",div:"div",h3:"h3",h4:"h4"},c.components);return t||i("CH",!1),t.Code||i("CH.Code",!0),n(a,{children:[n(e.h1,{id:"\u5F00\u59CB\u4E4B\u524D",children:[o(e.a,{className:"header-anchor","aria-hidden":"true",href:"#\u5F00\u59CB\u4E4B\u524D",children:"#"}),"\u5F00\u59CB\u4E4B\u524D"]}),`
|
|
2
|
+
`,n(e.h2,{id:"\u73AF\u5883\u51C6\u5907",children:[o(e.a,{className:"header-anchor","aria-hidden":"true",href:"#\u73AF\u5883\u51C6\u5907",children:"#"}),"\u73AF\u5883\u51C6\u5907"]}),`
|
|
3
|
+
`,n(e.p,{children:["\u4E3A\u4E86\u4F7F\u7528 Modern.js \u6A21\u5757\u5DE5\u7A0B\u89E3\u51B3\u65B9\u6848\uFF0C\u9996\u5148\u9700\u8981 ",o(e.a,{href:"https://nodejs.org/zh/",target:"_blank",rel:"nofollow",children:"NodeJS"}),"\uFF0C\u6211\u4EEC\u63A8\u8350\u6700\u65B0\u7684",o(e.a,{href:"https://github.com/nodejs/Release",target:"_blank",rel:"nofollow",children:"\u957F\u671F\u7EF4\u62A4\u7248\u672C"}),"\uFF0C\u5E76\u786E\u4FDD Node \u7248\u672C\u5927\u4E8E\u7B49\u4E8E ",o(e.strong,{children:"14.17.6"}),"\u3002\u56E0\u4E3A\u975E\u7A33\u5B9A\u7684 NodeJS \u65F6\u5E38\u6709\u4E00\u4E9B Bug\uFF0C\u4F60\u53EF\u4EE5\u4F7F\u7528 ",o(e.a,{href:"https://github.com/coreybutler/nvm-windows",target:"_blank",rel:"nofollow",children:"nvm-windows"})," \u548C ",o(e.a,{href:"https://github.com/nvm-sh/nvm",target:"_blank",rel:"nofollow",children:"nvm"}),"\uFF08Mac/linux\uFF09\u5B89\u88C5\uFF0C\u8FD9\u6837\u4F60\u5C31\u53EF\u4EE5\u65B9\u4FBF\u5730\u5207\u6362\u5230\u4E0D\u540C\u7684 NodeJS \u7248\u672C\uFF0C\u8FD9\u4E9B\u7248\u672C\u53EF\u80FD\u4F1A\u7528\u4E8E\u4E0D\u540C\u7684\u9879\u76EE\u3002"]}),`
|
|
4
|
+
`,n(e.h2,{id:"\u521D\u8BC6-npm",children:[o(e.a,{className:"header-anchor","aria-hidden":"true",href:"#\u521D\u8BC6-npm",children:"#"}),"\u521D\u8BC6 npm"]}),`
|
|
5
|
+
`,n(e.p,{children:["\u5F53 NodeJS \u88AB\u5B89\u88C5\u540E\uFF0C\u4F60\u4E0D\u4EC5\u53EF\u4EE5\u5728\u547D\u4EE4\u884C\u4E2D\u8BBF\u95EE ",o(e.code,{children:"node"})," \u53EF\u6267\u884C\u7A0B\u5E8F\uFF0C\u540C\u65F6\u4F60\u4E5F\u53EF\u4EE5\u6267\u884C ",o(e.code,{children:"npm"})," \u547D\u4EE4\u3002"]}),`
|
|
6
|
+
`,o(e.p,{children:"npm \u662F NodeJS \u7684\u6807\u51C6\u8F6F\u4EF6\u5305\u7BA1\u7406\u5668\u3002\u5B83\u4E00\u5F00\u59CB\u7684\u7528\u9014\u662F\u7528\u4E8E\u4E0B\u8F7D\u548C\u7BA1\u7406 NodeJS \u5305\u7684\u4F9D\u8D56\u5173\u7CFB\uFF0C\u4F46\u540E\u6765\u5B83\u9010\u6E10\u53D8\u6210\u4E3A\u4E00\u4E2A\u7528\u4E8E\u524D\u7AEF JavaScript \u7684\u5DE5\u5177\u3002"}),`
|
|
7
|
+
`,o(e.p,{children:n(e.strong,{children:["\u5982\u679C\u4F60\u5DF2\u7ECF\u5BF9 npm \u548C npm \u5305\u7684\u4F7F\u7528\u65B9\u5F0F\u6709\u6240\u4E86\u89E3\uFF0C\u90A3\u4E48\u53EF\u4EE5\u76F4\u63A5\u8DF3\u5230",o(e.a,{href:"/zh/guide/before-getting-started.html#npm-%E5%8C%85%E7%AE%A1%E7%90%86%E5%99%A8",children:"\u3010npm \u5305\u7BA1\u7406\u5668\u3011"}),"\u90E8\u5206\u3002"]})}),`
|
|
8
|
+
`,n(e.h2,{id:"npm-\u5305\u7C7B\u578B\u9879\u76EE",children:[o(e.a,{className:"header-anchor","aria-hidden":"true",href:"#npm-\u5305\u7C7B\u578B\u9879\u76EE",children:"#"}),"npm \u5305\u7C7B\u578B\u9879\u76EE"]}),`
|
|
9
|
+
`,n(e.p,{children:["\u90A3\u4E48\u4EC0\u4E48\u662F npm \u5305\u7C7B\u578B\u7684\u9879\u76EE\u5462\uFF1F\u5F53\u6211\u4EEC\u5728\u4E00\u4E2A\u7A7A\u7684\u9879\u76EE\u76EE\u5F55\u4E0B\u6267\u884C ",o(e.code,{children:"npm init"})," \u547D\u4EE4\u7684\u65F6\u5019\uFF0C\u5B83\u4F1A\u5728\u5F53\u524D\u76EE\u5F55\u4E0B\u9762\u521B\u5EFA\u4E00\u4E2A\u6587\u4EF6\u540D\u4E3A ",o(e.code,{children:"package.json"})," \u7684 JSON \u6587\u4EF6\u3002\u5728\u521B\u5EFA\u8FC7\u7A0B\u4E2D\uFF0C\u6211\u4EEC\u9700\u8981\u586B\u5199\u5305\u62EC\u4F46\u4E0D\u9650\u4E8E npm \u5305\u7684\u540D\u79F0\u3001\u7248\u672C\u53F7\u3001\u63CF\u8FF0\u7B49\u7B49\u5185\u5BB9\uFF0C\u8FD9\u4E9B\u586B\u5199\u7684\u5185\u5BB9\u90FD\u4F1A\u5728\u751F\u6210\u7684 ",o(e.code,{children:"package.json"})," \u6587\u4EF6\u4E2D\u627E\u5230\uFF1A"]}),`
|
|
10
|
+
`,o(t.Code,{codeConfig:r,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"name",props:{style:{color:"#8FBCBB"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:":",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"npm-demo",props:{style:{color:"#A3BE8C"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:",",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"version",props:{style:{color:"#8FBCBB"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:":",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"1.0.0",props:{style:{color:"#A3BE8C"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:",",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"description",props:{style:{color:"#8FBCBB"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:":",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'""',props:{style:{color:"#ECEFF4"}}},{content:",",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"main",props:{style:{color:"#8FBCBB"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:":",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"index.js",props:{style:{color:"#A3BE8C"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:",",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"scripts",props:{style:{color:"#8FBCBB"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:":",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"{",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"test",props:{style:{color:"#8FBCBB"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:":",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"echo ",props:{style:{color:"#A3BE8C"}}},{content:'\\"',props:{style:{color:"#EBCB8B"}}},{content:"Error: no test specified",props:{style:{color:"#A3BE8C"}}},{content:'\\"',props:{style:{color:"#EBCB8B"}}},{content:" && exit 1",props:{style:{color:"#A3BE8C"}}},{content:'"',props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"},",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"author",props:{style:{color:"#8FBCBB"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:":",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'""',props:{style:{color:"#ECEFF4"}}},{content:",",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"license",props:{style:{color:"#8FBCBB"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:":",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"ISC",props:{style:{color:"#A3BE8C"}}},{content:'"',props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:"}",props:{style:{color:"#ECEFF4"}}}]}],lang:"json"},annotations:[]}]}),`
|
|
11
|
+
`,n(e.p,{children:["\u6B64\u65F6\u8FD9\u4E2A\u5305\u542B\u4E86\u521D\u59CB\u5316\u540E\u7684 ",o(e.code,{children:"package.json"})," \u6587\u4EF6\u7684\u9879\u76EE\u5C31\u662F\u4E00\u4E2A npm \u5305\u7C7B\u578B\u7684\u9879\u76EE\uFF0C\u4F60\u53EF\u4EE5\u6267\u884C ",o(e.code,{children:"npm publish"})," \u547D\u4EE4\u5C06\u8FD9\u4E2A\u9879\u76EE\u53D1\u5E03\u5230 ",o(e.a,{href:"https://www.npmjs.com/",target:"_blank",rel:"nofollow",children:"npm Registry"}),"\u3002"]}),`
|
|
12
|
+
`,n(e.p,{children:["npm Registry \u662F\u4E00\u4E2A ",o(e.a,{href:"https://docs.npmjs.com/about-the-public-npm-registry",target:"_blank",rel:"nofollow",children:"npm \u5305\u5B58\u50A8\u7684\u5730\u65B9"}),"\uFF0C\u5F00\u53D1\u8005\u4EEC\u4E0D\u4EC5\u53EF\u4EE5\u5C06\u4ED6\u4EEC\u81EA\u5DF1\u7684 npm \u5305\u53D1\u5E03\u5230 npm Registry\uFF0C\u8FD8\u53EF\u4EE5\u901A\u8FC7 npm Registry \u4F7F\u7528\u5176\u4ED6\u5F00\u53D1\u8005\u53D1\u5E03\u7684 npm \u5305\u3002"]}),`
|
|
13
|
+
`,o(e.p,{children:"\u4F18\u8D28\u7684 npm \u5305\u4F1A\u6709\u66F4\u591A\u7684\u4EBA\u53BB\u4F7F\u7528\uFF0C\u56E0\u4E3A\u5B83\u4E0D\u4EC5\u8282\u7701\u4E86\u5F88\u591A\u4EE3\u7801\u5B9E\u73B0\u7684\u5DE5\u4F5C\uFF0C\u540C\u65F6\u4E5F\u4E0D\u5BB9\u6613\u8BA9\u9879\u76EE\u51FA\u73B0\u95EE\u9898\u3002"}),`
|
|
14
|
+
`,n(e.h2,{id:"\u4F7F\u7528\u7B2C\u4E09\u65B9-npm-\u5305",children:[o(e.a,{className:"header-anchor","aria-hidden":"true",href:"#\u4F7F\u7528\u7B2C\u4E09\u65B9-npm-\u5305",children:"#"}),"\u4F7F\u7528\u7B2C\u4E09\u65B9 npm \u5305"]}),`
|
|
15
|
+
`,n(e.p,{children:["\u5F53\u8981\u4E3A\u521D\u59CB\u5316\u7684\u9879\u76EE\u589E\u52A0\u7B2C\u4E09\u65B9\u7684 npm \u5305\u7684\u65F6\u5019\uFF0C\u6211\u4EEC\u53EF\u4EE5\u628A\u8FD9\u4E00\u8FC7\u7A0B\u53EB\u505A\u201C\u4E3A\u9879\u76EE\u5B89\u88C5\u4F9D\u8D56\u201D\u6216\u662F\u201C\u4E3A\u9879\u76EE\u589E\u52A0\u4F9D\u8D56\u201D\u3002\u5728\u589E\u52A0\u4F9D\u8D56\u4E4B\u524D\uFF0C\u9996\u5148\u6211\u4EEC\u8981\u7279\u522B\u4E86\u89E3\u4E00\u4EF6\u4E8B\u60C5 \u2014\u2014 ",o(e.strong,{children:"npm \u4F9D\u8D56\u7684\u8F6F\u4EF6\u5305\u7C7B\u578B"}),"\uFF1A"]}),`
|
|
16
|
+
`,n(e.ul,{children:[`
|
|
17
|
+
`,n(e.li,{children:[o(e.code,{children:'"dependencies"'}),"\uFF1A\u4E00\u79CD\u662F\u4F60\u7684\u5E94\u7528\u7A0B\u5E8F\u5728\u751F\u4EA7\u73AF\u5883\u4E2D\u9700\u8981\u7684\u8F6F\u4EF6\u5305\u3002"]}),`
|
|
18
|
+
`,n(e.li,{children:[o(e.code,{children:'"devDependencies"'}),"\uFF1A\u53E6\u4E00\u79CD\u662F\u4EC5\u5728\u672C\u5730\u5F00\u53D1\u548C\u6D4B\u8BD5\u4E2D\u9700\u8981\u7684\u8F6F\u4EF6\u5305\u3002"]}),`
|
|
19
|
+
`]}),`
|
|
20
|
+
`,n(e.blockquote,{children:[`
|
|
21
|
+
`,o(e.p,{children:"\u8F6F\u4EF6\u5305\u53EF\u4EE5\u7406\u89E3\u4E3A\u662F\u7B2C\u4E09\u65B9\u7684 npm \u5305\u3002"}),`
|
|
22
|
+
`]}),`
|
|
23
|
+
`,n(e.p,{children:["\u4F60\u53EF\u4EE5\u901A\u8FC7\u6267\u884C ",o(e.code,{children:"npm install npm-package-name"})," \u6216\u8005 ",o(e.code,{children:"npm add npm-package-name"})," \u7684\u65B9\u5F0F\u6765\u5B89\u88C5\u5728",o(e.strong,{children:"\u751F\u4EA7\u73AF\u5883\u4E2D\u9700\u8981\u7684\u8F6F\u4EF6\u5305"}),"\uFF0C\u6216\u8005\u4E5F\u53EF\u4EE5\u5728 ",o(e.code,{children:"package.json"})," \u6587\u4EF6\u4E2D\u624B\u52A8\u7684\u5C06\u9700\u8981\u5B89\u88C5\u7684\u5305\u548C\u5BF9\u5E94\u7684",o(e.a,{href:"https://docs.npmjs.com/about-semantic-versioning",target:"_blank",rel:"nofollow",children:"\u8BED\u4E49\u5316\u7248\u672C"}),"\u5199\u5728 ",o(e.code,{children:'"dependencies"'})," \u91CC\uFF0C\u5E76\u6267\u884C ",o(e.code,{children:"npm install"})," \u547D\u4EE4\uFF1A"]}),`
|
|
24
|
+
`,o(t.Code,{codeConfig:r,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"name",props:{style:{color:"#8FBCBB"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:":",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"your-npm-project",props:{style:{color:"#A3BE8C"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:",",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"dependencies",props:{style:{color:"#8FBCBB"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:":",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"{",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"npm-package-name",props:{style:{color:"#8FBCBB"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:":",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"0.1.0",props:{style:{color:"#A3BE8C"}}},{content:'"',props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"},",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:"}",props:{style:{color:"#ECEFF4"}}}]}],lang:"json"},annotations:[]}]}),`
|
|
25
|
+
`,n(e.p,{children:["\u540C\u7406\uFF0C\u4F60\u4E5F\u53EF\u4EE5\u6267\u884C ",o(e.code,{children:"npm install npm-package-name --save-dev"})," \u6216 ",o(e.code,{children:"npm add npm-package-name --save-dev"})," \u7684\u65B9\u5F0F\u6765\u5B89\u88C5",o(e.strong,{children:"\u4EC5\u5728\u672C\u5730\u5F00\u53D1\u548C\u6D4B\u8BD5\u4E2D\u9700\u8981\u7684\u8F6F\u4EF6\u5305"}),"\uFF0C\u6216\u8005\u4E5F\u53EF\u4EE5\u5728 ",o(e.code,{children:"package.json"})," \u6587\u4EF6\u4E2D\u624B\u52A8\u7684\u5C06\u9700\u8981\u5B89\u88C5\u7684\u5305\u548C\u5BF9\u5E94\u7684",o(e.a,{href:"https://docs.npmjs.com/about-semantic-versioning",target:"_blank",rel:"nofollow",children:"\u8BED\u4E49\u5316\u7248\u672C"}),"\u5199\u5728 ",o(e.code,{children:'"devDependencies"'})," \u91CC\uFF0C\u5E76\u6267\u884C ",o(e.code,{children:"npm install"})," \u547D\u4EE4\uFF1A"]}),`
|
|
26
|
+
`,o(t.Code,{codeConfig:r,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"name",props:{style:{color:"#8FBCBB"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:":",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"your-npm-project",props:{style:{color:"#A3BE8C"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:",",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"devDependencies",props:{style:{color:"#8FBCBB"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:":",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"{",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"npm-package-name",props:{style:{color:"#8FBCBB"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:":",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"0.1.0",props:{style:{color:"#A3BE8C"}}},{content:'"',props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"},",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:"}",props:{style:{color:"#ECEFF4"}}}]}],lang:"json"},annotations:[]}]}),`
|
|
27
|
+
`,o(e.p,{children:n(e.strong,{children:["\u5728\u5B89\u88C5\u6216\u8005\u4F7F\u7528\u7B2C\u4E09\u65B9 npm \u5305\u7684\u65F6\u5019\u4E00\u5B9A\u8981\u786E\u5B9A\u5B83\u4EEC\u7684\u7528\u9014\uFF0C\u4EE5\u53CA\u901A\u8FC7\u533A\u5206\u5B83\u4EEC\u7684\u7C7B\u578B\u786E\u5B9A\u597D\u5B83\u4EEC\u5E94\u8BE5\u653E\u5728 ",o(e.code,{children:'"dependencies"'})," \u8FD8\u662F ",o(e.code,{children:'"devDependencies"'})," \u4E2D\u3002"]})}),`
|
|
28
|
+
`,n(e.div,{className:"island-directive tip",children:[o(e.p,{className:"island-directive-title",children:"TIP"}),o(e.div,{className:"island-directive-content",children:n(e.p,{children:["\u4E00\u822C\u6765\u8BF4\uFF0C\u9700\u8981\u5728\u6E90\u4EE3\u7801\u4E2D\u4F7F\u7528\u5230\u7684\u5305\u90FD\u5C5E\u4E8E ",o(e.code,{children:"dependencies"})," \u4F9D\u8D56\u3002\u9664\u975E\u4F60\u901A\u8FC7\u6253\u5305\u7684\u65B9\u5F0F\u5C06\u4F9D\u8D56\u7684\u4EE3\u7801\u8F93\u51FA\u5230\u672C\u5730\uFF0C\u90A3\u4E48\u8FD9\u79CD\u60C5\u51B5\u53EF\u4EE5\u5C06\u5B83\u4F5C\u4E3A ",o(e.code,{children:"devDependencies"})," \u4F9D\u8D56\u3002"]})})]}),`
|
|
29
|
+
`,n(e.h2,{id:"\u8FD8\u9700\u8981\u4E86\u89E3\u7684-npm-\u96F6\u788E\u77E5\u8BC6",children:[o(e.a,{className:"header-anchor","aria-hidden":"true",href:"#\u8FD8\u9700\u8981\u4E86\u89E3\u7684-npm-\u96F6\u788E\u77E5\u8BC6",children:"#"}),"\u8FD8\u9700\u8981\u4E86\u89E3\u7684 npm \u96F6\u788E\u77E5\u8BC6"]}),`
|
|
30
|
+
`,n(e.h3,{id:"npm-\u5305\u7684\u7A0B\u5E8F\u5165\u53E3",children:[o(e.a,{className:"header-anchor","aria-hidden":"true",href:"#npm-\u5305\u7684\u7A0B\u5E8F\u5165\u53E3",children:"#"}),"npm \u5305\u7684\u7A0B\u5E8F\u5165\u53E3"]}),`
|
|
31
|
+
`,n(e.p,{children:["\u5728 ",o(e.code,{children:"package.json"})," \u4E2D\u5B58\u5728\u4E00\u4E2A ",o(e.code,{children:'"main"'})," \u5C5E\u6027\uFF0C\u5B83\u5BF9\u5E94\u7684\u503C\u662F\u4E00\u4E2A\u6A21\u5757 ID\uFF0C\u6216\u8005\u66F4\u76F4\u89C2\u7684\u8BF4\u662F\u4E00\u4E2A NodeJS \u6587\u4EF6\u8DEF\u5F84\uFF0C\u5B83\u662F\u4F60\u7A0B\u5E8F\u7684\u4E3B\u8981\u5165\u53E3\u3002"]}),`
|
|
32
|
+
`,n(e.p,{children:["\u4F8B\u5982\u4F60\u7684\u5305\u540D\u4E3A ",o(e.code,{children:"foo"}),"\uFF0C\u5E76\u4E14\u7528\u6237\u5B89\u88C5\u4E86\u5B83\uFF0C\u7136\u540E\u6267\u884C ",o(e.code,{children:'require("foo")'})," \u4EE3\u7801\uFF0C\u90A3\u4E48 ",o(e.code,{children:"foo"})," \u8FD9\u4E2A npm \u5305\u7684 ",o(e.code,{children:'"main"'})," \u5B57\u6BB5\u5BF9\u5E94\u7684\u6587\u4EF6\u5C06\u4F1A\u88AB\u5BFC\u51FA\u3002"]}),`
|
|
33
|
+
`,n(e.p,{children:[n(e.strong,{children:["\u63A8\u8350\u5728\u4F60\u7684 npm \u5305\u91CC\u4E00\u5B9A\u8981\u8BBE\u7F6E ",o(e.code,{children:'"main"'})," \u5B57\u6BB5"]}),"\u3002\u5982\u679C\u6CA1\u6709\u8BBE\u7F6E ",o(e.code,{children:'"main"'}),"\uFF0C\u5219\u9ED8\u8BA4\u5165\u53E3\u4E3A\u5305\u7684\u6839\u76EE\u5F55\u4E0B\u7684 ",o(e.code,{children:"index.js"})," \u6587\u4EF6\u3002"]}),`
|
|
34
|
+
`,n(e.p,{children:["\u9664\u4E86\u9700\u8981\u8BBE\u7F6E ",o(e.code,{children:'"main"'})," \u5C5E\u6027\u4EE5\u5916\uFF0C\u4E00\u822C\u8FD8\u4F1A\u8BBE\u7F6E ",o(e.code,{children:'"module"'})," \u5C5E\u6027\u3002\u5B83\u4E0E ",o(e.code,{children:'"main"'})," \u5C5E\u6027\u7684\u7528\u9014\u7C7B\u4F3C\uFF0C\u5B83\u4E3B\u8981\u662F\u7528\u4E8E\u5728 webpack \u573A\u666F\u4E0B\u4F7F\u7528\u3002webpack \u5728\u5927\u591A\u6570\u60C5\u51B5\u4E0B\uFF0C\u4F1A\u4EE5 ",o(e.strong,{children:'"module" -> "main"'})," \u8FD9\u4E2A\u987A\u5E8F\u8BFB\u53D6 npm \u5305\u7684\u5165\u53E3\uFF08\u6587\u4EF6\uFF09\u3002"]}),`
|
|
35
|
+
`,n(e.blockquote,{children:[`
|
|
36
|
+
`,n(e.p,{children:["\u60F3\u8981\u4E86\u89E3\u5173\u4E8E webpack \u5982\u4F55\u505A\u8FD9\u4EF6\u4E8B\uFF0C\u53EF\u4EE5\u67E5\u770B\u8FD9\u4E2A",o(e.a,{href:"https://webpack.js.org/configuration/resolve/#resolvemainfields",target:"_blank",rel:"nofollow",children:"\u94FE\u63A5"}),"\u3002"]}),`
|
|
37
|
+
`]}),`
|
|
38
|
+
`,n(e.h3,{id:"scripts",children:[o(e.a,{className:"header-anchor","aria-hidden":"true",href:"#scripts",children:"#"}),o(e.code,{children:'"scripts"'})]}),`
|
|
39
|
+
`,n(e.p,{children:[o(e.code,{children:"package.json"})," \u6587\u4EF6\u7684 ",o(e.code,{children:'"scripts"'})," \u5C5E\u6027\u652F\u6301\u4E00\u4E9B\u5185\u7F6E\u7684\u811A\u672C\u548C npm \u9884\u8BBE\u7684\u751F\u547D\u5468\u671F\u4E8B\u4EF6\uFF0C\u4EE5\u53CA\u4EFB\u610F\u7684\u811A\u672C\u3002"]}),`
|
|
40
|
+
`,n(e.p,{children:["\u8FD9\u4E9B\u90FD\u53EF\u4EE5\u901A\u8FC7\u8FD0\u884C ",o(e.code,{children:"npm run-script <stage>"})," \u6216\u7B80\u79F0 ",o(e.code,{children:"npm run <stage>"})," \u6765\u6267\u884C\u3002"]}),`
|
|
41
|
+
`,n(e.p,{children:["\u540D\u79F0\u5339\u914D\u7684",o(e.a,{href:"https://docs.npmjs.com/cli/v9/using-npm/scripts#pre--post-scripts",target:"_blank",rel:"nofollow",children:"\u524D\u7F6E\u547D\u4EE4\u548C\u540E\u7F6E\u547D\u4EE4"}),"\u4E5F\u4F1A\u88AB\u8FD0\u884C\uFF08\u4F8B\u5982 ",o(e.code,{children:"premyscript"}),"\u3001",o(e.code,{children:"myscript"}),"\u3001",o(e.code,{children:"postmyscript"}),"\uFF09\u3002"]}),`
|
|
42
|
+
`,o(t.Code,{codeConfig:r,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"scripts",props:{style:{color:"#8FBCBB"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:":",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"{",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"premyscript",props:{style:{color:"#8FBCBB"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:":",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'""',props:{style:{color:"#ECEFF4"}}},{content:",",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"myscript",props:{style:{color:"#8FBCBB"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:":",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'""',props:{style:{color:"#ECEFF4"}}},{content:",",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"postmyscript",props:{style:{color:"#8FBCBB"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:":",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'""',props:{style:{color:"#ECEFF4"}}},{content:",",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"}",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:"}",props:{style:{color:"#ECEFF4"}}}]}],lang:"json"},annotations:[]}]}),`
|
|
43
|
+
`,n(e.p,{children:["\u5F53\u6267\u884C ",o(e.code,{children:"npm run myscripts"})," \u7684\u65F6\u5019\uFF0C",o(e.code,{children:"premyscripts"})," \u5BF9\u5E94\u7684\u811A\u672C\u4F1A\u5728\u5B83\u4E4B\u524D\u6267\u884C\uFF0C",o(e.code,{children:"postmyscripts"})," \u5BF9\u5E94\u7684\u811A\u672C\u4F1A\u5728\u5B83\u4E4B\u540E\u6267\u884C\u3002"]}),`
|
|
44
|
+
`,n(e.p,{children:["\u6765\u81EA\u4F9D\u8D56\u7684\u811A\u672C\u547D\u4EE4\u53EF\u4EE5\u7528 ",o(e.code,{children:"npm explore <pkg> -- npm run <stage>"})," \u8FD0\u884C\u3002"]}),`
|
|
45
|
+
`,o(e.p,{children:"\u8FD8\u6709\u4E00\u4E9B\u7279\u6B8A\u7684\u751F\u547D\u5468\u671F\u811A\u672C\uFF08Life Scripts\uFF09\uFF0C\u53EA\u5728\u67D0\u4E9B\u60C5\u51B5\u4E0B\u53D1\u751F\u3002\u8FD9\u91CC\u4ECB\u7ECD\u51E0\u4E2A\u901A\u5E38\u9700\u8981\u4E86\u89E3\u7684\u60C5\u51B5\u3002"}),`
|
|
46
|
+
`,n(e.h4,{id:"npm-install",children:[o(e.a,{className:"header-anchor","aria-hidden":"true",href:"#npm-install",children:"#"}),o(e.code,{children:"npm install"})]}),`
|
|
47
|
+
`,n(e.p,{children:["\u5F53\u4F60\u8FD0\u884C ",o(e.code,{children:"npm install -g <pkg-name>"})," \u65F6\uFF0C\u4EE5\u4E0B\u811A\u672C\u4F1A\u8FD0\u884C\u3002"]}),`
|
|
48
|
+
`,n(e.ul,{children:[`
|
|
49
|
+
`,o(e.li,{children:o(e.code,{children:"preinstall"})}),`
|
|
50
|
+
`,o(e.li,{children:o(e.code,{children:"install"})}),`
|
|
51
|
+
`,o(e.li,{children:o(e.code,{children:"postinstall"})}),`
|
|
52
|
+
`,o(e.li,{children:o(e.code,{children:"prepublish"})}),`
|
|
53
|
+
`,o(e.li,{children:o(e.code,{children:"preprepare"})}),`
|
|
54
|
+
`,o(e.li,{children:o(e.code,{children:"prepare"})}),`
|
|
55
|
+
`,o(e.li,{children:o(e.code,{children:"postprepare"})}),`
|
|
56
|
+
`]}),`
|
|
57
|
+
`,n(e.p,{children:["\u5982\u679C\u4F60\u7684\u8F6F\u4EF6\u5305\u6839\u76EE\u5F55\u6709\u4E00\u4E2A ",o(e.code,{children:"binding.gyp"})," \u6587\u4EF6\uFF0C\u800C\u4F60\u6CA1\u6709\u5B9A\u4E49 ",o(e.code,{children:"install"})," \u6216 ",o(e.code,{children:"preinstall"})," \u811A\u672C\uFF0C\u90A3\u4E48 npm \u5C06\u4EE5 ",o(e.code,{children:"node-gyp rebuild"})," \u4F5C\u4E3A\u9ED8\u8BA4\u7684 install \u547D\u4EE4\uFF0C\u4F7F\u7528 ",o(e.a,{href:"https://github.com/nodejs/node-gyp",target:"_blank",rel:"nofollow",children:"node-gyp"})," \u8FDB\u884C\u7F16\u8BD1\u3002"]}),`
|
|
58
|
+
`,n(e.h4,{id:"npm-publish",children:[o(e.a,{className:"header-anchor","aria-hidden":"true",href:"#npm-publish",children:"#"}),o(e.code,{children:"npm publish"})]}),`
|
|
59
|
+
`,o(e.p,{children:"\u5F53\u53D1\u5E03\u9879\u76EE\u7684\u65F6\u5019\uFF0C\u6267\u884C\u8BE5\u547D\u4EE4\u4F1A\u89E6\u53D1\u4EE5\u4E0B\u811A\u672C\uFF1A"}),`
|
|
60
|
+
`,n(e.ul,{children:[`
|
|
61
|
+
`,o(e.li,{children:o(e.code,{children:"prepublishOnly"})}),`
|
|
62
|
+
`,o(e.li,{children:o(e.code,{children:"prepack"})}),`
|
|
63
|
+
`,o(e.li,{children:o(e.code,{children:"prepare"})}),`
|
|
64
|
+
`,o(e.li,{children:o(e.code,{children:"postpack"})}),`
|
|
65
|
+
`,o(e.li,{children:o(e.code,{children:"publish"})}),`
|
|
66
|
+
`,o(e.li,{children:o(e.code,{children:"postpublish"})}),`
|
|
67
|
+
`]}),`
|
|
68
|
+
`,n(e.p,{children:["\u5F53\u4EE5 ",o(e.a,{href:"https://docs.npmjs.com/cli/v7/commands/npm-publish#dry-run",target:"_blank",rel:"nofollow",children:o(e.code,{children:"--dry-run"})})," \u6A21\u5F0F\u8FD0\u884C\u7684\u65F6\u5019\uFF0C",o(e.code,{children:"prepare"})," \u5BF9\u5E94\u7684\u811A\u672C\u5C06\u4E0D\u4F1A\u6267\u884C\u3002"]}),`
|
|
69
|
+
`,n(e.h3,{id:"peerdependencies",children:[o(e.a,{className:"header-anchor","aria-hidden":"true",href:"#peerdependencies",children:"#"}),"peerDependencies"]}),`
|
|
70
|
+
`,o(e.p,{children:"\u5728\u67D0\u4E9B\u60C5\u51B5\u4E0B\uFF0C\u4F60\u7684 npm \u9879\u76EE\u4E0E\u5B83\u7684\u5BBF\u4E3B\u5DE5\u5177\u6216\u8005\u5E93\u4E4B\u95F4\u5B58\u5728\u67D0\u79CD\u517C\u5BB9\u5173\u7CFB\uFF08\u4F8B\u5982\u4E00\u4E2A webpack \u63D2\u4EF6\u9879\u76EE\u548C webpack\uFF09\uFF0C\u540C\u65F6\u4F60\u7684 npm \u9879\u76EE\u4E0D\u60F3\u5C06\u5BBF\u4E3B\u4F5C\u4E3A\u5FC5\u8981\u7684\u4F9D\u8D56\uFF0C\u8FD9\u4E2A\u65F6\u5019\u901A\u5E38\u8BF4\u660E\u4F60\u7684\u9879\u76EE\u53EF\u80FD\u662F\u8FD9\u4E2A\u5BBF\u4E3B\u5DE5\u5177\u6216\u8005\u5E93\u7684\u63D2\u4EF6\u3002\u4F60\u7684 npm \u9879\u76EE\u4F1A\u5BF9\u5BBF\u4E3B\u5305\u7684\u7248\u672C\u6709\u4E00\u5B9A\u7684\u8981\u6C42\uFF0C\u56E0\u4E3A\u53EA\u6709\u5728\u7279\u5B9A\u7684\u7248\u672C\u4E0B\u624D\u4F1A\u66B4\u9732\u51FA npm \u9879\u76EE\u6240\u9700\u8981\u7684 API\u3002"}),`
|
|
71
|
+
`,n(e.p,{children:["\u5173\u4E8E\u66F4\u591A ",o(e.code,{children:"peerDependencies"})," \u7684\u89E3\u91CA\uFF0C\u53EF\u4EE5\u901A\u8FC7\u4E0B\u9762\u7684\u94FE\u63A5\u4E86\u89E3 npm\u3001pnpm\u3001Yarn \u5BF9\u4E8E\u5B83\u7684\u4E0D\u540C\u5904\u7406\u65B9\u5F0F\uFF1A"]}),`
|
|
72
|
+
`,n(e.ul,{children:[`
|
|
73
|
+
`,o(e.li,{children:o(e.a,{href:"https://docs.npmjs.com/cli/v9/configuring-npm/package-json#peerdependencies",target:"_blank",rel:"nofollow",children:"npm \u5BF9 peerDependencies \u7684\u89E3\u91CA"})}),`
|
|
74
|
+
`,o(e.li,{children:o(e.a,{href:"https://pnpm.io/feature-comparison",target:"_blank",rel:"nofollow",children:"pnpm vs npm VS Yarn"})}),`
|
|
75
|
+
`]}),`
|
|
76
|
+
`,n(e.h2,{id:"npm-\u5305\u7BA1\u7406\u5668",children:[o(e.a,{className:"header-anchor","aria-hidden":"true",href:"#npm-\u5305\u7BA1\u7406\u5668",children:"#"}),"npm \u5305\u7BA1\u7406\u5668"]}),`
|
|
77
|
+
`,n(e.p,{children:["\u9664\u4E86 npm \u8FD9\u79CD\u6807\u51C6\u7684\u5305\u7BA1\u7406\u5668\u4EE5\u5916\uFF0C\u76EE\u524D\u4E3B\u6D41\u7684\u8FD8\u6709 ",o(e.strong,{children:"pnpm"})," \u548C ",o(e.strong,{children:"Yarn"}),"\uFF0C\u5B83\u4EEC\u90FD\u662F\u4E0D\u9519\u7684 npm cli \u66FF\u4EE3\u54C1\u3002"]}),`
|
|
78
|
+
`,n(e.p,{children:["\u63A8\u8350\u4F7F\u7528 ",o(e.a,{href:"https://pnpm.io/installation",target:"_blank",rel:"nofollow",children:"pnpm"})," \u6765\u7BA1\u7406\u9879\u76EE\u4F9D\u8D56\uFF0C\u53EF\u4EE5\u901A\u8FC7\u4E0B\u9762\u7684\u65B9\u5F0F\u5B89\u88C5\u5B83\uFF1A"]}),`
|
|
79
|
+
`,o(t.Code,{codeConfig:r,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"npm install -g pnpm",props:{style:{color:"#D8DEE9FF"}}}]}],lang:"bash"},annotations:[]}]}),`
|
|
80
|
+
`,n(e.h2,{id:"module-tools-\u914D\u7F6E\u6587\u4EF6",children:[o(e.a,{className:"header-anchor","aria-hidden":"true",href:"#module-tools-\u914D\u7F6E\u6587\u4EF6",children:"#"}),"Module Tools \u914D\u7F6E\u6587\u4EF6"]}),`
|
|
81
|
+
`,n(e.p,{children:["\u521D\u59CB\u5316\u7684\u6A21\u5757\u5DE5\u7A0B\u9879\u76EE\u76EE\u5F55\u4E0B\u63D0\u4F9B\u4E86 Module Tools \u7684\u914D\u7F6E\u6587\u4EF6 \u2014\u2014 ",o(e.code,{children:"modern.config.(j|t)s"}),"\u3002\u9ED8\u8BA4\u60C5\u51B5\u4E0B\uFF0C\u4E0D\u9700\u8981\u505A\u4EFB\u4F55\u914D\u7F6E\uFF0C\u56E0\u6B64 ",o(e.code,{children:"modern.config"})," \u914D\u7F6E\u6587\u4EF6\u4E0D\u662F\u5FC5\u987B\u5B58\u5728\u7684\u3002"]}),`
|
|
82
|
+
`,o(e.p,{children:"\u521D\u59CB\u5316\u7684\u914D\u7F6E\u6587\u4EF6\u7684\u5185\u5BB9\u5982\u4E0B\uFF1A"}),`
|
|
83
|
+
`,o(t.Code,{codeConfig:r,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"// modern.config.ts",props:{style:{color:"#616E88"}}}]},{tokens:[{content:"import",props:{style:{color:"#81A1C1"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"{",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"defineConfig",props:{style:{color:"#D8DEE9"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"}",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"from",props:{style:{color:"#81A1C1"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"'",props:{style:{color:"#ECEFF4"}}},{content:"@modern-js/module-tools",props:{style:{color:"#A3BE8C"}}},{content:"'",props:{style:{color:"#ECEFF4"}}},{content:";",props:{style:{color:"#81A1C1"}}}]},{tokens:[]},{tokens:[{content:"export",props:{style:{color:"#81A1C1"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"default",props:{style:{color:"#81A1C1"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"defineConfig",props:{style:{color:"#88C0D0"}}},{content:"(",props:{style:{color:"#D8DEE9FF"}}},{content:"{}",props:{style:{color:"#ECEFF4"}}},{content:")",props:{style:{color:"#D8DEE9FF"}}},{content:";",props:{style:{color:"#81A1C1"}}}]}],lang:"typescript"},annotations:[]}]}),`
|
|
84
|
+
`,o(t.Code,{codeConfig:r,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"// modern.config.js",props:{style:{color:"#616E88"}}}]},{tokens:[{content:"const",props:{style:{color:"#81A1C1"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"{",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"defineConfig",props:{style:{color:"#D8DEE9"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"}",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"=",props:{style:{color:"#81A1C1"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"require",props:{style:{color:"#88C0D0"}}},{content:"(",props:{style:{color:"#D8DEE9FF"}}},{content:"'",props:{style:{color:"#ECEFF4"}}},{content:"@modern-js/module-tools",props:{style:{color:"#A3BE8C"}}},{content:"'",props:{style:{color:"#ECEFF4"}}},{content:")",props:{style:{color:"#D8DEE9FF"}}},{content:";",props:{style:{color:"#81A1C1"}}}]},{tokens:[]},{tokens:[{content:"module",props:{style:{color:"#8FBCBB"}}},{content:".",props:{style:{color:"#ECEFF4"}}},{content:"exports",props:{style:{color:"#8FBCBB"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"=",props:{style:{color:"#81A1C1"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"defineConfig",props:{style:{color:"#88C0D0"}}},{content:"(",props:{style:{color:"#D8DEE9FF"}}},{content:"{}",props:{style:{color:"#ECEFF4"}}},{content:")",props:{style:{color:"#D8DEE9FF"}}},{content:";",props:{style:{color:"#81A1C1"}}}]}],lang:"js"},annotations:[]}]}),`
|
|
85
|
+
`,n(e.p,{children:[n(e.strong,{children:["\u6211\u4EEC\u63A8\u8350\u4F7F\u7528 ",o(e.code,{children:"defineConfig"})," \u51FD\u6570"]}),"\uFF0C\u4E0D\u8FC7\u5E76\u4E0D\u5F3A\u5236\u4F7F\u7528\u5B83\u3002\u56E0\u6B64\u4F60\u4E5F\u53EF\u4EE5\u5728\u914D\u7F6E\u6587\u4EF6\u4E2D\u76F4\u63A5\u8FD4\u56DE\u4E00\u4E2A\u5BF9\u8C61\uFF1A"]}),`
|
|
86
|
+
`,o(t.Code,{codeConfig:r,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"// modern.config.ts",props:{style:{color:"#616E88"}}}]},{tokens:[{content:"export",props:{style:{color:"#81A1C1"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"default",props:{style:{color:"#81A1C1"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"{}",props:{style:{color:"#ECEFF4"}}},{content:";",props:{style:{color:"#81A1C1"}}}]}],lang:"typescript"},annotations:[]}]}),`
|
|
87
|
+
`,o(t.Code,{codeConfig:r,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"// modern.config.js",props:{style:{color:"#616E88"}}}]},{tokens:[{content:"module",props:{style:{color:"#8FBCBB"}}},{content:".",props:{style:{color:"#ECEFF4"}}},{content:"exports",props:{style:{color:"#8FBCBB"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"=",props:{style:{color:"#81A1C1"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"{}",props:{style:{color:"#ECEFF4"}}},{content:";",props:{style:{color:"#81A1C1"}}}]}],lang:"js"},annotations:[]}]})]})}function E(c={}){const{wrapper:e}=c.components||{};return e?o(e,Object.assign({},c,{children:o(s,c)})):s(c)}function i(c,e){throw new Error("Expected "+(e?"component":"object")+" `"+c+"` to be defined: you likely forgot to import, pass, or provide it.")}const b="2022/12/15 18:01:48",y='# \u5F00\u59CB\u4E4B\u524D\n\n## \u73AF\u5883\u51C6\u5907\n\n\u4E3A\u4E86\u4F7F\u7528 Modern.js \u6A21\u5757\u5DE5\u7A0B\u89E3\u51B3\u65B9\u6848\uFF0C\u9996\u5148\u9700\u8981 [NodeJS](https://nodejs.org/zh/)\uFF0C\u6211\u4EEC\u63A8\u8350\u6700\u65B0\u7684[\u957F\u671F\u7EF4\u62A4\u7248\u672C](https://github.com/nodejs/Release)\uFF0C\u5E76\u786E\u4FDD Node \u7248\u672C\u5927\u4E8E\u7B49\u4E8E **14.17.6**\u3002\u56E0\u4E3A\u975E\u7A33\u5B9A\u7684 NodeJS \u65F6\u5E38\u6709\u4E00\u4E9B Bug\uFF0C\u4F60\u53EF\u4EE5\u4F7F\u7528 [nvm-windows](https://github.com/coreybutler/nvm-windows) \u548C [nvm](https://github.com/nvm-sh/nvm)\uFF08Mac/linux\uFF09\u5B89\u88C5\uFF0C\u8FD9\u6837\u4F60\u5C31\u53EF\u4EE5\u65B9\u4FBF\u5730\u5207\u6362\u5230\u4E0D\u540C\u7684 NodeJS \u7248\u672C\uFF0C\u8FD9\u4E9B\u7248\u672C\u53EF\u80FD\u4F1A\u7528\u4E8E\u4E0D\u540C\u7684\u9879\u76EE\u3002\n## \u521D\u8BC6 npm\n\n\u5F53 NodeJS \u88AB\u5B89\u88C5\u540E\uFF0C\u4F60\u4E0D\u4EC5\u53EF\u4EE5\u5728\u547D\u4EE4\u884C\u4E2D\u8BBF\u95EE `node` \u53EF\u6267\u884C\u7A0B\u5E8F\uFF0C\u540C\u65F6\u4F60\u4E5F\u53EF\u4EE5\u6267\u884C `npm` \u547D\u4EE4\u3002\n\nnpm \u662F NodeJS \u7684\u6807\u51C6\u8F6F\u4EF6\u5305\u7BA1\u7406\u5668\u3002\u5B83\u4E00\u5F00\u59CB\u7684\u7528\u9014\u662F\u7528\u4E8E\u4E0B\u8F7D\u548C\u7BA1\u7406 NodeJS \u5305\u7684\u4F9D\u8D56\u5173\u7CFB\uFF0C\u4F46\u540E\u6765\u5B83\u9010\u6E10\u53D8\u6210\u4E3A\u4E00\u4E2A\u7528\u4E8E\u524D\u7AEF JavaScript \u7684\u5DE5\u5177\u3002\n\n**\u5982\u679C\u4F60\u5DF2\u7ECF\u5BF9 npm \u548C npm \u5305\u7684\u4F7F\u7528\u65B9\u5F0F\u6709\u6240\u4E86\u89E3\uFF0C\u90A3\u4E48\u53EF\u4EE5\u76F4\u63A5\u8DF3\u5230[\u3010npm \u5305\u7BA1\u7406\u5668\u3011](/zh/guide/before-getting-started#npm-\u5305\u7BA1\u7406\u5668)\u90E8\u5206\u3002**\n\n## npm \u5305\u7C7B\u578B\u9879\u76EE\n\n\u90A3\u4E48\u4EC0\u4E48\u662F npm \u5305\u7C7B\u578B\u7684\u9879\u76EE\u5462\uFF1F\u5F53\u6211\u4EEC\u5728\u4E00\u4E2A\u7A7A\u7684\u9879\u76EE\u76EE\u5F55\u4E0B\u6267\u884C `npm init` \u547D\u4EE4\u7684\u65F6\u5019\uFF0C\u5B83\u4F1A\u5728\u5F53\u524D\u76EE\u5F55\u4E0B\u9762\u521B\u5EFA\u4E00\u4E2A\u6587\u4EF6\u540D\u4E3A `package.json` \u7684 JSON \u6587\u4EF6\u3002\u5728\u521B\u5EFA\u8FC7\u7A0B\u4E2D\uFF0C\u6211\u4EEC\u9700\u8981\u586B\u5199\u5305\u62EC\u4F46\u4E0D\u9650\u4E8E npm \u5305\u7684\u540D\u79F0\u3001\u7248\u672C\u53F7\u3001\u63CF\u8FF0\u7B49\u7B49\u5185\u5BB9\uFF0C\u8FD9\u4E9B\u586B\u5199\u7684\u5185\u5BB9\u90FD\u4F1A\u5728\u751F\u6210\u7684 `package.json` \u6587\u4EF6\u4E2D\u627E\u5230\uFF1A\n\n``` json\n{\n "name": "npm-demo",\n "version": "1.0.0",\n "description": "",\n "main": "index.js",\n "scripts": {\n "test": "echo \\"Error: no test specified\\" && exit 1"\n },\n "author": "",\n "license": "ISC"\n}\n```\n\n\u6B64\u65F6\u8FD9\u4E2A\u5305\u542B\u4E86\u521D\u59CB\u5316\u540E\u7684 `package.json` \u6587\u4EF6\u7684\u9879\u76EE\u5C31\u662F\u4E00\u4E2A npm \u5305\u7C7B\u578B\u7684\u9879\u76EE\uFF0C\u4F60\u53EF\u4EE5\u6267\u884C `npm publish` \u547D\u4EE4\u5C06\u8FD9\u4E2A\u9879\u76EE\u53D1\u5E03\u5230 [npm Registry](https://www.npmjs.com/)\u3002\n\nnpm Registry \u662F\u4E00\u4E2A [npm \u5305\u5B58\u50A8\u7684\u5730\u65B9](https://docs.npmjs.com/about-the-public-npm-registry)\uFF0C\u5F00\u53D1\u8005\u4EEC\u4E0D\u4EC5\u53EF\u4EE5\u5C06\u4ED6\u4EEC\u81EA\u5DF1\u7684 npm \u5305\u53D1\u5E03\u5230 npm Registry\uFF0C\u8FD8\u53EF\u4EE5\u901A\u8FC7 npm Registry \u4F7F\u7528\u5176\u4ED6\u5F00\u53D1\u8005\u53D1\u5E03\u7684 npm \u5305\u3002\n\n\u4F18\u8D28\u7684 npm \u5305\u4F1A\u6709\u66F4\u591A\u7684\u4EBA\u53BB\u4F7F\u7528\uFF0C\u56E0\u4E3A\u5B83\u4E0D\u4EC5\u8282\u7701\u4E86\u5F88\u591A\u4EE3\u7801\u5B9E\u73B0\u7684\u5DE5\u4F5C\uFF0C\u540C\u65F6\u4E5F\u4E0D\u5BB9\u6613\u8BA9\u9879\u76EE\u51FA\u73B0\u95EE\u9898\u3002\n\n## \u4F7F\u7528\u7B2C\u4E09\u65B9 npm \u5305\n\n\u5F53\u8981\u4E3A\u521D\u59CB\u5316\u7684\u9879\u76EE\u589E\u52A0\u7B2C\u4E09\u65B9\u7684 npm \u5305\u7684\u65F6\u5019\uFF0C\u6211\u4EEC\u53EF\u4EE5\u628A\u8FD9\u4E00\u8FC7\u7A0B\u53EB\u505A\u201C\u4E3A\u9879\u76EE\u5B89\u88C5\u4F9D\u8D56\u201D\u6216\u662F\u201C\u4E3A\u9879\u76EE\u589E\u52A0\u4F9D\u8D56\u201D\u3002\u5728\u589E\u52A0\u4F9D\u8D56\u4E4B\u524D\uFF0C\u9996\u5148\u6211\u4EEC\u8981\u7279\u522B\u4E86\u89E3\u4E00\u4EF6\u4E8B\u60C5 \u2014\u2014 **npm \u4F9D\u8D56\u7684\u8F6F\u4EF6\u5305\u7C7B\u578B**\uFF1A\n\n- `"dependencies"`\uFF1A\u4E00\u79CD\u662F\u4F60\u7684\u5E94\u7528\u7A0B\u5E8F\u5728\u751F\u4EA7\u73AF\u5883\u4E2D\u9700\u8981\u7684\u8F6F\u4EF6\u5305\u3002\n- `"devDependencies"`\uFF1A\u53E6\u4E00\u79CD\u662F\u4EC5\u5728\u672C\u5730\u5F00\u53D1\u548C\u6D4B\u8BD5\u4E2D\u9700\u8981\u7684\u8F6F\u4EF6\u5305\u3002\n> \u8F6F\u4EF6\u5305\u53EF\u4EE5\u7406\u89E3\u4E3A\u662F\u7B2C\u4E09\u65B9\u7684 npm \u5305\u3002\n\n\u4F60\u53EF\u4EE5\u901A\u8FC7\u6267\u884C `npm install npm-package-name` \u6216\u8005 `npm add npm-package-name` \u7684\u65B9\u5F0F\u6765\u5B89\u88C5\u5728**\u751F\u4EA7\u73AF\u5883\u4E2D\u9700\u8981\u7684\u8F6F\u4EF6\u5305**\uFF0C\u6216\u8005\u4E5F\u53EF\u4EE5\u5728 `package.json` \u6587\u4EF6\u4E2D\u624B\u52A8\u7684\u5C06\u9700\u8981\u5B89\u88C5\u7684\u5305\u548C\u5BF9\u5E94\u7684[\u8BED\u4E49\u5316\u7248\u672C](https://docs.npmjs.com/about-semantic-versioning)\u5199\u5728 `"dependencies"` \u91CC\uFF0C\u5E76\u6267\u884C `npm install` \u547D\u4EE4\uFF1A\n\n``` json\n{\n "name": "your-npm-project",\n "dependencies": {\n "npm-package-name": "0.1.0"\n },\n}\n```\n\n\u540C\u7406\uFF0C\u4F60\u4E5F\u53EF\u4EE5\u6267\u884C `npm install npm-package-name --save-dev` \u6216 `npm add npm-package-name --save-dev` \u7684\u65B9\u5F0F\u6765\u5B89\u88C5**\u4EC5\u5728\u672C\u5730\u5F00\u53D1\u548C\u6D4B\u8BD5\u4E2D\u9700\u8981\u7684\u8F6F\u4EF6\u5305**\uFF0C\u6216\u8005\u4E5F\u53EF\u4EE5\u5728 `package.json` \u6587\u4EF6\u4E2D\u624B\u52A8\u7684\u5C06\u9700\u8981\u5B89\u88C5\u7684\u5305\u548C\u5BF9\u5E94\u7684[\u8BED\u4E49\u5316\u7248\u672C](https://docs.npmjs.com/about-semantic-versioning)\u5199\u5728 `"devDependencies"` \u91CC\uFF0C\u5E76\u6267\u884C `npm install` \u547D\u4EE4\uFF1A\n\n``` json\n{\n "name": "your-npm-project",\n "devDependencies": {\n "npm-package-name": "0.1.0"\n },\n}\n```\n\n**\u5728\u5B89\u88C5\u6216\u8005\u4F7F\u7528\u7B2C\u4E09\u65B9 npm \u5305\u7684\u65F6\u5019\u4E00\u5B9A\u8981\u786E\u5B9A\u5B83\u4EEC\u7684\u7528\u9014\uFF0C\u4EE5\u53CA\u901A\u8FC7\u533A\u5206\u5B83\u4EEC\u7684\u7C7B\u578B\u786E\u5B9A\u597D\u5B83\u4EEC\u5E94\u8BE5\u653E\u5728 `"dependencies"` \u8FD8\u662F `"devDependencies"` \u4E2D\u3002**\n:::tip\n\u4E00\u822C\u6765\u8BF4\uFF0C\u9700\u8981\u5728\u6E90\u4EE3\u7801\u4E2D\u4F7F\u7528\u5230\u7684\u5305\u90FD\u5C5E\u4E8E `dependencies` \u4F9D\u8D56\u3002\u9664\u975E\u4F60\u901A\u8FC7\u6253\u5305\u7684\u65B9\u5F0F\u5C06\u4F9D\u8D56\u7684\u4EE3\u7801\u8F93\u51FA\u5230\u672C\u5730\uFF0C\u90A3\u4E48\u8FD9\u79CD\u60C5\u51B5\u53EF\u4EE5\u5C06\u5B83\u4F5C\u4E3A `devDependencies` \u4F9D\u8D56\u3002\n:::\n\n## \u8FD8\u9700\u8981\u4E86\u89E3\u7684 npm \u96F6\u788E\u77E5\u8BC6\n\n### npm \u5305\u7684\u7A0B\u5E8F\u5165\u53E3\n\n\u5728 `package.json` \u4E2D\u5B58\u5728\u4E00\u4E2A `"main"` \u5C5E\u6027\uFF0C\u5B83\u5BF9\u5E94\u7684\u503C\u662F\u4E00\u4E2A\u6A21\u5757 ID\uFF0C\u6216\u8005\u66F4\u76F4\u89C2\u7684\u8BF4\u662F\u4E00\u4E2A NodeJS \u6587\u4EF6\u8DEF\u5F84\uFF0C\u5B83\u662F\u4F60\u7A0B\u5E8F\u7684\u4E3B\u8981\u5165\u53E3\u3002\n\n\u4F8B\u5982\u4F60\u7684\u5305\u540D\u4E3A `foo`\uFF0C\u5E76\u4E14\u7528\u6237\u5B89\u88C5\u4E86\u5B83\uFF0C\u7136\u540E\u6267\u884C `require("foo")` \u4EE3\u7801\uFF0C\u90A3\u4E48 `foo` \u8FD9\u4E2A npm \u5305\u7684 `"main"` \u5B57\u6BB5\u5BF9\u5E94\u7684\u6587\u4EF6\u5C06\u4F1A\u88AB\u5BFC\u51FA\u3002\n\n**\u63A8\u8350\u5728\u4F60\u7684 npm \u5305\u91CC\u4E00\u5B9A\u8981\u8BBE\u7F6E `"main"` \u5B57\u6BB5**\u3002\u5982\u679C\u6CA1\u6709\u8BBE\u7F6E `"main"`\uFF0C\u5219\u9ED8\u8BA4\u5165\u53E3\u4E3A\u5305\u7684\u6839\u76EE\u5F55\u4E0B\u7684 `index.js` \u6587\u4EF6\u3002\n\n\u9664\u4E86\u9700\u8981\u8BBE\u7F6E `"main"` \u5C5E\u6027\u4EE5\u5916\uFF0C\u4E00\u822C\u8FD8\u4F1A\u8BBE\u7F6E `"module"` \u5C5E\u6027\u3002\u5B83\u4E0E `"main"` \u5C5E\u6027\u7684\u7528\u9014\u7C7B\u4F3C\uFF0C\u5B83\u4E3B\u8981\u662F\u7528\u4E8E\u5728 webpack \u573A\u666F\u4E0B\u4F7F\u7528\u3002webpack \u5728\u5927\u591A\u6570\u60C5\u51B5\u4E0B\uFF0C\u4F1A\u4EE5 **"module" -> "main"** \u8FD9\u4E2A\u987A\u5E8F\u8BFB\u53D6 npm \u5305\u7684\u5165\u53E3\uFF08\u6587\u4EF6\uFF09\u3002\n\n> \u60F3\u8981\u4E86\u89E3\u5173\u4E8E webpack \u5982\u4F55\u505A\u8FD9\u4EF6\u4E8B\uFF0C\u53EF\u4EE5\u67E5\u770B\u8FD9\u4E2A[\u94FE\u63A5](https://webpack.js.org/configuration/resolve/#resolvemainfields)\u3002\n\n### `"scripts"`\n\n`package.json` \u6587\u4EF6\u7684 `"scripts"` \u5C5E\u6027\u652F\u6301\u4E00\u4E9B\u5185\u7F6E\u7684\u811A\u672C\u548C npm \u9884\u8BBE\u7684\u751F\u547D\u5468\u671F\u4E8B\u4EF6\uFF0C\u4EE5\u53CA\u4EFB\u610F\u7684\u811A\u672C\u3002\n\n\u8FD9\u4E9B\u90FD\u53EF\u4EE5\u901A\u8FC7\u8FD0\u884C `npm run-script <stage>` \u6216\u7B80\u79F0 `npm run <stage>` \u6765\u6267\u884C\u3002\n\n\u540D\u79F0\u5339\u914D\u7684[\u524D\u7F6E\u547D\u4EE4\u548C\u540E\u7F6E\u547D\u4EE4](https://docs.npmjs.com/cli/v9/using-npm/scripts#pre--post-scripts)\u4E5F\u4F1A\u88AB\u8FD0\u884C\uFF08\u4F8B\u5982 `premyscript`\u3001`myscript`\u3001`postmyscript`\uFF09\u3002\n\n``` json\n{\n "scripts": {\n "premyscript": "",\n "myscript": "",\n "postmyscript": "",\n }\n}\n```\n\n\u5F53\u6267\u884C `npm run myscripts` \u7684\u65F6\u5019\uFF0C`premyscripts` \u5BF9\u5E94\u7684\u811A\u672C\u4F1A\u5728\u5B83\u4E4B\u524D\u6267\u884C\uFF0C`postmyscripts` \u5BF9\u5E94\u7684\u811A\u672C\u4F1A\u5728\u5B83\u4E4B\u540E\u6267\u884C\u3002\n\n\u6765\u81EA\u4F9D\u8D56\u7684\u811A\u672C\u547D\u4EE4\u53EF\u4EE5\u7528 `npm explore <pkg> -- npm run <stage>` \u8FD0\u884C\u3002\n\n\u8FD8\u6709\u4E00\u4E9B\u7279\u6B8A\u7684\u751F\u547D\u5468\u671F\u811A\u672C\uFF08Life Scripts\uFF09\uFF0C\u53EA\u5728\u67D0\u4E9B\u60C5\u51B5\u4E0B\u53D1\u751F\u3002\u8FD9\u91CC\u4ECB\u7ECD\u51E0\u4E2A\u901A\u5E38\u9700\u8981\u4E86\u89E3\u7684\u60C5\u51B5\u3002\n\n#### `npm install`\n\n\u5F53\u4F60\u8FD0\u884C `npm install -g <pkg-name>` \u65F6\uFF0C\u4EE5\u4E0B\u811A\u672C\u4F1A\u8FD0\u884C\u3002\n\n- `preinstall`\n- `install`\n- `postinstall`\n- `prepublish`\n- `preprepare`\n- `prepare`\n- `postprepare`\n\n\u5982\u679C\u4F60\u7684\u8F6F\u4EF6\u5305\u6839\u76EE\u5F55\u6709\u4E00\u4E2A `binding.gyp` \u6587\u4EF6\uFF0C\u800C\u4F60\u6CA1\u6709\u5B9A\u4E49 `install` \u6216 `preinstall` \u811A\u672C\uFF0C\u90A3\u4E48 npm \u5C06\u4EE5 `node-gyp rebuild` \u4F5C\u4E3A\u9ED8\u8BA4\u7684 install \u547D\u4EE4\uFF0C\u4F7F\u7528 [node-gyp](https://github.com/nodejs/node-gyp) \u8FDB\u884C\u7F16\u8BD1\u3002\n\n#### `npm publish`\n\n\u5F53\u53D1\u5E03\u9879\u76EE\u7684\u65F6\u5019\uFF0C\u6267\u884C\u8BE5\u547D\u4EE4\u4F1A\u89E6\u53D1\u4EE5\u4E0B\u811A\u672C\uFF1A\n\n- `prepublishOnly`\n- `prepack`\n- `prepare`\n- `postpack`\n- `publish`\n- `postpublish`\n\n\u5F53\u4EE5 [`--dry-run`](https://docs.npmjs.com/cli/v7/commands/npm-publish#dry-run) \u6A21\u5F0F\u8FD0\u884C\u7684\u65F6\u5019\uFF0C`prepare` \u5BF9\u5E94\u7684\u811A\u672C\u5C06\u4E0D\u4F1A\u6267\u884C\u3002\n\n### peerDependencies\n\n\u5728\u67D0\u4E9B\u60C5\u51B5\u4E0B\uFF0C\u4F60\u7684 npm \u9879\u76EE\u4E0E\u5B83\u7684\u5BBF\u4E3B\u5DE5\u5177\u6216\u8005\u5E93\u4E4B\u95F4\u5B58\u5728\u67D0\u79CD\u517C\u5BB9\u5173\u7CFB\uFF08\u4F8B\u5982\u4E00\u4E2A webpack \u63D2\u4EF6\u9879\u76EE\u548C webpack\uFF09\uFF0C\u540C\u65F6\u4F60\u7684 npm \u9879\u76EE\u4E0D\u60F3\u5C06\u5BBF\u4E3B\u4F5C\u4E3A\u5FC5\u8981\u7684\u4F9D\u8D56\uFF0C\u8FD9\u4E2A\u65F6\u5019\u901A\u5E38\u8BF4\u660E\u4F60\u7684\u9879\u76EE\u53EF\u80FD\u662F\u8FD9\u4E2A\u5BBF\u4E3B\u5DE5\u5177\u6216\u8005\u5E93\u7684\u63D2\u4EF6\u3002\u4F60\u7684 npm \u9879\u76EE\u4F1A\u5BF9\u5BBF\u4E3B\u5305\u7684\u7248\u672C\u6709\u4E00\u5B9A\u7684\u8981\u6C42\uFF0C\u56E0\u4E3A\u53EA\u6709\u5728\u7279\u5B9A\u7684\u7248\u672C\u4E0B\u624D\u4F1A\u66B4\u9732\u51FA npm \u9879\u76EE\u6240\u9700\u8981\u7684 API\u3002\n\n\u5173\u4E8E\u66F4\u591A `peerDependencies` \u7684\u89E3\u91CA\uFF0C\u53EF\u4EE5\u901A\u8FC7\u4E0B\u9762\u7684\u94FE\u63A5\u4E86\u89E3 npm\u3001pnpm\u3001Yarn \u5BF9\u4E8E\u5B83\u7684\u4E0D\u540C\u5904\u7406\u65B9\u5F0F\uFF1A\n\n- [npm \u5BF9 peerDependencies \u7684\u89E3\u91CA](https://docs.npmjs.com/cli/v9/configuring-npm/package-json#peerdependencies)\n- [pnpm vs npm VS Yarn](https://pnpm.io/feature-comparison)\n\n## npm \u5305\u7BA1\u7406\u5668\n\n\u9664\u4E86 npm \u8FD9\u79CD\u6807\u51C6\u7684\u5305\u7BA1\u7406\u5668\u4EE5\u5916\uFF0C\u76EE\u524D\u4E3B\u6D41\u7684\u8FD8\u6709 **pnpm** \u548C **Yarn**\uFF0C\u5B83\u4EEC\u90FD\u662F\u4E0D\u9519\u7684 npm cli \u66FF\u4EE3\u54C1\u3002\n\n\u63A8\u8350\u4F7F\u7528 [pnpm](https://pnpm.io/installation) \u6765\u7BA1\u7406\u9879\u76EE\u4F9D\u8D56\uFF0C\u53EF\u4EE5\u901A\u8FC7\u4E0B\u9762\u7684\u65B9\u5F0F\u5B89\u88C5\u5B83\uFF1A\n\n```bash\nnpm install -g pnpm\n```\n\n## Module Tools \u914D\u7F6E\u6587\u4EF6\n\n\u521D\u59CB\u5316\u7684\u6A21\u5757\u5DE5\u7A0B\u9879\u76EE\u76EE\u5F55\u4E0B\u63D0\u4F9B\u4E86 Module Tools \u7684\u914D\u7F6E\u6587\u4EF6 \u2014\u2014 `modern.config.(j|t)s`\u3002\u9ED8\u8BA4\u60C5\u51B5\u4E0B\uFF0C\u4E0D\u9700\u8981\u505A\u4EFB\u4F55\u914D\u7F6E\uFF0C\u56E0\u6B64 `modern.config` \u914D\u7F6E\u6587\u4EF6\u4E0D\u662F\u5FC5\u987B\u5B58\u5728\u7684\u3002\n\n\u521D\u59CB\u5316\u7684\u914D\u7F6E\u6587\u4EF6\u7684\u5185\u5BB9\u5982\u4E0B\uFF1A\n\n``` typescript\n// modern.config.ts\nimport { defineConfig } from \'@modern-js/module-tools\';\n\nexport default defineConfig({});\n```\n\n``` js\n// modern.config.js\nconst { defineConfig } = require(\'@modern-js/module-tools\');\n\nmodule.exports = defineConfig({});\n```\n\n**\u6211\u4EEC\u63A8\u8350\u4F7F\u7528 `defineConfig` \u51FD\u6570**\uFF0C\u4E0D\u8FC7\u5E76\u4E0D\u5F3A\u5236\u4F7F\u7528\u5B83\u3002\u56E0\u6B64\u4F60\u4E5F\u53EF\u4EE5\u5728\u914D\u7F6E\u6587\u4EF6\u4E2D\u76F4\u63A5\u8FD4\u56DE\u4E00\u4E2A\u5BF9\u8C61\uFF1A\n\n``` typescript\n// modern.config.ts\nexport default {};\n```\n\n``` js\n// modern.config.js\nmodule.exports = {};\n```\n';export{t as CH,r as chCodeConfig,y as content,E as default,h as frontmatter,b as lastUpdatedTime,F as title,f as toc};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import{jsx as o,jsxs as n,Fragment as s}from"react/jsx-runtime";import{a as d,C as p}from"./components.esm.03560353.js";import"react";import"react-dom";const t={annotations:d,Code:p},r={staticMediaQuery:"not screen, (max-width: 768px)",theme:{name:"nord",type:"dark",semanticHighlighting:!0,colors:{focusBorder:"#3b4252",foreground:"#d8dee9","activityBar.background":"#2e3440","activityBar.dropBackground":"#3b4252","activityBar.foreground":"#d8dee9","activityBar.activeBorder":"#88c0d0","activityBar.activeBackground":"#3b4252","activityBarBadge.background":"#88c0d0","activityBarBadge.foreground":"#2e3440","badge.foreground":"#2e3440","badge.background":"#88c0d0","button.background":"#88c0d0ee","button.foreground":"#2e3440","button.hoverBackground":"#88c0d0","button.secondaryBackground":"#434c5e","button.secondaryForeground":"#d8dee9","button.secondaryHoverBackground":"#4c566a","charts.red":"#bf616a","charts.blue":"#81a1c1","charts.yellow":"#ebcb8b","charts.orange":"#d08770","charts.green":"#a3be8c","charts.purple":"#b48ead","charts.foreground":"#d8dee9","charts.lines":"#88c0d0","debugConsole.infoForeground":"#88c0d0","debugConsole.warningForeground":"#ebcb8b","debugConsole.errorForeground":"#bf616a","debugConsole.sourceForeground":"#616e88","debugConsoleInputIcon.foreground":"#81a1c1","debugExceptionWidget.background":"#4c566a","debugExceptionWidget.border":"#2e3440","debugToolBar.background":"#3b4252",descriptionForeground:"#d8dee9e6","diffEditor.insertedTextBackground":"#81a1c133","diffEditor.removedTextBackground":"#bf616a4d","dropdown.background":"#3b4252","dropdown.border":"#3b4252","dropdown.foreground":"#d8dee9","editorActiveLineNumber.foreground":"#d8dee9cc","editorCursor.foreground":"#d8dee9","editorHint.border":"#ebcb8b00","editorHint.foreground":"#ebcb8b","editorIndentGuide.background":"#434c5eb3","editorIndentGuide.activeBackground":"#4c566a","editorInlayHint.background":"#434c5e","editorInlayHint.foreground":"#d8dee9","editorLineNumber.foreground":"#4c566a","editorLineNumber.activeForeground":"#d8dee9","editorWhitespace.foreground":"#4c566ab3","editorWidget.background":"#2e3440","editorWidget.border":"#3b4252","editor.background":"#2e3440","editor.foreground":"#d8dee9","editor.hoverHighlightBackground":"#3b4252","editor.findMatchBackground":"#88c0d066","editor.findMatchHighlightBackground":"#88c0d033","editor.findRangeHighlightBackground":"#88c0d033","editor.lineHighlightBackground":"#3b4252","editor.lineHighlightBorder":"#3b4252","editor.inactiveSelectionBackground":"#434c5ecc","editor.inlineValuesBackground":"#4c566a","editor.inlineValuesForeground":"#eceff4","editor.selectionBackground":"#434c5ecc","editor.selectionHighlightBackground":"#434c5ecc","editor.rangeHighlightBackground":"#434c5e52","editor.wordHighlightBackground":"#81a1c166","editor.wordHighlightStrongBackground":"#81a1c199","editor.stackFrameHighlightBackground":"#5e81ac","editor.focusedStackFrameHighlightBackground":"#5e81ac","editorError.foreground":"#bf616a","editorError.border":"#bf616a00","editorWarning.foreground":"#ebcb8b","editorWarning.border":"#ebcb8b00","editorBracketMatch.background":"#2e344000","editorBracketMatch.border":"#88c0d0","editorBracketHighlight.foreground1":"#8fbcbb","editorBracketHighlight.foreground2":"#88c0d0","editorBracketHighlight.foreground3":"#81a1c1","editorBracketHighlight.foreground4":"#5e81ac","editorBracketHighlight.foreground5":"#8fbcbb","editorBracketHighlight.foreground6":"#88c0d0","editorBracketHighlight.unexpectedBracket.foreground":"#bf616a","editorCodeLens.foreground":"#4c566a","editorGroup.background":"#2e3440","editorGroup.border":"#3b425201","editorGroup.dropBackground":"#3b425299","editorGroupHeader.border":"#3b425200","editorGroupHeader.noTabsBackground":"#2e3440","editorGroupHeader.tabsBackground":"#2e3440","editorGroupHeader.tabsBorder":"#3b425200","editorGutter.background":"#2e3440","editorGutter.modifiedBackground":"#ebcb8b","editorGutter.addedBackground":"#a3be8c","editorGutter.deletedBackground":"#bf616a","editorHoverWidget.background":"#3b4252","editorHoverWidget.border":"#3b4252","editorLink.activeForeground":"#88c0d0","editorMarkerNavigation.background":"#5e81acc0","editorMarkerNavigationError.background":"#bf616ac0","editorMarkerNavigationWarning.background":"#ebcb8bc0","editorOverviewRuler.border":"#3b4252","editorOverviewRuler.currentContentForeground":"#3b4252","editorOverviewRuler.incomingContentForeground":"#3b4252","editorOverviewRuler.findMatchForeground":"#88c0d066","editorOverviewRuler.rangeHighlightForeground":"#88c0d066","editorOverviewRuler.selectionHighlightForeground":"#88c0d066","editorOverviewRuler.wordHighlightForeground":"#88c0d066","editorOverviewRuler.wordHighlightStrongForeground":"#88c0d066","editorOverviewRuler.modifiedForeground":"#ebcb8b","editorOverviewRuler.addedForeground":"#a3be8c","editorOverviewRuler.deletedForeground":"#bf616a","editorOverviewRuler.errorForeground":"#bf616a","editorOverviewRuler.warningForeground":"#ebcb8b","editorOverviewRuler.infoForeground":"#81a1c1","editorRuler.foreground":"#434c5e","editorSuggestWidget.background":"#2e3440","editorSuggestWidget.border":"#3b4252","editorSuggestWidget.foreground":"#d8dee9","editorSuggestWidget.focusHighlightForeground":"#88c0d0","editorSuggestWidget.highlightForeground":"#88c0d0","editorSuggestWidget.selectedBackground":"#434c5e","editorSuggestWidget.selectedForeground":"#d8dee9","extensionButton.prominentForeground":"#d8dee9","extensionButton.prominentBackground":"#434c5e","extensionButton.prominentHoverBackground":"#4c566a",errorForeground:"#bf616a","gitDecoration.modifiedResourceForeground":"#ebcb8b","gitDecoration.deletedResourceForeground":"#bf616a","gitDecoration.untrackedResourceForeground":"#a3be8c","gitDecoration.ignoredResourceForeground":"#d8dee966","gitDecoration.conflictingResourceForeground":"#5e81ac","gitDecoration.submoduleResourceForeground":"#8fbcbb","gitDecoration.stageDeletedResourceForeground":"#bf616a","gitDecoration.stageModifiedResourceForeground":"#ebcb8b","input.background":"#3b4252","input.foreground":"#d8dee9","input.placeholderForeground":"#d8dee999","input.border":"#3b4252","inputOption.activeBackground":"#5e81ac","inputOption.activeBorder":"#5e81ac","inputOption.activeForeground":"#eceff4","inputValidation.errorBackground":"#bf616a","inputValidation.errorBorder":"#bf616a","inputValidation.infoBackground":"#81a1c1","inputValidation.infoBorder":"#81a1c1","inputValidation.warningBackground":"#d08770","inputValidation.warningBorder":"#d08770","keybindingLabel.background":"#4c566a","keybindingLabel.border":"#4c566a","keybindingLabel.bottomBorder":"#4c566a","keybindingLabel.foreground":"#d8dee9","list.activeSelectionBackground":"#88c0d0","list.activeSelectionForeground":"#2e3440","list.inactiveSelectionBackground":"#434c5e","list.inactiveSelectionForeground":"#d8dee9","list.inactiveFocusBackground":"#434c5ecc","list.hoverForeground":"#eceff4","list.focusForeground":"#d8dee9","list.focusBackground":"#88c0d099","list.focusHighlightForeground":"#eceff4","list.hoverBackground":"#3b4252","list.dropBackground":"#88c0d099","list.highlightForeground":"#88c0d0","list.errorForeground":"#bf616a","list.warningForeground":"#ebcb8b","merge.currentHeaderBackground":"#81a1c166","merge.currentContentBackground":"#81a1c14d","merge.incomingHeaderBackground":"#8fbcbb66","merge.incomingContentBackground":"#8fbcbb4d","merge.border":"#3b425200","minimap.background":"#2e3440","minimap.errorHighlight":"#bf616acc","minimap.findMatchHighlight":"#88c0d0","minimap.selectionHighlight":"#88c0d0cc","minimap.warningHighlight":"#ebcb8bcc","minimapGutter.addedBackground":"#a3be8c","minimapGutter.deletedBackground":"#bf616a","minimapGutter.modifiedBackground":"#ebcb8b","minimapSlider.activeBackground":"#434c5eaa","minimapSlider.background":"#434c5e99","minimapSlider.hoverBackground":"#434c5eaa","notification.background":"#3b4252","notification.buttonBackground":"#434c5e","notification.buttonForeground":"#d8dee9","notification.buttonHoverBackground":"#4c566a","notification.errorBackground":"#bf616a","notification.errorForeground":"#2e3440","notification.foreground":"#d8dee9","notification.infoBackground":"#88c0d0","notification.infoForeground":"#2e3440","notification.warningBackground":"#ebcb8b","notification.warningForeground":"#2e3440","notificationCenter.border":"#3b425200","notificationCenterHeader.background":"#2e3440","notificationCenterHeader.foreground":"#88c0d0","notificationLink.foreground":"#88c0d0","notifications.background":"#3b4252","notifications.border":"#2e3440","notifications.foreground":"#d8dee9","notificationToast.border":"#3b425200","panel.background":"#2e3440","panel.border":"#3b4252","panelTitle.activeBorder":"#88c0d000","panelTitle.activeForeground":"#88c0d0","panelTitle.inactiveForeground":"#d8dee9","peekView.border":"#4c566a","peekViewEditor.background":"#2e3440","peekViewEditorGutter.background":"#2e3440","peekViewEditor.matchHighlightBackground":"#88c0d04d","peekViewResult.background":"#2e3440","peekViewResult.fileForeground":"#88c0d0","peekViewResult.lineForeground":"#d8dee966","peekViewResult.matchHighlightBackground":"#88c0d0cc","peekViewResult.selectionBackground":"#434c5e","peekViewResult.selectionForeground":"#d8dee9","peekViewTitle.background":"#3b4252","peekViewTitleDescription.foreground":"#d8dee9","peekViewTitleLabel.foreground":"#88c0d0","pickerGroup.border":"#3b4252","pickerGroup.foreground":"#88c0d0","progressBar.background":"#88c0d0","quickInputList.focusBackground":"#88c0d0","quickInputList.focusForeground":"#2e3440","sash.hoverBorder":"#88c0d0","scrollbar.shadow":"#00000066","scrollbarSlider.activeBackground":"#434c5eaa","scrollbarSlider.background":"#434c5e99","scrollbarSlider.hoverBackground":"#434c5eaa","selection.background":"#88c0d099","sideBar.background":"#2e3440","sideBar.foreground":"#d8dee9","sideBar.border":"#3b4252","sideBarSectionHeader.background":"#3b4252","sideBarSectionHeader.foreground":"#d8dee9","sideBarTitle.foreground":"#d8dee9","statusBar.background":"#3b4252","statusBar.debuggingBackground":"#5e81ac","statusBar.debuggingForeground":"#d8dee9","statusBar.noFolderForeground":"#d8dee9","statusBar.noFolderBackground":"#3b4252","statusBar.foreground":"#d8dee9","statusBarItem.activeBackground":"#4c566a","statusBarItem.hoverBackground":"#434c5e","statusBarItem.prominentBackground":"#3b4252","statusBarItem.prominentHoverBackground":"#434c5e","statusBarItem.errorBackground":"#3b4252","statusBarItem.errorForeground":"#bf616a","statusBarItem.warningBackground":"#ebcb8b","statusBarItem.warningForeground":"#2e3440","statusBar.border":"#3b425200","tab.activeBackground":"#3b4252","tab.activeForeground":"#d8dee9","tab.border":"#3b425200","tab.activeBorder":"#88c0d000","tab.unfocusedActiveBorder":"#88c0d000","tab.inactiveBackground":"#2e3440","tab.inactiveForeground":"#d8dee966","tab.unfocusedActiveForeground":"#d8dee999","tab.unfocusedInactiveForeground":"#d8dee966","tab.hoverBackground":"#3b4252cc","tab.unfocusedHoverBackground":"#3b4252b3","tab.hoverBorder":"#88c0d000","tab.unfocusedHoverBorder":"#88c0d000","tab.activeBorderTop":"#88c0d000","tab.unfocusedActiveBorderTop":"#88c0d000","tab.lastPinnedBorder":"#4c566a","terminal.background":"#2e3440","terminal.foreground":"#d8dee9","terminal.ansiBlack":"#3b4252","terminal.ansiRed":"#bf616a","terminal.ansiGreen":"#a3be8c","terminal.ansiYellow":"#ebcb8b","terminal.ansiBlue":"#81a1c1","terminal.ansiMagenta":"#b48ead","terminal.ansiCyan":"#88c0d0","terminal.ansiWhite":"#e5e9f0","terminal.ansiBrightBlack":"#4c566a","terminal.ansiBrightRed":"#bf616a","terminal.ansiBrightGreen":"#a3be8c","terminal.ansiBrightYellow":"#ebcb8b","terminal.ansiBrightBlue":"#81a1c1","terminal.ansiBrightMagenta":"#b48ead","terminal.ansiBrightCyan":"#8fbcbb","terminal.ansiBrightWhite":"#eceff4","terminal.tab.activeBorder":"#88c0d0","textBlockQuote.background":"#3b4252","textBlockQuote.border":"#81a1c1","textCodeBlock.background":"#4c566a","textLink.activeForeground":"#88c0d0","textLink.foreground":"#88c0d0","textPreformat.foreground":"#8fbcbb","textSeparator.foreground":"#eceff4","titleBar.activeBackground":"#2e3440","titleBar.activeForeground":"#d8dee9","titleBar.border":"#2e344000","titleBar.inactiveBackground":"#2e3440","titleBar.inactiveForeground":"#d8dee966","tree.indentGuidesStroke":"#616e88","walkThrough.embeddedEditorBackground":"#2e3440","welcomePage.buttonBackground":"#434c5e","welcomePage.buttonHoverBackground":"#4c566a","widget.shadow":"#00000066"},tokenColors:[{settings:{foreground:"#d8dee9ff",background:"#2e3440ff"}},{scope:"emphasis",settings:{fontStyle:"italic"}},{scope:"strong",settings:{fontStyle:"bold"}},{name:"Comment",scope:"comment",settings:{foreground:"#616E88"}},{name:"Constant Character",scope:"constant.character",settings:{foreground:"#EBCB8B"}},{name:"Constant Character Escape",scope:"constant.character.escape",settings:{foreground:"#EBCB8B"}},{name:"Constant Language",scope:"constant.language",settings:{foreground:"#81A1C1"}},{name:"Constant Numeric",scope:"constant.numeric",settings:{foreground:"#B48EAD"}},{name:"Constant Regexp",scope:"constant.regexp",settings:{foreground:"#EBCB8B"}},{name:"Entity Name Class/Type",scope:["entity.name.class","entity.name.type.class"],settings:{foreground:"#8FBCBB"}},{name:"Entity Name Function",scope:"entity.name.function",settings:{foreground:"#88C0D0"}},{name:"Entity Name Tag",scope:"entity.name.tag",settings:{foreground:"#81A1C1"}},{name:"Entity Other Attribute Name",scope:"entity.other.attribute-name",settings:{foreground:"#8FBCBB"}},{name:"Entity Other Inherited Class",scope:"entity.other.inherited-class",settings:{fontStyle:"bold",foreground:"#8FBCBB"}},{name:"Invalid Deprecated",scope:"invalid.deprecated",settings:{foreground:"#D8DEE9",background:"#EBCB8B"}},{name:"Invalid Illegal",scope:"invalid.illegal",settings:{foreground:"#D8DEE9",background:"#BF616A"}},{name:"Keyword",scope:"keyword",settings:{foreground:"#81A1C1"}},{name:"Keyword Operator",scope:"keyword.operator",settings:{foreground:"#81A1C1"}},{name:"Keyword Other New",scope:"keyword.other.new",settings:{foreground:"#81A1C1"}},{name:"Markup Bold",scope:"markup.bold",settings:{fontStyle:"bold"}},{name:"Markup Changed",scope:"markup.changed",settings:{foreground:"#EBCB8B"}},{name:"Markup Deleted",scope:"markup.deleted",settings:{foreground:"#BF616A"}},{name:"Markup Inserted",scope:"markup.inserted",settings:{foreground:"#A3BE8C"}},{name:"Meta Preprocessor",scope:"meta.preprocessor",settings:{foreground:"#5E81AC"}},{name:"Punctuation",scope:"punctuation",settings:{foreground:"#ECEFF4"}},{name:"Punctuation Definition Parameters",scope:["punctuation.definition.method-parameters","punctuation.definition.function-parameters","punctuation.definition.parameters"],settings:{foreground:"#ECEFF4"}},{name:"Punctuation Definition Tag",scope:"punctuation.definition.tag",settings:{foreground:"#81A1C1"}},{name:"Punctuation Definition Comment",scope:["punctuation.definition.comment","punctuation.end.definition.comment","punctuation.start.definition.comment"],settings:{foreground:"#616E88"}},{name:"Punctuation Section",scope:"punctuation.section",settings:{foreground:"#ECEFF4"}},{name:"Punctuation Section Embedded",scope:["punctuation.section.embedded.begin","punctuation.section.embedded.end"],settings:{foreground:"#81A1C1"}},{name:"Punctuation Terminator",scope:"punctuation.terminator",settings:{foreground:"#81A1C1"}},{name:"Punctuation Variable",scope:"punctuation.definition.variable",settings:{foreground:"#81A1C1"}},{name:"Storage",scope:"storage",settings:{foreground:"#81A1C1"}},{name:"String",scope:"string",settings:{foreground:"#A3BE8C"}},{name:"String Regexp",scope:"string.regexp",settings:{foreground:"#EBCB8B"}},{name:"Support Class",scope:"support.class",settings:{foreground:"#8FBCBB"}},{name:"Support Constant",scope:"support.constant",settings:{foreground:"#81A1C1"}},{name:"Support Function",scope:"support.function",settings:{foreground:"#88C0D0"}},{name:"Support Function Construct",scope:"support.function.construct",settings:{foreground:"#81A1C1"}},{name:"Support Type",scope:"support.type",settings:{foreground:"#8FBCBB"}},{name:"Support Type Exception",scope:"support.type.exception",settings:{foreground:"#8FBCBB"}},{name:"Token Debug",scope:"token.debug-token",settings:{foreground:"#b48ead"}},{name:"Token Error",scope:"token.error-token",settings:{foreground:"#bf616a"}},{name:"Token Info",scope:"token.info-token",settings:{foreground:"#88c0d0"}},{name:"Token Warning",scope:"token.warn-token",settings:{foreground:"#ebcb8b"}},{name:"Variable",scope:"variable.other",settings:{foreground:"#D8DEE9"}},{name:"Variable Language",scope:"variable.language",settings:{foreground:"#81A1C1"}},{name:"Variable Parameter",scope:"variable.parameter",settings:{foreground:"#D8DEE9"}},{name:"[C/CPP] Punctuation Separator Pointer-Access",scope:"punctuation.separator.pointer-access.c",settings:{foreground:"#81A1C1"}},{name:"[C/CPP] Meta Preprocessor Include",scope:["source.c meta.preprocessor.include","source.c string.quoted.other.lt-gt.include"],settings:{foreground:"#8FBCBB"}},{name:"[C/CPP] Conditional Directive",scope:["source.cpp keyword.control.directive.conditional","source.cpp punctuation.definition.directive","source.c keyword.control.directive.conditional","source.c punctuation.definition.directive"],settings:{foreground:"#5E81AC",fontStyle:"bold"}},{name:"[CSS] Constant Other Color RGB Value",scope:"source.css constant.other.color.rgb-value",settings:{foreground:"#B48EAD"}},{name:"[CSS](Function) Meta Property-Value",scope:"source.css meta.property-value",settings:{foreground:"#88C0D0"}},{name:"[CSS] Media Queries",scope:["source.css keyword.control.at-rule.media","source.css keyword.control.at-rule.media punctuation.definition.keyword"],settings:{foreground:"#D08770"}},{name:"[CSS] Punctuation Definition Keyword",scope:"source.css punctuation.definition.keyword",settings:{foreground:"#81A1C1"}},{name:"[CSS] Support Type Property Name",scope:"source.css support.type.property-name",settings:{foreground:"#D8DEE9"}},{name:"[diff] Meta Range Context",scope:"source.diff meta.diff.range.context",settings:{foreground:"#8FBCBB"}},{name:"[diff] Meta Header From-File",scope:"source.diff meta.diff.header.from-file",settings:{foreground:"#8FBCBB"}},{name:"[diff] Punctuation Definition From-File",scope:"source.diff punctuation.definition.from-file",settings:{foreground:"#8FBCBB"}},{name:"[diff] Punctuation Definition Range",scope:"source.diff punctuation.definition.range",settings:{foreground:"#8FBCBB"}},{name:"[diff] Punctuation Definition Separator",scope:"source.diff punctuation.definition.separator",settings:{foreground:"#81A1C1"}},{name:"[Elixir](JakeBecker.elixir-ls) module names",scope:"entity.name.type.module.elixir",settings:{foreground:"#8FBCBB"}},{name:"[Elixir](JakeBecker.elixir-ls) module attributes",scope:"variable.other.readwrite.module.elixir",settings:{foreground:"#D8DEE9",fontStyle:"bold"}},{name:"[Elixir](JakeBecker.elixir-ls) atoms",scope:"constant.other.symbol.elixir",settings:{foreground:"#D8DEE9",fontStyle:"bold"}},{name:"[Elixir](JakeBecker.elixir-ls) modules",scope:"variable.other.constant.elixir",settings:{foreground:"#8FBCBB"}},{name:"[Go] String Format Placeholder",scope:"source.go constant.other.placeholder.go",settings:{foreground:"#EBCB8B"}},{name:"[Java](JavaDoc) Comment Block Documentation HTML Entities",scope:"source.java comment.block.documentation.javadoc punctuation.definition.entity.html",settings:{foreground:"#81A1C1"}},{name:"[Java](JavaDoc) Constant Other",scope:"source.java constant.other",settings:{foreground:"#D8DEE9"}},{name:"[Java](JavaDoc) Keyword Other Documentation",scope:"source.java keyword.other.documentation",settings:{foreground:"#8FBCBB"}},{name:"[Java](JavaDoc) Keyword Other Documentation Author",scope:"source.java keyword.other.documentation.author.javadoc",settings:{foreground:"#8FBCBB"}},{name:"[Java](JavaDoc) Keyword Other Documentation Directive/Custom",scope:["source.java keyword.other.documentation.directive","source.java keyword.other.documentation.custom"],settings:{foreground:"#8FBCBB"}},{name:"[Java](JavaDoc) Keyword Other Documentation See",scope:"source.java keyword.other.documentation.see.javadoc",settings:{foreground:"#8FBCBB"}},{name:"[Java] Meta Method-Call",scope:"source.java meta.method-call meta.method",settings:{foreground:"#88C0D0"}},{name:"[Java](JavaDoc) Meta Tag Template Link",scope:["source.java meta.tag.template.link.javadoc","source.java string.other.link.title.javadoc"],settings:{foreground:"#8FBCBB"}},{name:"[Java](JavaDoc) Meta Tag Template Value",scope:"source.java meta.tag.template.value.javadoc",settings:{foreground:"#88C0D0"}},{name:"[Java](JavaDoc) Punctuation Definition Keyword",scope:"source.java punctuation.definition.keyword.javadoc",settings:{foreground:"#8FBCBB"}},{name:"[Java](JavaDoc) Punctuation Definition Tag",scope:["source.java punctuation.definition.tag.begin.javadoc","source.java punctuation.definition.tag.end.javadoc"],settings:{foreground:"#616E88"}},{name:"[Java] Storage Modifier Import",scope:"source.java storage.modifier.import",settings:{foreground:"#8FBCBB"}},{name:"[Java] Storage Modifier Package",scope:"source.java storage.modifier.package",settings:{foreground:"#8FBCBB"}},{name:"[Java] Storage Type",scope:"source.java storage.type",settings:{foreground:"#8FBCBB"}},{name:"[Java] Storage Type Annotation",scope:"source.java storage.type.annotation",settings:{foreground:"#D08770"}},{name:"[Java] Storage Type Generic",scope:"source.java storage.type.generic",settings:{foreground:"#8FBCBB"}},{name:"[Java] Storage Type Primitive",scope:"source.java storage.type.primitive",settings:{foreground:"#81A1C1"}},{name:"[JavaScript] Decorator",scope:["source.js punctuation.decorator","source.js meta.decorator variable.other.readwrite","source.js meta.decorator entity.name.function"],settings:{foreground:"#D08770"}},{name:"[JavaScript] Meta Object-Literal Key",scope:"source.js meta.object-literal.key",settings:{foreground:"#88C0D0"}},{name:"[JavaScript](JSDoc) Storage Type Class",scope:"source.js storage.type.class.jsdoc",settings:{foreground:"#8FBCBB"}},{name:"[JavaScript] String Template Literals Punctuation",scope:["source.js string.quoted.template punctuation.quasi.element.begin","source.js string.quoted.template punctuation.quasi.element.end","source.js string.template punctuation.definition.template-expression"],settings:{foreground:"#81A1C1"}},{name:"[JavaScript] Interpolated String Template Punctuation Functions",scope:"source.js string.quoted.template meta.method-call.with-arguments",settings:{foreground:"#ECEFF4"}},{name:"[JavaScript] String Template Literal Variable",scope:["source.js string.template meta.template.expression support.variable.property","source.js string.template meta.template.expression variable.other.object"],settings:{foreground:"#D8DEE9"}},{name:"[JavaScript] Support Type Primitive",scope:"source.js support.type.primitive",settings:{foreground:"#81A1C1"}},{name:"[JavaScript] Variable Other Object",scope:"source.js variable.other.object",settings:{foreground:"#D8DEE9"}},{name:"[JavaScript] Variable Other Read-Write Alias",scope:"source.js variable.other.readwrite.alias",settings:{foreground:"#8FBCBB"}},{name:"[JavaScript] Parentheses in Template Strings",scope:["source.js meta.embedded.line meta.brace.square","source.js meta.embedded.line meta.brace.round","source.js string.quoted.template meta.brace.square","source.js string.quoted.template meta.brace.round"],settings:{foreground:"#ECEFF4"}},{name:"[HTML] Constant Character Entity",scope:"text.html.basic constant.character.entity.html",settings:{foreground:"#EBCB8B"}},{name:"[HTML] Constant Other Inline-Data",scope:"text.html.basic constant.other.inline-data",settings:{foreground:"#D08770",fontStyle:"italic"}},{name:"[HTML] Meta Tag SGML Doctype",scope:"text.html.basic meta.tag.sgml.doctype",settings:{foreground:"#5E81AC"}},{name:"[HTML] Punctuation Definition Entity",scope:"text.html.basic punctuation.definition.entity",settings:{foreground:"#81A1C1"}},{name:"[INI] Entity Name Section Group-Title",scope:"source.properties entity.name.section.group-title.ini",settings:{foreground:"#88C0D0"}},{name:"[INI] Punctuation Separator Key-Value",scope:"source.properties punctuation.separator.key-value.ini",settings:{foreground:"#81A1C1"}},{name:"[Markdown] Markup Fenced Code Block",scope:["text.html.markdown markup.fenced_code.block","text.html.markdown markup.fenced_code.block punctuation.definition"],settings:{foreground:"#8FBCBB"}},{name:"[Markdown] Markup Heading",scope:"markup.heading",settings:{foreground:"#88C0D0"}},{name:"[Markdown] Markup Inline",scope:["text.html.markdown markup.inline.raw","text.html.markdown markup.inline.raw punctuation.definition.raw"],settings:{foreground:"#8FBCBB"}},{name:"[Markdown] Markup Italic",scope:"text.html.markdown markup.italic",settings:{fontStyle:"italic"}},{name:"[Markdown] Markup Link",scope:"text.html.markdown markup.underline.link",settings:{fontStyle:"underline"}},{name:"[Markdown] Markup List Numbered/Unnumbered",scope:"text.html.markdown beginning.punctuation.definition.list",settings:{foreground:"#81A1C1"}},{name:"[Markdown] Markup Quote Punctuation Definition",scope:"text.html.markdown beginning.punctuation.definition.quote",settings:{foreground:"#8FBCBB"}},{name:"[Markdown] Markup Quote Punctuation Definition",scope:"text.html.markdown markup.quote",settings:{foreground:"#616E88"}},{name:"[Markdown] Markup Math Constant",scope:"text.html.markdown constant.character.math.tex",settings:{foreground:"#81A1C1"}},{name:"[Markdown] Markup Math Definition Marker",scope:["text.html.markdown punctuation.definition.math.begin","text.html.markdown punctuation.definition.math.end"],settings:{foreground:"#5E81AC"}},{name:"[Markdown] Markup Math Function Definition Marker",scope:"text.html.markdown punctuation.definition.function.math.tex",settings:{foreground:"#88C0D0"}},{name:"[Markdown] Markup Math Operator",scope:"text.html.markdown punctuation.math.operator.latex",settings:{foreground:"#81A1C1"}},{name:"[Markdown] Punctuation Definition Heading",scope:"text.html.markdown punctuation.definition.heading",settings:{foreground:"#81A1C1"}},{name:"[Markdown] Punctuation Definition Constant/String",scope:["text.html.markdown punctuation.definition.constant","text.html.markdown punctuation.definition.string"],settings:{foreground:"#81A1C1"}},{name:"[Markdown] String Other Link Description/Title",scope:["text.html.markdown constant.other.reference.link","text.html.markdown string.other.link.description","text.html.markdown string.other.link.title"],settings:{foreground:"#88C0D0"}},{name:"[Perl] Perl Sigils",scope:"source.perl punctuation.definition.variable",settings:{foreground:"#D8DEE9"}},{name:"[PHP] Meta Function-Call Object",scope:["source.php meta.function-call","source.php meta.function-call.object"],settings:{foreground:"#88C0D0"}},{name:"[Python] Decorator",scope:["source.python entity.name.function.decorator","source.python meta.function.decorator support.type"],settings:{foreground:"#D08770"}},{name:"[Python] Function Call",scope:"source.python meta.function-call.generic",settings:{foreground:"#88C0D0"}},{name:"[Python] Support Type",scope:"source.python support.type",settings:{foreground:"#88C0D0"}},{name:"[Python] Function Parameter",scope:["source.python variable.parameter.function.language"],settings:{foreground:"#D8DEE9"}},{name:"[Python] Function Parameter Special",scope:["source.python meta.function.parameters variable.parameter.function.language.special.self"],settings:{foreground:"#81A1C1"}},{name:"[Rust] Entity types",scope:"source.rust entity.name.type",settings:{foreground:"#8FBCBB"}},{name:"[Rust] Macro",scope:"source.rust meta.macro entity.name.function",settings:{fontStyle:"bold",foreground:"#88C0D0"}},{name:"[Rust] Attributes",scope:["source.rust meta.attribute","source.rust meta.attribute punctuation","source.rust meta.attribute keyword.operator"],settings:{foreground:"#5E81AC"}},{name:"[Rust] Traits",scope:"source.rust entity.name.type.trait",settings:{fontStyle:"bold"}},{name:"[Rust] Interpolation Bracket Curly",scope:"source.rust punctuation.definition.interpolation",settings:{foreground:"#EBCB8B"}},{name:"[SCSS] Punctuation Definition Interpolation Bracket Curly",scope:["source.css.scss punctuation.definition.interpolation.begin.bracket.curly","source.css.scss punctuation.definition.interpolation.end.bracket.curly"],settings:{foreground:"#81A1C1"}},{name:"[SCSS] Variable Interpolation",scope:"source.css.scss variable.interpolation",settings:{foreground:"#D8DEE9",fontStyle:"italic"}},{name:"[TypeScript] Decorators",scope:["source.ts punctuation.decorator","source.ts meta.decorator variable.other.readwrite","source.ts meta.decorator entity.name.function","source.tsx punctuation.decorator","source.tsx meta.decorator variable.other.readwrite","source.tsx meta.decorator entity.name.function"],settings:{foreground:"#D08770"}},{name:"[TypeScript] Object-literal keys",scope:["source.ts meta.object-literal.key","source.tsx meta.object-literal.key"],settings:{foreground:"#D8DEE9"}},{name:"[TypeScript] Object-literal functions",scope:["source.ts meta.object-literal.key entity.name.function","source.tsx meta.object-literal.key entity.name.function"],settings:{foreground:"#88C0D0"}},{name:"[TypeScript] Type/Class",scope:["source.ts support.class","source.ts support.type","source.ts entity.name.type","source.ts entity.name.class","source.tsx support.class","source.tsx support.type","source.tsx entity.name.type","source.tsx entity.name.class"],settings:{foreground:"#8FBCBB"}},{name:"[TypeScript] Static Class Support",scope:["source.ts support.constant.math","source.ts support.constant.dom","source.ts support.constant.json","source.tsx support.constant.math","source.tsx support.constant.dom","source.tsx support.constant.json"],settings:{foreground:"#8FBCBB"}},{name:"[TypeScript] Variables",scope:["source.ts support.variable","source.tsx support.variable"],settings:{foreground:"#D8DEE9"}},{name:"[TypeScript] Parentheses in Template Strings",scope:["source.ts meta.embedded.line meta.brace.square","source.ts meta.embedded.line meta.brace.round","source.tsx meta.embedded.line meta.brace.square","source.tsx meta.embedded.line meta.brace.round"],settings:{foreground:"#ECEFF4"}},{name:"[XML] Entity Name Tag Namespace",scope:"text.xml entity.name.tag.namespace",settings:{foreground:"#8FBCBB"}},{name:"[XML] Keyword Other Doctype",scope:"text.xml keyword.other.doctype",settings:{foreground:"#5E81AC"}},{name:"[XML] Meta Tag Preprocessor",scope:"text.xml meta.tag.preprocessor entity.name.tag",settings:{foreground:"#5E81AC"}},{name:"[XML] Entity Name Tag Namespace",scope:["text.xml string.unquoted.cdata","text.xml string.unquoted.cdata punctuation.definition.string"],settings:{foreground:"#D08770",fontStyle:"italic"}},{name:"[YAML] Entity Name Tag",scope:"source.yaml entity.name.tag",settings:{foreground:"#8FBCBB"}}]},autoImport:!0,showCopyButton:!0,enableSpa:!0,skipLanguages:[],filepath:"/Users/targeral/github/targeral-modern-js/website/module-tools/docs/en/guide/basic/before-getting-started.md"},h=void 0,f=[{id:"environment-preparation",text:"Environment preparation",depth:2},{id:"getting-started-with-npm",text:"Getting Started with npm",depth:2},{id:"npm-package-type-project",text:"npm package type project",depth:2},{id:"using-third-party-npm-packages",text:"Using third-party npm packages",depth:2},{id:"other-npm-bits-and-pieces-to-know",text:"Other npm bits and pieces to know",depth:2},{id:"program-entry-for-npm-packages",text:"Program entry for npm packages",depth:3},{id:"scripts",text:'"scripts"',depth:3},{id:"npm-install",text:"npm install",depth:4},{id:"npm-publish",text:"npm publish",depth:4},{id:"peerdependencies",text:"peerDependencies",depth:3},{id:"npm-package-manager",text:"npm package manager",depth:2},{id:"module-tools-configuration-file",text:"Module Tools configuration file",depth:2}],y="Before you start";function a(i){const e=Object.assign({h1:"h1",a:"a",h2:"h2",p:"p",strong:"strong",code:"code",em:"em",ul:"ul",li:"li",blockquote:"blockquote",div:"div",h3:"h3",h4:"h4"},i.components);return t||c("CH",!1),t.Code||c("CH.Code",!0),n(s,{children:[n(e.h1,{id:"before-you-start",children:[o(e.a,{className:"header-anchor","aria-hidden":"true",href:"#before-you-start",children:"#"}),"Before you start"]}),`
|
|
2
|
+
`,n(e.h2,{id:"environment-preparation",children:[o(e.a,{className:"header-anchor","aria-hidden":"true",href:"#environment-preparation",children:"#"}),"Environment preparation"]}),`
|
|
3
|
+
`,n(e.p,{children:["In order to use the Modern.js module engineering solution, you first need ",o(e.a,{href:"https://nodejs.org/zh/",target:"_blank",rel:"nofollow",children:"NodeJS"})," engine, we recommend the latest ",o(e.a,{href:"https://github.com/nodejs/Release",target:"_blank",rel:"nofollow",children:"LTS version"}),", and make sure the Node version is ",o(e.strong,{children:">=14.17.6"}),". because non-stable NodeJS releases frequently have bugs. You might consider installing via ",o(e.a,{href:"https://github.com/coreybutler/nvm-windows",target:"_blank",rel:"nofollow",children:"nvm-windows"})," and ",o(e.a,{href:"https://github.com/nvm-sh/nvm",target:"_blank",rel:"nofollow",children:"nvm"})," (Mac/linux), so you can easily switch to different NodeJS versions that might be required for different projects that you work on."]}),`
|
|
4
|
+
`,n(e.h2,{id:"getting-started-with-npm",children:[o(e.a,{className:"header-anchor","aria-hidden":"true",href:"#getting-started-with-npm",children:"#"}),"Getting Started with npm"]}),`
|
|
5
|
+
`,n(e.p,{children:["Once NodeJS is installed, not only can you access the ",o(e.code,{children:"node"})," executable from the command line, but you can also execute the ",o(e.code,{children:"npm"})," command."]}),`
|
|
6
|
+
`,o(e.p,{children:"Npm is the standard package manager for NodeJS. It started out as a tool for downloading and managing NodeJS package dependencies, but it has since evolved into a tool for front-end JavaScript."}),`
|
|
7
|
+
`,o(e.p,{children:n(e.strong,{children:["If you already know something about usage of npm and npm packages, then you can directly see ",o(e.a,{href:"/en/guide/before-getting-started.html#npm-package-manager",children:"npm package manager"})," section."]})}),`
|
|
8
|
+
`,n(e.h2,{id:"npm-package-type-project",children:[o(e.a,{className:"header-anchor","aria-hidden":"true",href:"#npm-package-type-project",children:"#"}),"npm package type project"]}),`
|
|
9
|
+
`,n(e.p,{children:["So what is an npm package type project? When we execute the ",o(e.code,{children:"npm init"})," command in an empty project directory, it creates a JSON file with the file name ",o(e.code,{children:"package.json"})," under the current directory. During the creation process, we will need to fill in information including but not limited to the ",o(e.em,{children:"name"}),", ",o(e.em,{children:"version"})," ",o(e.em,{children:"number"}),", ",o(e.em,{children:"description"}),", etc. of the npm package, which will be found in the resulting ",o(e.code,{children:"package.json"})," file as follows"]}),`
|
|
10
|
+
`,o(t.Code,{codeConfig:r,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"name",props:{style:{color:"#8FBCBB"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:":",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"npm-demo",props:{style:{color:"#A3BE8C"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:",",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"version",props:{style:{color:"#8FBCBB"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:":",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"1.0.0",props:{style:{color:"#A3BE8C"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:",",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"description",props:{style:{color:"#8FBCBB"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:":",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'""',props:{style:{color:"#ECEFF4"}}},{content:",",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"main",props:{style:{color:"#8FBCBB"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:":",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"index.js",props:{style:{color:"#A3BE8C"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:",",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"scripts",props:{style:{color:"#8FBCBB"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:":",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"{",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"test",props:{style:{color:"#8FBCBB"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:":",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"echo ",props:{style:{color:"#A3BE8C"}}},{content:'\\"',props:{style:{color:"#EBCB8B"}}},{content:"Error: no test specified",props:{style:{color:"#A3BE8C"}}},{content:'\\"',props:{style:{color:"#EBCB8B"}}},{content:" && exit 1",props:{style:{color:"#A3BE8C"}}},{content:'"',props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"},",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"author",props:{style:{color:"#8FBCBB"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:":",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'""',props:{style:{color:"#ECEFF4"}}},{content:",",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"license",props:{style:{color:"#8FBCBB"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:":",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"ISC",props:{style:{color:"#A3BE8C"}}},{content:'"',props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:"}",props:{style:{color:"#ECEFF4"}}}]}],lang:"json"},annotations:[]}]}),`
|
|
11
|
+
`,n(e.p,{children:["At this point the project containing the initialized ",o(e.code,{children:"package.json"})," file is an npm package type project, and you can execute the ",o(e.code,{children:"npm publish"})," command to publish the project to the ",o(e.a,{href:"https://www.npmjs.com/",target:"_blank",rel:"nofollow",children:"npm Registry"}),"."]}),`
|
|
12
|
+
`,n(e.p,{children:["The npm Registry is a ",o(e.a,{href:"https://docs.npmjs.com/about-the-public-npm-registry",target:"_blank",rel:"nofollow",children:"npm package store"})," where developers can not only publish their own npm packages to the npm Registry, but also use npm packages published by other developers through the npm Registry."]}),`
|
|
13
|
+
`,o(e.p,{children:"A quality npm package will be used by more people because it not only saves a lot of code implementation work, but is also less likely to cause problems with the project."}),`
|
|
14
|
+
`,n(e.h2,{id:"using-third-party-npm-packages",children:[o(e.a,{className:"header-anchor","aria-hidden":"true",href:"#using-third-party-npm-packages",children:"#"}),"Using third-party npm packages"]}),`
|
|
15
|
+
`,n(e.p,{children:['When adding a third-party npm package to an initial project, we can call this process "installing dependencies for the project" or "adding dependencies to the project". Before adding dependencies, we need to know one thing in particular -- ',o(e.strong,{children:"the types of packages npm depends on"}),"."]}),`
|
|
16
|
+
`,n(e.ul,{children:[`
|
|
17
|
+
`,n(e.li,{children:[o(e.code,{children:'"dependencies"'}),": a type of package that your application will need in a production environment."]}),`
|
|
18
|
+
`,n(e.li,{children:[o(e.code,{children:'"devDependencies"'}),": another type of package that is only needed for local development and testing."]}),`
|
|
19
|
+
`]}),`
|
|
20
|
+
`,n(e.blockquote,{children:[`
|
|
21
|
+
`,o(e.p,{children:"packages can be understood as third-party npm packages."}),`
|
|
22
|
+
`]}),`
|
|
23
|
+
`,n(e.p,{children:["You can install the packages you need in a ",o(e.strong,{children:"production environment"})," by running ",o(e.code,{children:"npm install npm-package-name"})," or ",o(e.code,{children:"npm add npm-package-name"}),", or you can manually write the packages you need to install and the corresponding ",o(e.a,{href:"https://docs.npmjs.com/about-semantic-versioning",target:"_blank",rel:"nofollow",children:"semantic version"})," in ",o(e.code,{children:'"dependencies"'})," in the ",o(e.code,{children:"package.json"})," file, and run the ",o(e.code,{children:"npm install"})," command to."]}),`
|
|
24
|
+
`,o(t.Code,{codeConfig:r,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"name",props:{style:{color:"#8FBCBB"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:":",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"your-npm-project",props:{style:{color:"#A3BE8C"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:",",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"dependencies",props:{style:{color:"#8FBCBB"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:":",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"{",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"npm-package-name",props:{style:{color:"#8FBCBB"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:":",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"0.1.0",props:{style:{color:"#A3BE8C"}}},{content:'"',props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"},",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:"}",props:{style:{color:"#ECEFF4"}}}]}],lang:"json"},annotations:[]}]}),`
|
|
25
|
+
`,n(e.p,{children:["Similarly, you can install ",o(e.strong,{children:"only packages needed for local development and testing"})," by running ",o(e.code,{children:"npm install npm-package-name --save-dev"})," or ",o(e.code,{children:"npm add npm-package-name --save-dev"}),", or you can manually write the packages to be installed and the corresponding ",o(e.a,{href:"https://docs.npmjs.com/about-semantic-versioning",target:"_blank",rel:"nofollow",children:"semantic version"})," in ",o(e.code,{children:'"devDependencies"'})," in the ",o(e.code,{children:"package.json"})," file, and run the ",o(e.code,{children:"npm install"})," command as follows"]}),`
|
|
26
|
+
`,o(t.Code,{codeConfig:r,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"name",props:{style:{color:"#8FBCBB"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:":",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"your-npm-project",props:{style:{color:"#A3BE8C"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:",",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"devDependencies",props:{style:{color:"#8FBCBB"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:":",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"{",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"npm-package-name",props:{style:{color:"#8FBCBB"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:":",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"0.1.0",props:{style:{color:"#A3BE8C"}}},{content:'"',props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"},",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:"}",props:{style:{color:"#ECEFF4"}}}]}],lang:"json"},annotations:[]}]}),`
|
|
27
|
+
`,o(e.p,{children:n(e.strong,{children:["When installing or using third-party npm packages be sure to determine what they are for and whether they should be placed in ",o(e.code,{children:'"dependencies"'})," or ",o(e.code,{children:'"devDependencies"'})," by distinguishing between their types."]})}),`
|
|
28
|
+
`,n(e.div,{className:"island-directive tip",children:[o(e.p,{className:"island-directive-title",children:"TIP"}),o(e.div,{className:"island-directive-content",children:n(e.p,{children:["In general, packages that need to be used in source code are ",o(e.code,{children:"dependencies"})," dependencies. Unless you are exporting dependent code locally via packaging, in which case it can be treated as a ",o(e.code,{children:"devDependencies"})," dependency."]})})]}),`
|
|
29
|
+
`,n(e.h2,{id:"other-npm-bits-and-pieces-to-know",children:[o(e.a,{className:"header-anchor","aria-hidden":"true",href:"#other-npm-bits-and-pieces-to-know",children:"#"}),"Other npm bits and pieces to know"]}),`
|
|
30
|
+
`,n(e.h3,{id:"program-entry-for-npm-packages",children:[o(e.a,{className:"header-anchor","aria-hidden":"true",href:"#program-entry-for-npm-packages",children:"#"}),"Program entry for npm packages"]}),`
|
|
31
|
+
`,n(e.p,{children:["There is a ",o(e.code,{children:'"main"'})," attribute in ",o(e.code,{children:"package.json"})," that corresponds to a module ID or, more intuitively, a NodeJS file path, which is the main entry point for your application."]}),`
|
|
32
|
+
`,n(e.p,{children:["For example, if your package is named ",o(e.code,{children:"foo"})," and the user installs it, and then executes the ",o(e.code,{children:'require("foo")'})," code, then the file corresponding to the ",o(e.code,{children:'"main"'})," field of the npm package ",o(e.code,{children:"foo"})," will be exported."]}),`
|
|
33
|
+
`,n(e.p,{children:[n(e.strong,{children:["It is recommended to set the ",o(e.code,{children:'"main"'})," field in your npm package"]}),". If ",o(e.code,{children:'"main"'})," is not set, the default entry will be the ",o(e.code,{children:"index.js"})," file in the root of the package."]}),`
|
|
34
|
+
`,n(e.p,{children:["In addition to the ",o(e.code,{children:'"main"'})," attribute, the ",o(e.code,{children:'"module"'})," attribute is usually set. It is similar to the ",o(e.code,{children:'"main"'})," attribute in that it is mainly used in webpack scenarios. webpack reads the npm package entry (file) in most cases in the order ",o(e.strong,{children:'"module" -> "main "'}),"."]}),`
|
|
35
|
+
`,n(e.blockquote,{children:[`
|
|
36
|
+
`,n(e.p,{children:["To learn more about how webpack does this, check out this ",o(e.a,{href:"https://webpack.js.org/configuration/resolve/#resolvemainfields",target:"_blank",rel:"nofollow",children:"link"}),"."]}),`
|
|
37
|
+
`]}),`
|
|
38
|
+
`,n(e.h3,{id:"scripts",children:[o(e.a,{className:"header-anchor","aria-hidden":"true",href:"#scripts",children:"#"}),o(e.code,{children:'"scripts"'})]}),`
|
|
39
|
+
`,n(e.p,{children:["The ",o(e.code,{children:'"scripts"'})," attribute of the ",o(e.code,{children:"package.json"})," file supports a number of built-in scripts and npm-preset lifecycle events, as well as arbitrary scripts."]}),`
|
|
40
|
+
`,n(e.p,{children:["These can be executed by running ",o(e.code,{children:"npm run-script <stage>"})," or simply ",o(e.code,{children:"npm run <stage>"}),"."]}),`
|
|
41
|
+
`,n(e.p,{children:["Name matching ",o(e.a,{href:"https://docs.npmjs.com/cli/v9/using-npm/scripts#pre--post-scripts",target:"_blank",rel:"nofollow",children:"pre and post commands"})," will also be run (e.g. ",o(e.code,{children:"premyscript"}),", ",o(e.code,{children:"myscript"}),", ",o(e.code,{children:"postmyscript"})," )."]}),`
|
|
42
|
+
`,o(t.Code,{codeConfig:r,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"scripts",props:{style:{color:"#8FBCBB"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:":",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"{",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"premyscript",props:{style:{color:"#8FBCBB"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:":",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'""',props:{style:{color:"#ECEFF4"}}},{content:",",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"myscript",props:{style:{color:"#8FBCBB"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:":",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'""',props:{style:{color:"#ECEFF4"}}},{content:",",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"postmyscript",props:{style:{color:"#8FBCBB"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:":",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'""',props:{style:{color:"#ECEFF4"}}},{content:",",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"}",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:"}",props:{style:{color:"#ECEFF4"}}}]}],lang:"json"},annotations:[]}]}),`
|
|
43
|
+
`,n(e.p,{children:["When ",o(e.code,{children:"npm run myscripts"})," is executed, the script corresponding to ",o(e.code,{children:"premyscripts"})," will be executed before it, and the script corresponding to ",o(e.code,{children:"postmyscripts"})," will be executed after it."]}),`
|
|
44
|
+
`,n(e.p,{children:["Script commands from dependencies can be run with ",o(e.code,{children:"npm explore <pkg> -- npm run <stage>"}),"."]}),`
|
|
45
|
+
`,o(e.p,{children:"There are also special lifecycle scripts that occur only under certain circumstances. Here are a few that are usually necessary to know."}),`
|
|
46
|
+
`,n(e.h4,{id:"npm-install",children:[o(e.a,{className:"header-anchor","aria-hidden":"true",href:"#npm-install",children:"#"}),o(e.code,{children:"npm install"})]}),`
|
|
47
|
+
`,n(e.p,{children:["When you run ",o(e.code,{children:"npm install -g <pkg-name>"}),", the following scripts will run."]}),`
|
|
48
|
+
`,n(e.ul,{children:[`
|
|
49
|
+
`,o(e.li,{children:o(e.code,{children:"preinstall"})}),`
|
|
50
|
+
`,o(e.li,{children:o(e.code,{children:"install"})}),`
|
|
51
|
+
`,o(e.li,{children:o(e.code,{children:"postinstall"})}),`
|
|
52
|
+
`,o(e.li,{children:o(e.code,{children:"prepublish"})}),`
|
|
53
|
+
`,o(e.li,{children:o(e.code,{children:"preprepare"})}),`
|
|
54
|
+
`,o(e.li,{children:o(e.code,{children:"prepare"})}),`
|
|
55
|
+
`,o(e.li,{children:o(e.code,{children:"postprepare"})}),`
|
|
56
|
+
`]}),`
|
|
57
|
+
`,n(e.p,{children:["If your package root has a ",o(e.code,{children:"binding.gyp"})," file and you don't define an ",o(e.code,{children:"install"})," or ",o(e.code,{children:"preinstall"})," script, then npm will build with ",o(e.code,{children:"node-gyp rebuild"})," as the default install command, using ",o(e.a,{href:"https://github.com/nodejs/node-gyp",target:"_blank",rel:"nofollow",children:"node-gyp"}),"."]}),`
|
|
58
|
+
`,n(e.h4,{id:"npm-publish",children:[o(e.a,{className:"header-anchor","aria-hidden":"true",href:"#npm-publish",children:"#"}),o(e.code,{children:"npm publish"})]}),`
|
|
59
|
+
`,o(e.p,{children:"When publishing a project, executing this command will trigger the following script."}),`
|
|
60
|
+
`,n(e.ul,{children:[`
|
|
61
|
+
`,o(e.li,{children:o(e.code,{children:"prepublishOnly"})}),`
|
|
62
|
+
`,o(e.li,{children:o(e.code,{children:"prepack"})}),`
|
|
63
|
+
`,o(e.li,{children:o(e.code,{children:"prepare"})}),`
|
|
64
|
+
`,o(e.li,{children:o(e.code,{children:"postpack"})}),`
|
|
65
|
+
`,o(e.li,{children:o(e.code,{children:"publish"})}),`
|
|
66
|
+
`,o(e.li,{children:o(e.code,{children:"postpublish"})}),`
|
|
67
|
+
`]}),`
|
|
68
|
+
`,n(e.p,{children:["When running in ",o(e.a,{href:"https://docs.npmjs.com/cli/v7/commands/npm-publish#dry-run",target:"_blank",rel:"nofollow",children:o(e.code,{children:"-dry-run"})})," mode, the script corresponding to ",o(e.code,{children:"prepare"})," will not be executed."]}),`
|
|
69
|
+
`,n(e.h3,{id:"peerdependencies",children:[o(e.a,{className:"header-anchor","aria-hidden":"true",href:"#peerdependencies",children:"#"}),"peerDependencies"]}),`
|
|
70
|
+
`,o(e.p,{children:"In some cases, your npm project has a compatibility relationship with its host tool or library (e.g. a webpack plugin project and webpack), and your npm project does not want to use the host as a necessary dependency, which usually means that your project is probably a plugin for that host tool or library. Your npm project will have certain requirements for the version of the host package, as only the APIs required by the npm project will be exposed under a specific version."}),`
|
|
71
|
+
`,n(e.p,{children:["For more explanation of ",o(e.code,{children:"peerDependencies"}),", you can learn about the different ways npm, pnpm, and Yarn handle it at the following links."]}),`
|
|
72
|
+
`,n(e.ul,{children:[`
|
|
73
|
+
`,o(e.li,{children:o(e.a,{href:"https://docs.npmjs.com/cli/v9/configuring-npm/package-json#peerdependencies",target:"_blank",rel:"nofollow",children:"npm's explanation of peerDependencies"})}),`
|
|
74
|
+
`,o(e.li,{children:o(e.a,{href:"https://pnpm.io/feature-comparison",target:"_blank",rel:"nofollow",children:"pnpm vs npm vs Yarn"})}),`
|
|
75
|
+
`]}),`
|
|
76
|
+
`,n(e.h2,{id:"npm-package-manager",children:[o(e.a,{className:"header-anchor","aria-hidden":"true",href:"#npm-package-manager",children:"#"}),"npm package manager"]}),`
|
|
77
|
+
`,n(e.p,{children:["In addition to the standard package manager like npm, the mainstream ones are ",o(e.strong,{children:"pnpm"})," and ",o(e.strong,{children:"Yarn"}),", both of which are good alternatives to npm cli."]}),`
|
|
78
|
+
`,n(e.p,{children:["It is recommended to use ",o(e.a,{href:"https://pnpm.io/installation",target:"_blank",rel:"nofollow",children:"pnpm"})," to manage project dependencies, which can be installed as follows."]}),`
|
|
79
|
+
`,o(t.Code,{codeConfig:r,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"npm install -g pnpm",props:{style:{color:"#D8DEE9FF"}}}]}],lang:"bash"},annotations:[]}]}),`
|
|
80
|
+
`,n(e.h2,{id:"module-tools-configuration-file",children:[o(e.a,{className:"header-anchor","aria-hidden":"true",href:"#module-tools-configuration-file",children:"#"}),"Module Tools configuration file"]}),`
|
|
81
|
+
`,n(e.p,{children:["A configuration file for Module Tools is provided in the initial module project directory -- ",o(e.code,{children:"modern.config.(j|t)s"}),". By default, no configuration is required, so the ",o(e.code,{children:"modern.config"})," configuration file is not required to exist."]}),`
|
|
82
|
+
`,o(e.p,{children:"The contents of the initial configuration file are as follows."}),`
|
|
83
|
+
`,o(t.Code,{codeConfig:r,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"// modern.config.ts",props:{style:{color:"#616E88"}}}]},{tokens:[{content:"import",props:{style:{color:"#81A1C1"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"{",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"defineConfig",props:{style:{color:"#D8DEE9"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"}",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"from",props:{style:{color:"#81A1C1"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"'",props:{style:{color:"#ECEFF4"}}},{content:"@modern-js/module-tools",props:{style:{color:"#A3BE8C"}}},{content:"'",props:{style:{color:"#ECEFF4"}}},{content:";",props:{style:{color:"#81A1C1"}}}]},{tokens:[]},{tokens:[{content:"export",props:{style:{color:"#81A1C1"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"default",props:{style:{color:"#81A1C1"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"defineConfig",props:{style:{color:"#88C0D0"}}},{content:"(",props:{style:{color:"#D8DEE9FF"}}},{content:"{}",props:{style:{color:"#ECEFF4"}}},{content:")",props:{style:{color:"#D8DEE9FF"}}},{content:";",props:{style:{color:"#81A1C1"}}}]}],lang:"typescript"},annotations:[]}]}),`
|
|
84
|
+
`,o(t.Code,{codeConfig:r,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"// modern.config.js",props:{style:{color:"#616E88"}}}]},{tokens:[{content:"const",props:{style:{color:"#81A1C1"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"{",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"defineConfig",props:{style:{color:"#D8DEE9"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"}",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"=",props:{style:{color:"#81A1C1"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"require",props:{style:{color:"#88C0D0"}}},{content:"(",props:{style:{color:"#D8DEE9FF"}}},{content:"'",props:{style:{color:"#ECEFF4"}}},{content:"@modern-js/module-tools",props:{style:{color:"#A3BE8C"}}},{content:"'",props:{style:{color:"#ECEFF4"}}},{content:")",props:{style:{color:"#D8DEE9FF"}}},{content:";",props:{style:{color:"#81A1C1"}}}]},{tokens:[]},{tokens:[{content:"module",props:{style:{color:"#8FBCBB"}}},{content:".",props:{style:{color:"#ECEFF4"}}},{content:"exports",props:{style:{color:"#8FBCBB"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"=",props:{style:{color:"#81A1C1"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"defineConfig",props:{style:{color:"#88C0D0"}}},{content:"(",props:{style:{color:"#D8DEE9FF"}}},{content:"{}",props:{style:{color:"#ECEFF4"}}},{content:")",props:{style:{color:"#D8DEE9FF"}}},{content:";",props:{style:{color:"#81A1C1"}}}]}],lang:"js"},annotations:[]}]}),`
|
|
85
|
+
`,n(e.p,{children:[n(e.strong,{children:["We recommend using the ",o(e.code,{children:"defineConfig"})," function"]}),", but it is not mandatory to use it. So you can also return an object directly in the configuration file: the:"]}),`
|
|
86
|
+
`,o(t.Code,{codeConfig:r,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"// modern.config.ts",props:{style:{color:"#616E88"}}}]},{tokens:[{content:"export",props:{style:{color:"#81A1C1"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"default",props:{style:{color:"#81A1C1"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"{}",props:{style:{color:"#ECEFF4"}}},{content:";",props:{style:{color:"#81A1C1"}}}]}],lang:"typescript"},annotations:[]}]}),`
|
|
87
|
+
`,o(t.Code,{codeConfig:r,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"// modern.config.js",props:{style:{color:"#616E88"}}}]},{tokens:[{content:"module",props:{style:{color:"#8FBCBB"}}},{content:".",props:{style:{color:"#ECEFF4"}}},{content:"exports",props:{style:{color:"#8FBCBB"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"=",props:{style:{color:"#81A1C1"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"{}",props:{style:{color:"#ECEFF4"}}},{content:";",props:{style:{color:"#81A1C1"}}}]}],lang:"js"},annotations:[]}]})]})}function b(i={}){const{wrapper:e}=i.components||{};return e?o(e,Object.assign({},i,{children:o(a,i)})):a(i)}function c(i,e){throw new Error("Expected "+(e?"component":"object")+" `"+i+"` to be defined: you likely forgot to import, pass, or provide it.")}const k="2022/12/15 18:01:48",F='# Before you start\n\n## Environment preparation\n\nIn 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.17.6**. 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.\n## Getting Started with npm\n\nOnce NodeJS is installed, not only can you access the `node` executable from the command line, but you can also execute the `npm` command.\n\nNpm is the standard package manager for NodeJS. It started out as a tool for downloading and managing NodeJS package dependencies, but it has since evolved into a tool for front-end JavaScript.\n\n**If you already know something about usage of npm and npm packages, then you can directly see [npm package manager](/en/guide/before-getting-started#npm-package-manager) section.**\n\n## npm package type project\n\nSo what is an npm package type project? When we execute the `npm init` command in an empty project directory, it creates a JSON file with the file name `package.json` under the current directory. During the creation process, we will need to fill in information including but not limited to the *name*, *version* *number*, *description*, etc. of the npm package, which will be found in the resulting `package.json` file as follows\n\n``` json\n{\n "name": "npm-demo",\n "version": "1.0.0",\n "description": "",\n "main": "index.js",\n "scripts": {\n "test": "echo \\"Error: no test specified\\" && exit 1"\n },\n "author": "",\n "license": "ISC"\n}\n```\n\nAt this point the project containing the initialized `package.json` file is an npm package type project, and you can execute the `npm publish` command to publish the project to the [npm Registry](https://www.npmjs.com/).\n\nThe npm Registry is a [npm package store](https://docs.npmjs.com/about-the-public-npm-registry) where developers can not only publish their own npm packages to the npm Registry, but also use npm packages published by other developers through the npm Registry.\n\nA quality npm package will be used by more people because it not only saves a lot of code implementation work, but is also less likely to cause problems with the project.\n\n## Using third-party npm packages\n\nWhen adding a third-party npm package to an initial project, we can call this process "installing dependencies for the project" or "adding dependencies to the project". Before adding dependencies, we need to know one thing in particular -- **the types of packages npm depends on**.\n\n- `"dependencies"`: a type of package that your application will need in a production environment.\n- `"devDependencies"`: another type of package that is only needed for local development and testing.\n> packages can be understood as third-party npm packages.\n\nYou can install the packages you need in a **production environment** by running `npm install npm-package-name` or `npm add npm-package-name`, or you can manually write the packages you need to install and the corresponding [semantic version](https://docs.npmjs.com/about-semantic-versioning) in `"dependencies"` in the `package.json` file, and run the `npm install` command to.\n\n``` json\n{\n "name": "your-npm-project",\n "dependencies": {\n "npm-package-name": "0.1.0"\n },\n}\n```\n\nSimilarly, you can install **only packages needed for local development and testing** by running `npm install npm-package-name --save-dev` or `npm add npm-package-name --save-dev`, or you can manually write the packages to be installed and the corresponding [semantic version](https://docs.npmjs.com/about-semantic-versioning) in `"devDependencies"` in the `package.json` file, and run the `npm install` command as follows\n\n``` json\n{\n "name": "your-npm-project",\n "devDependencies": {\n "npm-package-name": "0.1.0"\n },\n}\n```\n\n**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.**\n:::tip\nIn 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.\n:::\n\n## Other npm bits and pieces to know\n\n### Program entry for npm packages\n\nThere is a `"main"` attribute in `package.json` that corresponds to a module ID or, more intuitively, a NodeJS file path, which is the main entry point for your application.\n\nFor example, if your package is named `foo` and the user installs it, and then executes the `require("foo")` code, then the file corresponding to the `"main"` field of the npm package `foo` will be exported.\n\n**It is recommended to set the `"main"` field in your npm package**. If `"main"` is not set, the default entry will be the `index.js` file in the root of the package.\n\nIn addition to the `"main"` attribute, the `"module"` attribute is usually set. It is similar to the `"main"` attribute in that it is mainly used in webpack scenarios. webpack reads the npm package entry (file) in most cases in the order **"module" -> "main "**.\n\n> To learn more about how webpack does this, check out this [link](https://webpack.js.org/configuration/resolve/#resolvemainfields).\n\n### `"scripts"`\n\nThe `"scripts"` attribute of the `package.json` file supports a number of built-in scripts and npm-preset lifecycle events, as well as arbitrary scripts.\n\nThese can be executed by running `npm run-script <stage>` or simply `npm run <stage>`.\n\nName matching [pre and post commands](https://docs.npmjs.com/cli/v9/using-npm/scripts#pre--post-scripts) will also be run (e.g. `premyscript`, `myscript`, `postmyscript` ).\n\n``` json\n{\n "scripts": {\n "premyscript": "",\n "myscript": "",\n "postmyscript": "",\n }\n}\n```\n\nWhen `npm run myscripts` is executed, the script corresponding to `premyscripts` will be executed before it, and the script corresponding to `postmyscripts` will be executed after it.\n\nScript commands from dependencies can be run with `npm explore <pkg> -- npm run <stage>`.\n\nThere are also special lifecycle scripts that occur only under certain circumstances. Here are a few that are usually necessary to know.\n\n#### `npm install`\n\nWhen you run `npm install -g <pkg-name>`, the following scripts will run.\n\n- `preinstall`\n- `install`\n- `postinstall`\n- `prepublish`\n- `preprepare`\n- `prepare`\n- `postprepare`\n\nIf your package root has a `binding.gyp` file and you don\'t define an `install` or `preinstall` script, then npm will build with `node-gyp rebuild` as the default install command, using [node-gyp](https://github.com/nodejs/node-gyp).\n\n#### `npm publish`\n\nWhen publishing a project, executing this command will trigger the following script.\n\n- `prepublishOnly`\n- `prepack`\n- `prepare`\n- `postpack`\n- `publish`\n- `postpublish`\n\nWhen running in [`-dry-run`](https://docs.npmjs.com/cli/v7/commands/npm-publish#dry-run) mode, the script corresponding to `prepare` will not be executed.\n\n### peerDependencies\n\nIn some cases, your npm project has a compatibility relationship with its host tool or library (e.g. a webpack plugin project and webpack), and your npm project does not want to use the host as a necessary dependency, which usually means that your project is probably a plugin for that host tool or library. Your npm project will have certain requirements for the version of the host package, as only the APIs required by the npm project will be exposed under a specific version.\n\nFor more explanation of `peerDependencies`, you can learn about the different ways npm, pnpm, and Yarn handle it at the following links.\n\n- [npm\'s explanation of peerDependencies](https://docs.npmjs.com/cli/v9/configuring-npm/package-json#peerdependencies)\n- [pnpm vs npm vs Yarn](https://pnpm.io/feature-comparison)\n\n## npm package manager\n\nIn addition to the standard package manager like npm, the mainstream ones are **pnpm** and **Yarn**, both of which are good alternatives to npm cli.\n\nIt is recommended to use [pnpm](https://pnpm.io/installation) to manage project dependencies, which can be installed as follows.\n\n```bash\nnpm install -g pnpm\n```\n\n## Module Tools configuration file\n\nA configuration file for Module Tools is provided in the initial module project directory -- `modern.config.(j|t)s`. By default, no configuration is required, so the `modern.config` configuration file is not required to exist.\n\nThe contents of the initial configuration file are as follows.\n\n``` typescript\n// modern.config.ts\nimport { defineConfig } from \'@modern-js/module-tools\';\n\nexport default defineConfig({});\n```\n\n``` js\n// modern.config.js\nconst { defineConfig } = require(\'@modern-js/module-tools\');\n\nmodule.exports = defineConfig({});\n```\n\n**We recommend using the `defineConfig` function**, but it is not mandatory to use it. So you can also return an object directly in the configuration file: the:\n\n``` typescript\n// modern.config.ts\nexport default {};\n```\n\n``` js\n// modern.config.js\nmodule.exports = {};\n```\n';export{t as CH,r as chCodeConfig,F as content,b as default,h as frontmatter,k as lastUpdatedTime,y as title,f as toc};
|