@modern-js/module-tools-docs 2.2.0 → 2.3.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/LICENSE +144 -0
- package/docs/en/api/plugin-api/plugin-hooks.md +2 -10
- package/docs/en/guide/advance/in-depth-about-dev-command.md +56 -12
- package/docs/en/guide/basic/before-getting-started.md +4 -14
- package/docs/en/guide/basic/command-preview.md +1 -1
- package/docs/en/guide/basic/modify-output-product.md +6 -2
- package/docs/en/guide/basic/use-micro-generator.md +62 -1
- package/docs/en/guide/basic/using-storybook.mdx +31 -9
- package/docs/en/guide/intro/getting-started.md +17 -8
- package/docs/en/index.md +14 -8
- package/docs/en/plugins/guide/getting-started.mdx +1 -1
- package/docs/zh/api/plugin-api/plugin-hooks.md +2 -10
- package/docs/zh/guide/advance/in-depth-about-dev-command.md +52 -13
- package/docs/zh/guide/basic/before-getting-started.md +4 -14
- package/docs/zh/guide/basic/command-preview.md +2 -2
- package/docs/zh/guide/basic/modify-output-product.md +5 -3
- package/docs/zh/guide/basic/publish-your-project.md +4 -4
- package/docs/zh/guide/basic/test-your-project.mdx +18 -5
- package/docs/zh/guide/basic/use-micro-generator.md +61 -1
- package/docs/zh/guide/basic/using-storybook.mdx +39 -13
- package/docs/zh/guide/intro/getting-started.md +17 -11
- package/docs/zh/index.md +16 -10
- package/docs/zh/plugins/guide/getting-started.mdx +1 -1
- package/modern.config.ts +4 -6
- package/package.json +4 -4
- package/doc_build/api/config/build-config.html +0 -332
- package/doc_build/api/config/build-preset.html +0 -43
- package/doc_build/api/config/design-system.html +0 -103
- package/doc_build/api/config/plugins.html +0 -7
- package/doc_build/api/config/testing.html +0 -21
- package/doc_build/api/index.html +0 -1
- package/doc_build/api/plugin-api/plugin-hooks.html +0 -113
- package/doc_build/en/api/config/build-config.html +0 -316
- package/doc_build/en/api/config/build-preset.html +0 -43
- package/doc_build/en/api/config/design-system.html +0 -117
- package/doc_build/en/api/config/plugins.html +0 -7
- package/doc_build/en/api/config/testing.html +0 -21
- package/doc_build/en/api/index.html +0 -1
- package/doc_build/en/api/plugin-api/plugin-hooks.html +0 -113
- package/doc_build/en/guide/advance/asset.html +0 -25
- package/doc_build/en/guide/advance/build-umd.html +0 -32
- package/doc_build/en/guide/advance/copy.html +0 -42
- package/doc_build/en/guide/advance/external-dependency.html +0 -31
- package/doc_build/en/guide/advance/in-depth-about-build.html +0 -112
- package/doc_build/en/guide/advance/in-depth-about-dev-command.html +0 -12
- package/doc_build/en/guide/advance/theme-config.html +0 -29
- package/doc_build/en/guide/basic/before-getting-started.html +0 -89
- package/doc_build/en/guide/basic/command-preview.html +0 -63
- package/doc_build/en/guide/basic/modify-output-product.html +0 -98
- package/doc_build/en/guide/basic/publish-your-project.html +0 -50
- package/doc_build/en/guide/basic/test-your-project.html +0 -31
- package/doc_build/en/guide/basic/use-micro-generator.html +0 -29
- package/doc_build/en/guide/basic/using-storybook.html +0 -66
- package/doc_build/en/guide/best-practices/components.html +0 -111
- package/doc_build/en/guide/intro/getting-started.html +0 -36
- package/doc_build/en/guide/intro/welcome.html +0 -13
- package/doc_build/en/guide/intro/why-module-engineering-solution.html +0 -9
- package/doc_build/en/index.html +0 -1
- package/doc_build/en/plugins/guide/getting-started.html +0 -15
- package/doc_build/en/plugins/guide/plugin-object.html +0 -14
- package/doc_build/en/plugins/guide/setup-function.html +0 -30
- package/doc_build/en/plugins/official-list/overview.html +0 -3
- package/doc_build/guide/advance/asset.html +0 -25
- package/doc_build/guide/advance/build-umd.html +0 -32
- package/doc_build/guide/advance/copy.html +0 -42
- package/doc_build/guide/advance/external-dependency.html +0 -31
- package/doc_build/guide/advance/in-depth-about-build.html +0 -112
- package/doc_build/guide/advance/in-depth-about-dev-command.html +0 -14
- package/doc_build/guide/advance/theme-config.html +0 -28
- package/doc_build/guide/basic/before-getting-started.html +0 -89
- package/doc_build/guide/basic/command-preview.html +0 -63
- package/doc_build/guide/basic/modify-output-product.html +0 -97
- package/doc_build/guide/basic/publish-your-project.html +0 -52
- package/doc_build/guide/basic/test-your-project.html +0 -32
- package/doc_build/guide/basic/use-micro-generator.html +0 -27
- package/doc_build/guide/basic/using-storybook.html +0 -67
- package/doc_build/guide/best-practices/components.html +0 -111
- package/doc_build/guide/intro/getting-started.html +0 -39
- package/doc_build/guide/intro/welcome.html +0 -13
- package/doc_build/guide/intro/why-module-engineering-solution.html +0 -9
- package/doc_build/index.html +0 -1
- package/doc_build/plugins/guide/getting-started.html +0 -15
- package/doc_build/plugins/guide/plugin-object.html +0 -14
- package/doc_build/plugins/guide/setup-function.html +0 -30
- package/doc_build/plugins/official-list/overview.html +0 -3
- package/doc_build/static/css/main.edaad072.css +0 -1
- package/doc_build/static/js/1607.70af642a.js +0 -2
- package/doc_build/static/js/1607.70af642a.js.LICENSE.txt +0 -23
- package/doc_build/static/js/async/3799.e31e8293.js +0 -1
- package/doc_build/static/js/async/8652.6fbf1cb7.js +0 -1
- package/doc_build/static/js/async/en_api_config_build-config.367a5701.js +0 -1
- package/doc_build/static/js/async/en_api_config_build-preset.0d78b268.js +0 -1
- package/doc_build/static/js/async/en_api_config_design-system.b28d6723.js +0 -1
- package/doc_build/static/js/async/en_api_config_plugins.fc95fb77.js +0 -1
- package/doc_build/static/js/async/en_api_config_testing.8bc7f316.js +0 -1
- package/doc_build/static/js/async/en_api_index.669f0a56.js +0 -1
- package/doc_build/static/js/async/en_api_plugin-api_plugin-hooks.60d0260c.js +0 -1
- package/doc_build/static/js/async/en_guide_advance_asset.5ff1d623.js +0 -1
- package/doc_build/static/js/async/en_guide_advance_build-umd.c254ed46.js +0 -1
- package/doc_build/static/js/async/en_guide_advance_copy.45c0a51d.js +0 -1
- package/doc_build/static/js/async/en_guide_advance_external-dependency.a52d3247.js +0 -1
- package/doc_build/static/js/async/en_guide_advance_in-depth-about-build.51bf3569.js +0 -1
- package/doc_build/static/js/async/en_guide_advance_in-depth-about-dev-command.aec0b4e1.js +0 -1
- package/doc_build/static/js/async/en_guide_advance_theme-config.db0ad9fc.js +0 -1
- package/doc_build/static/js/async/en_guide_basic_before-getting-started.a22fc49a.js +0 -1
- package/doc_build/static/js/async/en_guide_basic_command-preview.1707ed29.js +0 -1
- package/doc_build/static/js/async/en_guide_basic_modify-output-product.ad453d13.js +0 -1
- package/doc_build/static/js/async/en_guide_basic_publish-your-project.08c5112f.js +0 -1
- package/doc_build/static/js/async/en_guide_basic_test-your-project.f5f6b204.js +0 -1
- package/doc_build/static/js/async/en_guide_basic_use-micro-generator.56325139.js +0 -1
- package/doc_build/static/js/async/en_guide_basic_using-storybook.9d721554.js +0 -1
- package/doc_build/static/js/async/en_guide_best-practices_components.45155af9.js +0 -1
- package/doc_build/static/js/async/en_guide_intro_getting-started.f8682be3.js +0 -1
- package/doc_build/static/js/async/en_guide_intro_welcome.9cc45924.js +0 -1
- package/doc_build/static/js/async/en_guide_intro_why-module-engineering-solution.7f2dae5c.js +0 -1
- package/doc_build/static/js/async/en_index.7bd869c4.js +0 -1
- package/doc_build/static/js/async/en_plugins_guide_getting-started.b850249c.js +0 -1
- package/doc_build/static/js/async/en_plugins_guide_plugin-object.bf6c6221.js +0 -1
- package/doc_build/static/js/async/en_plugins_guide_setup-function.80a2bd97.js +0 -1
- package/doc_build/static/js/async/en_plugins_official-list_overview.84e5cea0.js +0 -1
- package/doc_build/static/js/async/zh_api_config_build-config.048fd5ec.js +0 -1
- package/doc_build/static/js/async/zh_api_config_build-preset.7c13584d.js +0 -1
- package/doc_build/static/js/async/zh_api_config_design-system.1eecd474.js +0 -1
- package/doc_build/static/js/async/zh_api_config_plugins.c22dc4be.js +0 -1
- package/doc_build/static/js/async/zh_api_config_testing.a9888eed.js +0 -1
- package/doc_build/static/js/async/zh_api_index.22957707.js +0 -1
- package/doc_build/static/js/async/zh_api_plugin-api_plugin-hooks.a4d81bf6.js +0 -1
- package/doc_build/static/js/async/zh_guide_advance_asset.5b936003.js +0 -1
- package/doc_build/static/js/async/zh_guide_advance_build-umd.b6d541ff.js +0 -1
- package/doc_build/static/js/async/zh_guide_advance_copy.21a1aea4.js +0 -1
- package/doc_build/static/js/async/zh_guide_advance_external-dependency.c7cf5d4b.js +0 -1
- package/doc_build/static/js/async/zh_guide_advance_in-depth-about-build.64e795f3.js +0 -1
- package/doc_build/static/js/async/zh_guide_advance_in-depth-about-dev-command.168ce7dd.js +0 -1
- package/doc_build/static/js/async/zh_guide_advance_theme-config.b9570109.js +0 -1
- package/doc_build/static/js/async/zh_guide_basic_before-getting-started.6b06b54a.js +0 -1
- package/doc_build/static/js/async/zh_guide_basic_command-preview.1199124a.js +0 -1
- package/doc_build/static/js/async/zh_guide_basic_modify-output-product.8ccbc8d1.js +0 -1
- package/doc_build/static/js/async/zh_guide_basic_publish-your-project.bf11b1c4.js +0 -1
- package/doc_build/static/js/async/zh_guide_basic_test-your-project.ae52c47a.js +0 -1
- package/doc_build/static/js/async/zh_guide_basic_use-micro-generator.a091d57d.js +0 -1
- package/doc_build/static/js/async/zh_guide_basic_using-storybook.27829e44.js +0 -1
- package/doc_build/static/js/async/zh_guide_best-practices_components.7454d916.js +0 -1
- package/doc_build/static/js/async/zh_guide_intro_getting-started.a4c00d9a.js +0 -1
- package/doc_build/static/js/async/zh_guide_intro_welcome.71c3fe16.js +0 -1
- package/doc_build/static/js/async/zh_guide_intro_why-module-engineering-solution.6f8b5ff6.js +0 -1
- package/doc_build/static/js/async/zh_index.c19f9dcf.js +0 -1
- package/doc_build/static/js/async/zh_plugins_guide_getting-started.099dfaea.js +0 -1
- package/doc_build/static/js/async/zh_plugins_guide_plugin-object.963289d5.js +0 -1
- package/doc_build/static/js/async/zh_plugins_guide_setup-function.67d07b91.js +0 -1
- package/doc_build/static/js/async/zh_plugins_official-list_overview.a7635714.js +0 -1
- package/doc_build/static/js/lib-lodash.c5845536.js +0 -1
- package/doc_build/static/js/lib-polyfill.b3038509.js +0 -1
- package/doc_build/static/js/lib-react.d41ace5e.js +0 -2
- package/doc_build/static/js/lib-react.d41ace5e.js.LICENSE.txt +0 -29
- package/doc_build/static/js/main.2d3257a4.js +0 -1
- package/doc_build/static/search_index.json +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_modern_js_module_tools_docs=self.webpackChunk_modern_js_module_tools_docs||[]).push([[775],{93141:function(e,o,n){n.r(o),n.d(o,{CH:function(){return s},chCodeConfig:function(){return c},content:function(){return p},frontmatter:function(){return i},title:function(){return d},toc:function(){return a}});var t=n(97458),r=n(53799);const s={annotations:r.ds,Code:r.EK},c={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,skipLanguages:[],filepath:"/Users/bytedance/modern.js/website/module-tools/docs/zh/guide/basic/before-getting-started.md"},i={sidebar_position:1},a=[{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}],d="\u5f00\u59cb\u4e4b\u524d",p='"---\\nsidebar_position: 1\\n---\\n\\n# \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.18.0**\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\\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](/guide/basic/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\\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\u901a\u8fc7`@modern-js/create`\u521b\u5efa\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\u4f46 `modern.config` \u914d\u7f6e\u6587\u4ef6\u4e0d\u662f\u5fc5\u987b\u5b58\u5728\u7684\u3002\\n\\n\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u751f\u6210\u7684\u914d\u7f6e\u6587\u4ef6\u7684\u5185\u5bb9\u5982\u4e0b\uff1a\\n\\n```typescript\\n// modern.config.ts\\nimport moduleTools, { defineConfig } from \'@modern-js/module-tools\';\\n\\nexport default defineConfig({\\n plugins: [moduleTools()],\\n buildPreset: \'npm-library\',\\n});\\n```\\n\\n```js\\n// modern.config.js\\nimport moduleTools from \'@modern-js/module-tools\';\\n\\nexport default {\\n plugins: [moduleTools()],\\n buildPreset: \'npm-library\',\\n};\\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\\nexport default {};\\n```\\n"';function l(e){const o=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"},e.components);return s||u("CH",!1),s.Code||u("CH.Code",!0),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(o.h1,{id:"\u5f00\u59cb\u4e4b\u524d",children:[(0,t.jsx)(o.a,{className:"header-anchor","aria-hidden":"true",href:"#\u5f00\u59cb\u4e4b\u524d",children:"#"}),"\u5f00\u59cb\u4e4b\u524d"]}),"\n",(0,t.jsxs)(o.h2,{id:"\u73af\u5883\u51c6\u5907",children:[(0,t.jsx)(o.a,{className:"header-anchor","aria-hidden":"true",href:"#\u73af\u5883\u51c6\u5907",children:"#"}),"\u73af\u5883\u51c6\u5907"]}),"\n",(0,t.jsxs)(o.p,{children:["\u4e3a\u4e86\u4f7f\u7528 Modern.js \u6a21\u5757\u5de5\u7a0b\u89e3\u51b3\u65b9\u6848\uff0c\u9996\u5148\u9700\u8981 ",(0,t.jsx)(o.a,{href:"https://nodejs.org/zh/",target:"_blank",rel:"nofollow",children:"NodeJS"}),"\uff0c\u6211\u4eec\u63a8\u8350\u6700\u65b0\u7684",(0,t.jsx)(o.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 ",(0,t.jsx)(o.strong,{children:"14.18.0"}),"\u3002\u56e0\u4e3a\u975e\u7a33\u5b9a\u7684 NodeJS \u65f6\u5e38\u6709\u4e00\u4e9b Bug\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528 ",(0,t.jsx)(o.a,{href:"https://github.com/coreybutler/nvm-windows",target:"_blank",rel:"nofollow",children:"nvm-windows"})," \u548c ",(0,t.jsx)(o.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"]}),"\n",(0,t.jsxs)(o.h2,{id:"\u521d\u8bc6-npm",children:[(0,t.jsx)(o.a,{className:"header-anchor","aria-hidden":"true",href:"#\u521d\u8bc6-npm",children:"#"}),"\u521d\u8bc6 npm"]}),"\n",(0,t.jsxs)(o.p,{children:["\u5f53 NodeJS \u88ab\u5b89\u88c5\u540e\uff0c\u4f60\u4e0d\u4ec5\u53ef\u4ee5\u5728\u547d\u4ee4\u884c\u4e2d\u8bbf\u95ee ",(0,t.jsx)(o.code,{children:"node"})," \u53ef\u6267\u884c\u7a0b\u5e8f\uff0c\u540c\u65f6\u4f60\u4e5f\u53ef\u4ee5\u6267\u884c ",(0,t.jsx)(o.code,{children:"npm"})," \u547d\u4ee4\u3002"]}),"\n",(0,t.jsx)(o.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"}),"\n",(0,t.jsx)(o.p,{children:(0,t.jsxs)(o.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",(0,t.jsx)(o.a,{href:"/module-tools/guide/basic/before-getting-started.html#npm-%E5%8C%85%E7%AE%A1%E7%90%86%E5%99%A8-1",children:"\u3010npm \u5305\u7ba1\u7406\u5668\u3011"}),"\u90e8\u5206\u3002"]})}),"\n",(0,t.jsxs)(o.h2,{id:"npm-\u5305\u7c7b\u578b\u9879\u76ee",children:[(0,t.jsx)(o.a,{className:"header-anchor","aria-hidden":"true",href:"#npm-\u5305\u7c7b\u578b\u9879\u76ee",children:"#"}),"npm \u5305\u7c7b\u578b\u9879\u76ee"]}),"\n",(0,t.jsxs)(o.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 ",(0,t.jsx)(o.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 ",(0,t.jsx)(o.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 ",(0,t.jsx)(o.code,{children:"package.json"})," \u6587\u4ef6\u4e2d\u627e\u5230\uff1a"]}),"\n",(0,t.jsx)(s.Code,{codeConfig:c,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:[]}]}),"\n",(0,t.jsxs)(o.p,{children:["\u6b64\u65f6\u8fd9\u4e2a\u5305\u542b\u4e86\u521d\u59cb\u5316\u540e\u7684 ",(0,t.jsx)(o.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 ",(0,t.jsx)(o.code,{children:"npm publish"})," \u547d\u4ee4\u5c06\u8fd9\u4e2a\u9879\u76ee\u53d1\u5e03\u5230 ",(0,t.jsx)(o.a,{href:"https://www.npmjs.com/",target:"_blank",rel:"nofollow",children:"npm Registry"}),"\u3002"]}),"\n",(0,t.jsxs)(o.p,{children:["npm Registry \u662f\u4e00\u4e2a ",(0,t.jsx)(o.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"]}),"\n",(0,t.jsx)(o.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"}),"\n",(0,t.jsxs)(o.h2,{id:"\u4f7f\u7528\u7b2c\u4e09\u65b9-npm-\u5305",children:[(0,t.jsx)(o.a,{className:"header-anchor","aria-hidden":"true",href:"#\u4f7f\u7528\u7b2c\u4e09\u65b9-npm-\u5305",children:"#"}),"\u4f7f\u7528\u7b2c\u4e09\u65b9 npm \u5305"]}),"\n",(0,t.jsxs)(o.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 ",(0,t.jsx)(o.strong,{children:"npm \u4f9d\u8d56\u7684\u8f6f\u4ef6\u5305\u7c7b\u578b"}),"\uff1a"]}),"\n",(0,t.jsxs)(o.ul,{children:["\n",(0,t.jsxs)(o.li,{children:[(0,t.jsx)(o.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"]}),"\n",(0,t.jsxs)(o.li,{children:[(0,t.jsx)(o.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","\n",(0,t.jsxs)(o.blockquote,{children:["\n",(0,t.jsx)(o.p,{children:"\u8f6f\u4ef6\u5305\u53ef\u4ee5\u7406\u89e3\u4e3a\u662f\u7b2c\u4e09\u65b9\u7684 npm \u5305\u3002"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,t.jsxs)(o.p,{children:["\u4f60\u53ef\u4ee5\u901a\u8fc7\u6267\u884c ",(0,t.jsx)(o.code,{children:"npm install npm-package-name"})," \u6216\u8005 ",(0,t.jsx)(o.code,{children:"npm add npm-package-name"})," \u7684\u65b9\u5f0f\u6765\u5b89\u88c5\u5728",(0,t.jsx)(o.strong,{children:"\u751f\u4ea7\u73af\u5883\u4e2d\u9700\u8981\u7684\u8f6f\u4ef6\u5305"}),"\uff0c\u6216\u8005\u4e5f\u53ef\u4ee5\u5728 ",(0,t.jsx)(o.code,{children:"package.json"})," \u6587\u4ef6\u4e2d\u624b\u52a8\u7684\u5c06\u9700\u8981\u5b89\u88c5\u7684\u5305\u548c\u5bf9\u5e94\u7684",(0,t.jsx)(o.a,{href:"https://docs.npmjs.com/about-semantic-versioning",target:"_blank",rel:"nofollow",children:"\u8bed\u4e49\u5316\u7248\u672c"}),"\u5199\u5728 ",(0,t.jsx)(o.code,{children:'"dependencies"'})," \u91cc\uff0c\u5e76\u6267\u884c ",(0,t.jsx)(o.code,{children:"npm install"})," \u547d\u4ee4\uff1a"]}),"\n",(0,t.jsx)(s.Code,{codeConfig:c,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:[]}]}),"\n",(0,t.jsxs)(o.p,{children:["\u540c\u7406\uff0c\u4f60\u4e5f\u53ef\u4ee5\u6267\u884c ",(0,t.jsx)(o.code,{children:"npm install npm-package-name --save-dev"})," \u6216 ",(0,t.jsx)(o.code,{children:"npm add npm-package-name --save-dev"})," \u7684\u65b9\u5f0f\u6765\u5b89\u88c5",(0,t.jsx)(o.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 ",(0,t.jsx)(o.code,{children:"package.json"})," \u6587\u4ef6\u4e2d\u624b\u52a8\u7684\u5c06\u9700\u8981\u5b89\u88c5\u7684\u5305\u548c\u5bf9\u5e94\u7684",(0,t.jsx)(o.a,{href:"https://docs.npmjs.com/about-semantic-versioning",target:"_blank",rel:"nofollow",children:"\u8bed\u4e49\u5316\u7248\u672c"}),"\u5199\u5728 ",(0,t.jsx)(o.code,{children:'"devDependencies"'})," \u91cc\uff0c\u5e76\u6267\u884c ",(0,t.jsx)(o.code,{children:"npm install"})," \u547d\u4ee4\uff1a"]}),"\n",(0,t.jsx)(s.Code,{codeConfig:c,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:[]}]}),"\n",(0,t.jsx)(o.p,{children:(0,t.jsxs)(o.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 ",(0,t.jsx)(o.code,{children:'"dependencies"'})," \u8fd8\u662f ",(0,t.jsx)(o.code,{children:'"devDependencies"'})," \u4e2d\u3002"]})}),"\n",(0,t.jsxs)(o.div,{className:"modern-directive tip",children:[(0,t.jsx)(o.p,{className:"modern-directive-title",children:"TIP"}),(0,t.jsx)(o.div,{className:"modern-directive-content",children:(0,t.jsxs)(o.p,{children:["\n\u4e00\u822c\u6765\u8bf4\uff0c\u9700\u8981\u5728\u6e90\u4ee3\u7801\u4e2d\u4f7f\u7528\u5230\u7684\u5305\u90fd\u5c5e\u4e8e ",(0,t.jsx)(o.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 ",(0,t.jsx)(o.code,{children:"devDependencies"}),"\u4f9d\u8d56\u3002"]})})]}),"\n",(0,t.jsxs)(o.h2,{id:"\u8fd8\u9700\u8981\u4e86\u89e3\u7684-npm-\u96f6\u788e\u77e5\u8bc6",children:[(0,t.jsx)(o.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"]}),"\n",(0,t.jsxs)(o.h3,{id:"npm-\u5305\u7684\u7a0b\u5e8f\u5165\u53e3",children:[(0,t.jsx)(o.a,{className:"header-anchor","aria-hidden":"true",href:"#npm-\u5305\u7684\u7a0b\u5e8f\u5165\u53e3",children:"#"}),"npm \u5305\u7684\u7a0b\u5e8f\u5165\u53e3"]}),"\n",(0,t.jsxs)(o.p,{children:["\u5728 ",(0,t.jsx)(o.code,{children:"package.json"})," \u4e2d\u5b58\u5728\u4e00\u4e2a ",(0,t.jsx)(o.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"]}),"\n",(0,t.jsxs)(o.p,{children:["\u4f8b\u5982\u4f60\u7684\u5305\u540d\u4e3a ",(0,t.jsx)(o.code,{children:"foo"}),"\uff0c\u5e76\u4e14\u7528\u6237\u5b89\u88c5\u4e86\u5b83\uff0c\u7136\u540e\u6267\u884c ",(0,t.jsx)(o.code,{children:'require("foo")'})," \u4ee3\u7801\uff0c\u90a3\u4e48 ",(0,t.jsx)(o.code,{children:"foo"})," \u8fd9\u4e2a npm \u5305\u7684 ",(0,t.jsx)(o.code,{children:'"main"'})," \u5b57\u6bb5\u5bf9\u5e94\u7684\u6587\u4ef6\u5c06\u4f1a\u88ab\u5bfc\u51fa\u3002"]}),"\n",(0,t.jsxs)(o.p,{children:[(0,t.jsxs)(o.strong,{children:["\u63a8\u8350\u5728\u4f60\u7684 npm \u5305\u91cc\u4e00\u5b9a\u8981\u8bbe\u7f6e ",(0,t.jsx)(o.code,{children:'"main"'})," \u5b57\u6bb5"]}),"\u3002\u5982\u679c\u6ca1\u6709\u8bbe\u7f6e ",(0,t.jsx)(o.code,{children:'"main"'}),"\uff0c\u5219\u9ed8\u8ba4\u5165\u53e3\u4e3a\u5305\u7684\u6839\u76ee\u5f55\u4e0b\u7684 ",(0,t.jsx)(o.code,{children:"index.js"})," \u6587\u4ef6\u3002"]}),"\n",(0,t.jsxs)(o.p,{children:["\u9664\u4e86\u9700\u8981\u8bbe\u7f6e ",(0,t.jsx)(o.code,{children:'"main"'})," \u5c5e\u6027\u4ee5\u5916\uff0c\u4e00\u822c\u8fd8\u4f1a\u8bbe\u7f6e ",(0,t.jsx)(o.code,{children:'"module"'})," \u5c5e\u6027\u3002\u5b83\u4e0e ",(0,t.jsx)(o.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 ",(0,t.jsx)(o.strong,{children:'"module" -> "main"'})," \u8fd9\u4e2a\u987a\u5e8f\u8bfb\u53d6 npm \u5305\u7684\u5165\u53e3\uff08\u6587\u4ef6\uff09\u3002"]}),"\n",(0,t.jsxs)(o.blockquote,{children:["\n",(0,t.jsxs)(o.p,{children:["\u60f3\u8981\u4e86\u89e3\u5173\u4e8e webpack \u5982\u4f55\u505a\u8fd9\u4ef6\u4e8b\uff0c\u53ef\u4ee5\u67e5\u770b\u8fd9\u4e2a",(0,t.jsx)(o.a,{href:"https://webpack.js.org/configuration/resolve/#resolvemainfields-2",target:"_blank",rel:"nofollow",children:"\u94fe\u63a5"}),"\u3002"]}),"\n"]}),"\n",(0,t.jsxs)(o.h3,{id:"scripts",children:[(0,t.jsx)(o.a,{className:"header-anchor","aria-hidden":"true",href:"#scripts",children:"#"}),(0,t.jsx)(o.code,{children:'"scripts"'})]}),"\n",(0,t.jsxs)(o.p,{children:[(0,t.jsx)(o.code,{children:"package.json"})," \u6587\u4ef6\u7684 ",(0,t.jsx)(o.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"]}),"\n",(0,t.jsxs)(o.p,{children:["\u8fd9\u4e9b\u90fd\u53ef\u4ee5\u901a\u8fc7\u8fd0\u884c ",(0,t.jsx)(o.code,{children:"npm run-script <stage>"})," \u6216\u7b80\u79f0 ",(0,t.jsx)(o.code,{children:"npm run <stage>"})," \u6765\u6267\u884c\u3002"]}),"\n",(0,t.jsxs)(o.p,{children:["\u540d\u79f0\u5339\u914d\u7684",(0,t.jsx)(o.a,{href:"https://docs.npmjs.com/cli/v9/using-npm/scripts#pre--post-scripts-2",target:"_blank",rel:"nofollow",children:"\u524d\u7f6e\u547d\u4ee4\u548c\u540e\u7f6e\u547d\u4ee4"}),"\u4e5f\u4f1a\u88ab\u8fd0\u884c\uff08\u4f8b\u5982 ",(0,t.jsx)(o.code,{children:"premyscript"}),"\u3001",(0,t.jsx)(o.code,{children:"myscript"}),"\u3001",(0,t.jsx)(o.code,{children:"postmyscript"}),"\uff09\u3002"]}),"\n",(0,t.jsx)(s.Code,{codeConfig:c,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"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"}",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:"}",props:{style:{color:"#ECEFF4"}}}]}],lang:"json"},annotations:[]}]}),"\n",(0,t.jsxs)(o.p,{children:["\u5f53\u6267\u884c ",(0,t.jsx)(o.code,{children:"npm run myscripts"})," \u7684\u65f6\u5019\uff0c",(0,t.jsx)(o.code,{children:"premyscripts"})," \u5bf9\u5e94\u7684\u811a\u672c\u4f1a\u5728\u5b83\u4e4b\u524d\u6267\u884c\uff0c",(0,t.jsx)(o.code,{children:"postmyscripts"})," \u5bf9\u5e94\u7684\u811a\u672c\u4f1a\u5728\u5b83\u4e4b\u540e\u6267\u884c\u3002"]}),"\n",(0,t.jsxs)(o.p,{children:["\u6765\u81ea\u4f9d\u8d56\u7684\u811a\u672c\u547d\u4ee4\u53ef\u4ee5\u7528 ",(0,t.jsx)(o.code,{children:"npm explore <pkg> -- npm run <stage>"})," \u8fd0\u884c\u3002"]}),"\n",(0,t.jsx)(o.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"}),"\n",(0,t.jsxs)(o.h4,{id:"npm-install",children:[(0,t.jsx)(o.a,{className:"header-anchor","aria-hidden":"true",href:"#npm-install",children:"#"}),(0,t.jsx)(o.code,{children:"npm install"})]}),"\n",(0,t.jsxs)(o.p,{children:["\u5f53\u4f60\u8fd0\u884c ",(0,t.jsx)(o.code,{children:"npm install -g <pkg-name>"})," \u65f6\uff0c\u4ee5\u4e0b\u811a\u672c\u4f1a\u8fd0\u884c\u3002"]}),"\n",(0,t.jsxs)(o.ul,{children:["\n",(0,t.jsx)(o.li,{children:(0,t.jsx)(o.code,{children:"preinstall"})}),"\n",(0,t.jsx)(o.li,{children:(0,t.jsx)(o.code,{children:"install"})}),"\n",(0,t.jsx)(o.li,{children:(0,t.jsx)(o.code,{children:"postinstall"})}),"\n",(0,t.jsx)(o.li,{children:(0,t.jsx)(o.code,{children:"prepublish"})}),"\n",(0,t.jsx)(o.li,{children:(0,t.jsx)(o.code,{children:"preprepare"})}),"\n",(0,t.jsx)(o.li,{children:(0,t.jsx)(o.code,{children:"prepare"})}),"\n",(0,t.jsx)(o.li,{children:(0,t.jsx)(o.code,{children:"postprepare"})}),"\n"]}),"\n",(0,t.jsxs)(o.p,{children:["\u5982\u679c\u4f60\u7684\u8f6f\u4ef6\u5305\u6839\u76ee\u5f55\u6709\u4e00\u4e2a ",(0,t.jsx)(o.code,{children:"binding.gyp"})," \u6587\u4ef6\uff0c\u800c\u4f60\u6ca1\u6709\u5b9a\u4e49 ",(0,t.jsx)(o.code,{children:"install"})," \u6216 ",(0,t.jsx)(o.code,{children:"preinstall"})," \u811a\u672c\uff0c\u90a3\u4e48 npm \u5c06\u4ee5 ",(0,t.jsx)(o.code,{children:"node-gyp rebuild"})," \u4f5c\u4e3a\u9ed8\u8ba4\u7684 install \u547d\u4ee4\uff0c\u4f7f\u7528 ",(0,t.jsx)(o.a,{href:"https://github.com/nodejs/node-gyp",target:"_blank",rel:"nofollow",children:"node-gyp"})," \u8fdb\u884c\u7f16\u8bd1\u3002"]}),"\n",(0,t.jsxs)(o.h4,{id:"npm-publish",children:[(0,t.jsx)(o.a,{className:"header-anchor","aria-hidden":"true",href:"#npm-publish",children:"#"}),(0,t.jsx)(o.code,{children:"npm publish"})]}),"\n",(0,t.jsx)(o.p,{children:"\u5f53\u53d1\u5e03\u9879\u76ee\u7684\u65f6\u5019\uff0c\u6267\u884c\u8be5\u547d\u4ee4\u4f1a\u89e6\u53d1\u4ee5\u4e0b\u811a\u672c\uff1a"}),"\n",(0,t.jsxs)(o.ul,{children:["\n",(0,t.jsx)(o.li,{children:(0,t.jsx)(o.code,{children:"prepublishOnly"})}),"\n",(0,t.jsx)(o.li,{children:(0,t.jsx)(o.code,{children:"prepack"})}),"\n",(0,t.jsx)(o.li,{children:(0,t.jsx)(o.code,{children:"prepare"})}),"\n",(0,t.jsx)(o.li,{children:(0,t.jsx)(o.code,{children:"postpack"})}),"\n",(0,t.jsx)(o.li,{children:(0,t.jsx)(o.code,{children:"publish"})}),"\n",(0,t.jsx)(o.li,{children:(0,t.jsx)(o.code,{children:"postpublish"})}),"\n"]}),"\n",(0,t.jsxs)(o.p,{children:["\u5f53\u4ee5 ",(0,t.jsx)(o.a,{href:"https://docs.npmjs.com/cli/v7/commands/npm-publish#dry-run-2",target:"_blank",rel:"nofollow",children:(0,t.jsx)(o.code,{children:"--dry-run"})})," \u6a21\u5f0f\u8fd0\u884c\u7684\u65f6\u5019\uff0c",(0,t.jsx)(o.code,{children:"prepare"})," \u5bf9\u5e94\u7684\u811a\u672c\u5c06\u4e0d\u4f1a\u6267\u884c\u3002"]}),"\n",(0,t.jsxs)(o.h3,{id:"peerdependencies",children:[(0,t.jsx)(o.a,{className:"header-anchor","aria-hidden":"true",href:"#peerdependencies",children:"#"}),"peerDependencies"]}),"\n",(0,t.jsx)(o.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"}),"\n",(0,t.jsxs)(o.p,{children:["\u5173\u4e8e\u66f4\u591a ",(0,t.jsx)(o.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"]}),"\n",(0,t.jsxs)(o.ul,{children:["\n",(0,t.jsx)(o.li,{children:(0,t.jsx)(o.a,{href:"https://docs.npmjs.com/cli/v9/configuring-npm/package-json#peerdependencies-5",target:"_blank",rel:"nofollow",children:"npm \u5bf9 peerDependencies \u7684\u89e3\u91ca"})}),"\n",(0,t.jsx)(o.li,{children:(0,t.jsx)(o.a,{href:"https://pnpm.io/feature-comparison",target:"_blank",rel:"nofollow",children:"pnpm vs npm VS Yarn"})}),"\n"]}),"\n",(0,t.jsxs)(o.h2,{id:"npm-\u5305\u7ba1\u7406\u5668",children:[(0,t.jsx)(o.a,{className:"header-anchor","aria-hidden":"true",href:"#npm-\u5305\u7ba1\u7406\u5668",children:"#"}),"npm \u5305\u7ba1\u7406\u5668"]}),"\n",(0,t.jsxs)(o.p,{children:["\u9664\u4e86 npm \u8fd9\u79cd\u6807\u51c6\u7684\u5305\u7ba1\u7406\u5668\u4ee5\u5916\uff0c\u76ee\u524d\u4e3b\u6d41\u7684\u8fd8\u6709 ",(0,t.jsx)(o.strong,{children:"pnpm"})," \u548c ",(0,t.jsx)(o.strong,{children:"Yarn"}),"\uff0c\u5b83\u4eec\u90fd\u662f\u4e0d\u9519\u7684 npm cli \u66ff\u4ee3\u54c1\u3002"]}),"\n",(0,t.jsxs)(o.p,{children:["\u63a8\u8350\u4f7f\u7528 ",(0,t.jsx)(o.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"]}),"\n",(0,t.jsx)(s.Code,{codeConfig:c,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"npm install -g pnpm",props:{style:{color:"#D8DEE9FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,t.jsxs)(o.h2,{id:"module-tools-\u914d\u7f6e\u6587\u4ef6",children:[(0,t.jsx)(o.a,{className:"header-anchor","aria-hidden":"true",href:"#module-tools-\u914d\u7f6e\u6587\u4ef6",children:"#"}),"Module Tools \u914d\u7f6e\u6587\u4ef6"]}),"\n",(0,t.jsxs)(o.p,{children:["\u901a\u8fc7",(0,t.jsx)(o.code,{children:"@modern-js/create"}),"\u521b\u5efa\u7684\u6a21\u5757\u5de5\u7a0b\u9879\u76ee\u76ee\u5f55\u4e0b\u63d0\u4f9b\u4e86 Module Tools \u7684\u914d\u7f6e\u6587\u4ef6 \u2014\u2014 ",(0,t.jsx)(o.code,{children:"modern.config.(j|t)s"}),"\u3002\u4f46 ",(0,t.jsx)(o.code,{children:"modern.config"})," \u914d\u7f6e\u6587\u4ef6\u4e0d\u662f\u5fc5\u987b\u5b58\u5728\u7684\u3002"]}),"\n",(0,t.jsx)(o.p,{children:"\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u751f\u6210\u7684\u914d\u7f6e\u6587\u4ef6\u7684\u5185\u5bb9\u5982\u4e0b\uff1a"}),"\n",(0,t.jsx)(s.Code,{codeConfig:c,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:"moduleTools",props:{style:{color:"#D8DEE9"}}},{content:",",props:{style:{color:"#ECEFF4"}}},{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"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"plugins",props:{style:{color:"#D8DEE9"}}},{content:":",props:{style:{color:"#ECEFF4"}}},{content:" [",props:{style:{color:"#D8DEE9FF"}}},{content:"moduleTools",props:{style:{color:"#88C0D0"}}},{content:"()]",props:{style:{color:"#D8DEE9FF"}}},{content:",",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"buildPreset",props:{style:{color:"#D8DEE9"}}},{content:":",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"'",props:{style:{color:"#ECEFF4"}}},{content:"npm-library",props:{style:{color:"#A3BE8C"}}},{content:"'",props:{style:{color:"#ECEFF4"}}},{content:",",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:"}",props:{style:{color:"#ECEFF4"}}},{content:")",props:{style:{color:"#D8DEE9FF"}}},{content:";",props:{style:{color:"#81A1C1"}}}]}],lang:"typescript"},annotations:[]}]}),"\n",(0,t.jsx)(s.Code,{codeConfig:c,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"// modern.config.js",props:{style:{color:"#616E88"}}}]},{tokens:[{content:"import",props:{style:{color:"#81A1C1"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"moduleTools",props:{style:{color:"#8FBCBB"}}},{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:"{",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"plugins",props:{style:{color:"#88C0D0"}}},{content:":",props:{style:{color:"#ECEFF4"}}},{content:" [",props:{style:{color:"#D8DEE9FF"}}},{content:"moduleTools",props:{style:{color:"#88C0D0"}}},{content:"()]",props:{style:{color:"#D8DEE9FF"}}},{content:",",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"buildPreset",props:{style:{color:"#88C0D0"}}},{content:":",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"'",props:{style:{color:"#ECEFF4"}}},{content:"npm-library",props:{style:{color:"#A3BE8C"}}},{content:"'",props:{style:{color:"#ECEFF4"}}},{content:",",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:"}",props:{style:{color:"#ECEFF4"}}},{content:";",props:{style:{color:"#81A1C1"}}}]}],lang:"js"},annotations:[]}]}),"\n",(0,t.jsxs)(o.p,{children:[(0,t.jsxs)(o.strong,{children:["\u6211\u4eec\u63a8\u8350\u4f7f\u7528 ",(0,t.jsx)(o.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"]}),"\n",(0,t.jsx)(s.Code,{codeConfig:c,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:[]}]}),"\n",(0,t.jsx)(s.Code,{codeConfig:c,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"// modern.config.js",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:"js"},annotations:[]}]})]})}function u(e,o){throw new Error("Expected "+(o?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}o.default=function(e={}){const{wrapper:o}=e.components||{};return o?(0,t.jsx)(o,Object.assign({},e,{children:(0,t.jsx)(l,e)})):l(e)}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_modern_js_module_tools_docs=self.webpackChunk_modern_js_module_tools_docs||[]).push([[1756],{7765:function(e,o,t){t.r(o),t.d(o,{CH:function(){return s},chCodeConfig:function(){return c},content:function(){return l},frontmatter:function(){return a},title:function(){return d},toc:function(){return i}});var n=t(97458),r=t(53799);const s={annotations:r.ds,Code:r.EK},c={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,skipLanguages:[],filepath:"/Users/bytedance/modern.js/website/module-tools/docs/zh/guide/basic/command-preview.md"},a={sidebar_position:2},i=[{id:"modern-build",text:"modern build",depth:2},{id:"modern-new",text:"modern new",depth:2},{id:"modern-dev",text:"modern dev",depth:2},{id:"modern-test",text:"modern test",depth:2},{id:"modern-lint",text:"modern lint",depth:2},{id:"modern-change",text:"modern change",depth:2},{id:"modern-pre",text:"modern pre",depth:2},{id:"modern-bump",text:"modern bump",depth:2},{id:"modern-release",text:"modern release",depth:2},{id:"modern-gen-release-note",text:"modern gen-release-note",depth:2},{id:"modern-upgrade",text:"modern upgrade",depth:2}],d="\u547d\u4ee4\u9884\u89c8",l='"---\\nsidebar_position: 2\\n---\\n\\n# \u547d\u4ee4\u9884\u89c8\\n\\n\u6a21\u5757\u5de5\u7a0b\u9879\u76ee\u53ef\u4ee5\u4f7f\u7528\u7684\u547d\u4ee4\uff1a\\n\\n## `modern build`\\n\\n```bash\\nUsage: modern build [options]\\n\\n\u6784\u5efa\u6a21\u5757\u547d\u4ee4\\n\\nOptions:\\n -w, --watch \u4f7f\u7528\u76d1\u542c\u6a21\u5f0f\u6784\u5efa\u4ee3\u7801\\n --tsconfig [tsconfig] \u6307\u5b9a tsconfig.json \u6587\u4ef6\u7684\u8def\u5f84 (default:\\n \\"./tsconfig.json\\")\\n --platform [platform] \u6784\u5efa\u6240\u6709\u6216\u8005\u6307\u5b9a\u5e73\u53f0\u7684\u4ea7\u7269\\n --no-dts \u5173\u95ed DTS \u7c7b\u578b\u6587\u4ef6\u751f\u6210\u548c\u7c7b\u578b\u68c0\u67e5\\n --no-clear \u5173\u95ed\u81ea\u52a8\u6e05\u9664\u4ea7\u7269\u8f93\u51fa\u76ee\u5f55\u7684\u884c\u4e3a\\n -h, --help \u5c55\u793a\u5f53\u524d\u547d\u4ee4\u7684\u4fe1\u606f\\n```\\n\\n\u5f53\u60f3\u8981\u542f\u52a8\u9879\u76ee\u6784\u5efa\u7684\u65f6\u5019\uff0c\u53ef\u4ee5\u6267\u884c `modern build` \u547d\u4ee4\u3002\u5728\u4f7f\u7528\u8fd9\u4e2a\u547d\u4ee4\u7684\u65f6\u5019\uff0c\u6211\u4eec\u53ef\u4ee5\uff1a\\n\\n- \u5f53\u60f3\u8981\u4ee5\u89c2\u5bdf\u6a21\u5f0f\u542f\u52a8\u6784\u5efa\u65f6\uff0c\u4f7f\u7528 `--watch` \u9009\u9879\u3002\\n- \u5f53\u60f3\u8981\u6307\u5b9a\u9879\u76ee\u7f16\u8bd1\u8bfb\u53d6\u7684 TypeScript \u914d\u7f6e\u6587\u4ef6\u7684\u8def\u5f84\u65f6\uff0c\u4f7f\u7528 `build --tsconfig ./path/config.json` \u9009\u9879\u3002\u4f7f\u7528\u8be5\u9009\u9879\u540e\uff0c\u4f1a\u8986\u76d6\u6240\u6709 [`buildConfig`](/api/config/build-config) \u91cc [`dts.tsconfigPath`](/api/config/build-config) \u914d\u7f6e\u3002\\n- \u5f53\u9700\u8981\u5173\u95ed\u9879\u76ee\u7684 DTS \u7c7b\u578b\u6587\u4ef6\u751f\u6210\u548c\u7c7b\u578b\u68c0\u67e5\u884c\u4e3a\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528 `--no-dts` \u9009\u9879\u3002**\u6ce8\u610f\uff1a\u7c7b\u578b\u6587\u4ef6\u7684\u751f\u6210\u4f9d\u8d56\u7c7b\u578b\u68c0\u67e5\u7684\u7ed3\u679c\u3002\u5982\u679c\u5173\u95ed\u4e86\u7c7b\u578b\u68c0\u67e5\uff0c\u90a3\u4e48\u7c7b\u578b\u6587\u4ef6\u4e5f\u4e0d\u4f1a\u751f\u6210**\u3002\\n- \u5f53\u9700\u8981\u5173\u95ed\u81ea\u52a8\u6e05\u9664\u4ea7\u7269\u8f93\u51fa\u76ee\u5f55\u7684\u884c\u4e3a\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528 `--no-clear` \u9009\u9879\u3002\\n\\n\u9664\u4e86\u4ee5\u4e0a\uff0c\u6a21\u5757\u5de5\u7a0b\u8fd8\u652f\u6301 `platform` \u6784\u5efa\u6a21\u5f0f\uff0c\u53ef\u4ee5\u7528\u4e8e\u6267\u884c\u5176\u4ed6\u5de5\u5177\u7684\u6784\u5efa\u4efb\u52a1\u3002\u4f8b\u5982\uff0c\u76ee\u524d\u5b98\u65b9\u652f\u6301\u5728\u5b89\u88c5\u4e86 `@modern-js/plugin-storybook` \u63d2\u4ef6\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u6267\u884c `modern build --platform` \u6216\u8005 `modern build --platform storybook` \u547d\u4ee4\u542f\u52a8 Storybook \u6784\u5efa\u4efb\u52a1\u751f\u6210 Storybook \u4ea7\u7269\u3002\\n\\n:::tip{title=\u6ce8\u610f}\\n\u5728\u6267\u884c Storybook \u6784\u5efa\u7684\u65f6\u5019\uff0c\u5b83\u9700\u8981\u8bfb\u53d6\u9879\u76ee\u7684\u6784\u5efa\u4ea7\u7269\u3002\u56e0\u6b64**\u5728\u6267\u884c `modern build --platform` \u547d\u4ee4\u542f\u52a8 Storybook \u6784\u5efa\u7684\u65f6\u5019\uff0c\u8981\u5148\u6267\u884c\u4e00\u6b21 `modern build` \u786e\u4fdd\u6e90\u7801\u6784\u5efa\u4ea7\u7269\u7684\u5b58\u5728**\u3002\\n:::\\n\\n## `modern new`\\n\\n```bash\\nUsage: modern new [options]\\n\\n\u6a21\u5757\u5316\u5de5\u7a0b\u65b9\u6848\u4e2d\u6267\u884c\u751f\u6210\u5668\\n\\nOptions:\\n -d, --debug \u5f00\u542f Debug \u6a21\u5f0f\uff0c\u6253\u5370\u8c03\u8bd5\u65e5\u5fd7\u4fe1\u606f (default: false)\\n -c, --config <config> \u751f\u6210\u5668\u8fd0\u884c\u9ed8\u8ba4\u914d\u7f6e(JSON \u5b57\u7b26\u4e32)\\n --dist-tag <tag> \u751f\u6210\u5668\u4f7f\u7528\u7279\u6b8a\u7684 npm Tag \u7248\u672c\\n --registry \u751f\u6210\u5668\u8fd0\u884c\u8fc7\u7a0b\u4e2d\u5b9a\u5236 npm Registry\\n -h, --help display help for command\\n```\\n\\n`modern new` \u547d\u4ee4\u7528\u4e8e\u542f\u52a8\u5fae\u751f\u6210\u5668\u529f\u80fd\uff0c\u5b83\u53ef\u4ee5\u4e3a\u9879\u76ee\u542f\u7528\u9ed8\u8ba4\u6ca1\u6709\u63d0\u4f9b\u7684\u529f\u80fd\u3002\\n\\n\u76ee\u524d\u53ef\u4ee5\u5f00\u542f\u7684\u529f\u80fd\u6709\uff1a\\n\\n- Test \u6d4b\u8bd5\\n- Storybook \u8c03\u8bd5\\n- Tailwind CSS \u652f\u6301\\n- Modern.js Runtime API\\n\\n\u5173\u4e8e\u8fd9\u4e9b\u529f\u80fd\uff0c\u53ef\u4ee5\u901a\u8fc7[\u3010\u4f7f\u7528\u5fae\u751f\u6210\u5668\u3011](/guide/basic/use-micro-generator) \u7ae0\u8282\u4e86\u89e3\u66f4\u591a\u3002\\n\\n## `modern dev`\\n\\n```bash\\nUsage: modern dev [options]\\n\\n\u672c\u5730\u5f00\u53d1\u547d\u4ee4\\n\\nOptions:\\n -h, --help display help for command\\n\\nCommands:\\n[dev-tools-subCommand]\\n```\\n\\n\u6a21\u5757\u5de5\u7a0b\u89e3\u51b3\u65b9\u6848\u63d0\u4f9b\u4e86\u4f7f\u7528\u8c03\u8bd5\u5de5\u5177\u7684\u80fd\u529b\uff0c\u53ef\u4ee5\u901a\u8fc7 `modern dev` \u547d\u4ee4\u6765\u542f\u52a8\u3002\u4e0d\u8fc7\u8981\u6ce8\u610f\u7684\u662f\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u662f\u6ca1\u6709\u63d0\u4f9b\u8c03\u8bd5\u76f8\u5173\u7684\u63d2\u4ef6\uff0c\u56e0\u6b64\u6b64\u65f6\u6267\u884c `modern dev` \u4f1a\u63d0\u793a\uff1a _\\"No dev tools found available\\"_\u3002\\n\\n\u76ee\u524d\u5b98\u65b9\u652f\u6301\u7684\u8c03\u8bd5\u5de5\u5177\u6709 [Storybook](https://storybook.js.org/)\uff0c\u56e0\u6b64\u5728\u4f60\u6267\u884c `modern new` \u547d\u4ee4\u5f00\u542f\u5b83\u540e\uff0c\u5c31\u53ef\u4ee5\u6267\u884c `modern dev` \u6216\u8005 `modern dev storybook` \u6267\u884c\u5b83\u3002\\n\\n## `modern test`\\n\\n```bash\\nUsage: modern test [options]\\n\\nOptions:\\n -h, --help display help for command\\n```\\n\\n\u9700\u8981\u5148\u6267\u884c `modern new` \u5f00\u542f\u6d4b\u8bd5\u529f\u80fd\uff0c\u7136\u540e\u624d\u53ef\u4ee5\u6267\u884c `modern test` \u547d\u4ee4\u3002\\n`modern test` \u547d\u4ee4\u4f1a\u81ea\u52a8\u5c06 `src/tests/*.test.(js|ts|jsx|tsx)` \u6587\u4ef6\u5f53\u505a\u6d4b\u8bd5\u7528\u4f8b\u8fd0\u884c\u3002\\n\\n## `modern lint`\\n\\n```bash\\nUsage: modern lint [options] [...files]\\n\\nlint and fix source files\\n\\nOptions:\\n --no-fix disable auto fix source file\\n -h, --help display help for command\\n```\\n\\n\u8fd0\u884c [ESLint](https://eslint.org/) \u68c0\u67e5\u4ee3\u7801\u8bed\u6cd5\u60c5\u51b5\u3002\u901a\u5e38\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u53ea\u9700\u8981\u5728 `git commit` \u9636\u6bb5\u901a\u8fc7 [lint-staged](https://github.com/okonet/lint-staged) \u68c0\u67e5\u672c\u6b21\u63d0\u4ea4\u4fee\u6539\u7684\u90e8\u5206\u4ee3\u7801\u3002\\n\\n- `--no-fix` \u53c2\u6570\u8bbe\u7f6e\u540e\u53ef\u4ee5\u5173\u95ed\u81ea\u52a8\u4fee\u590d lint \u9519\u8bef\u4ee3\u7801\u7684\u80fd\u529b\u3002\\n\\n## `modern change`\\n\\n```bash\\nUsage: modern change [options]\\n\\n\u521b\u5efa\u53d8\u66f4\u96c6\\n\\nOptions:\\n --empty \u521b\u5efa\u7a7a\u53d8\u66f4\u96c6 (default: false)\\n --open \u4f7f\u7528\u7f16\u8f91\u5668\u4e2d\u6253\u5f00\u521b\u5efa\u7684\u53d8\u66f4\u96c6 (default: false)\\n -h, --help display help for command\\n```\\n\\n`modern change` \u547d\u4ee4\u7528\u4e8e\u751f\u6210 [changesets](https://github.com/changesets/changesets) \u9700\u8981\u7684 Markdown \u6587\u4ef6\u3002\\n\\n## `modern pre`\\n\\n```bash\\nUsage: modern pre [options] <enter|exit> [tag]\\n\\n\u8fdb\u5165\u548c\u9000\u51fa\u9884\u53d1\u5e03\u6a21\u5f0f\\n\\nOptions:\\n -h, --help display help for command\\n```\\n\\n\u53ef\u4ee5\u4f7f\u7528 `modern pre` \u547d\u4ee4\u5728\u6b63\u5f0f\u53d1\u5e03\u524d[\u9884\u53d1\u5e03](https://github.com/atlassian/changesets/blob/main/docs/prereleases.md)\u4e00\u4e2a\u7248\u672c\u3002\\n\\n## `modern bump`\\n\\n```bash\\nUsage: modern bump [options]\\n\\n\u4f7f\u7528\u53d8\u66f4\u96c6\u81ea\u52a8\u66f4\u65b0\u53d1\u5e03\u7248\u672c\u548c\u53d8\u66f4\u65e5\u5fd7\\n\\nOptions:\\n --canary \u521b\u5efa\u4e00\u4e2a\u9884\u53d1\u5e03\u7248\u672c\u8fdb\u884c\u6d4b\u8bd5 (default: false)\\n --preid <tag> \u5728\u5bf9\u9884\u53d1\u5e03\u7248\u672c\u8fdb\u884c\u7248\u672c\u63a7\u5236\u65f6\u6307\u5b9a\u6807\u8bc6\u7b26 (default: \\"next\\")\\n --snapshot \u521b\u5efa\u4e00\u4e2a\u7279\u6b8a\u7248\u672c\u8fdb\u884c\u6d4b\u8bd5 (default: false)\\n -h, --help display help for command\\n```\\n\\n\u6309\u7167 [changesets](https://github.com/changesets/changesets) \u751f\u6210\u7684\u53d8\u66f4\u8bb0\u5f55\u7684 Markdown \u6587\u4ef6\u4fee\u6539 `package.json` \u4e2d\u7684\u7248\u672c\u53f7\uff0c \u540c\u65f6\u751f\u6210 `CHANGELOG.md` \u6587\u4ef6\u3002\\n\\n## `modern release`\\n\\n```bash\\nUsage: modern release [options]\\n\\n\u53d1\u5e03 npm \u5305\\n\\nOptions:\\n --tag <tag> \u53d1\u5e03 npm \u5305\u4f7f\u7528\u7279\u5b9a\u7684 tag (default: \\"\\")\\n --ignore-scripts \u53d1\u5e03\u65f6\u5ffd\u7565 package.json \u4e2d\u7684 scripts \u547d\u4ee4\uff0c\u4ec5\u652f\u6301\u5728 pnpm monorepo\\n \u4e2d\u4f7f\u7528 (default: \\"\\")\\n -h, --help display help for command\\n```\\n\\n`modern release` \u547d\u4ee4\u53ef\u4ee5\u5c06\u6a21\u5757\u53d1\u5e03\u5230 [npm Registry](https://www.npmjs.com/) \u4e0a\u3002\\n\\n- `--tag` \u53c2\u6570\u53ef\u4ee5\u6307\u5b9a\u53d1\u5e03\u65f6\u5177\u4f53\u7684 [dist tags](https://docs.npmjs.com/adding-dist-tags-to-packages)\u3002\\n\\n## `modern gen-release-note`\\n\\n```bash\\nUsage: modern gen-release-note [options]\\n\\n\u6839\u636e\u5f53\u524d\u4ed3\u5e93 changeset \u4fe1\u606f\u751f\u6210 Release Note\\n\\nOptions:\\n --repo <repo> \u4ed3\u5e93\u540d\u79f0\uff0c\u7528\u4e8e\u751f\u6210 Pull Request \u94fe\u63a5\uff0c \u4f8b\u5982\uff1a modern-js-dev/modern.js\\n --custom <cumtom> \u81ea\u5b9a\u4e49 Release Note \u751f\u6210\u51fd\u6570\\n -h, --help display help for command\\n```\\n\\n\u6839\u636e\u5f53\u524d\u4ed3\u5e93\u7684 changeset \u4fe1\u606f\u81ea\u52a8\u751f\u6210 [Release Note](https://en.wikipedia.org/wiki/Release_notes)\u3002\\n\\n:::tip{title=\u6ce8\u610f}\\n\u9700\u8981\u5728 `bump` \u547d\u4ee4\u4e4b\u524d\u6267\u884c\u3002\\n:::\\n\\n## `modern upgrade`\\n\\n```bash\\nUsage: modern upgrade [options]\\n\\n\u5347\u7ea7 Modern.js \u5230\u6700\u65b0\u7248\u672c\\n\\nOptions:\\n --registry <registry> \u5b9a\u5236 npm registry (default: \\"\\")\\n -d,--debug \u5f00\u542f Debug \u6a21\u5f0f\uff0c\u6253\u5370\u8c03\u8bd5\u65e5\u5fd7\u4fe1\u606f (default: false)\\n --cwd <cwd> \u9879\u76ee\u8def\u5f84 (default: \\"\\")\\n -h, --help display help for command\\n```\\n\\n`modern upgrade` \u547d\u4ee4\uff0c\u7528\u4e8e\u5347\u7ea7\u9879\u76ee Modern.js \u76f8\u5173\u4f9d\u8d56\u81f3\u6700\u65b0\u7248\u672c\u3002\\n\\n\u5728\u9879\u76ee\u6839\u76ee\u5f55\u4e0b\u6267\u884c\u547d\u4ee4 `npx modern upgrade`\uff0c\u4f1a\u9ed8\u8ba4\u5c06\u5f53\u524d\u6267\u884c\u547d\u4ee4\u9879\u76ee\u7684 `package.json` \u4e2d\u7684 Modern.js \u76f8\u5173\u4f9d\u8d56\u66f4\u65b0\u81f3\u6700\u65b0\u7248\u672c\u3002\\n"';function p(e){const o=Object.assign({h1:"h1",a:"a",p:"p",h2:"h2",code:"code",ul:"ul",li:"li",strong:"strong",div:"div",em:"em"},e.components);return s||u("CH",!1),s.Code||u("CH.Code",!0),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(o.h1,{id:"\u547d\u4ee4\u9884\u89c8",children:[(0,n.jsx)(o.a,{className:"header-anchor","aria-hidden":"true",href:"#\u547d\u4ee4\u9884\u89c8",children:"#"}),"\u547d\u4ee4\u9884\u89c8"]}),"\n",(0,n.jsx)(o.p,{children:"\u6a21\u5757\u5de5\u7a0b\u9879\u76ee\u53ef\u4ee5\u4f7f\u7528\u7684\u547d\u4ee4\uff1a"}),"\n",(0,n.jsxs)(o.h2,{id:"modern-build",children:[(0,n.jsx)(o.a,{className:"header-anchor","aria-hidden":"true",href:"#modern-build",children:"#"}),(0,n.jsx)(o.code,{children:"modern build"})]}),"\n",(0,n.jsx)(s.Code,{codeConfig:c,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"Usage: modern build ",props:{style:{color:"#D8DEE9FF"}}},{content:"[",props:{style:{color:"#ECEFF4"}}},{content:"options",props:{style:{color:"#D8DEE9FF"}}},{content:"]",props:{style:{color:"#ECEFF4"}}}]},{tokens:[]},{tokens:[{content:"\u6784\u5efa\u6a21\u5757\u547d\u4ee4",props:{style:{color:"#D8DEE9FF"}}}]},{tokens:[]},{tokens:[{content:"Options:",props:{style:{color:"#D8DEE9FF"}}}]},{tokens:[{content:" -w, --watch \u4f7f\u7528\u76d1\u542c\u6a21\u5f0f\u6784\u5efa\u4ee3\u7801",props:{style:{color:"#D8DEE9FF"}}}]},{tokens:[{content:" --tsconfig ",props:{style:{color:"#D8DEE9FF"}}},{content:"[",props:{style:{color:"#ECEFF4"}}},{content:"tsconfig",props:{style:{color:"#D8DEE9FF"}}},{content:"]",props:{style:{color:"#ECEFF4"}}},{content:" \u6307\u5b9a tsconfig.json \u6587\u4ef6\u7684\u8def\u5f84 ",props:{style:{color:"#D8DEE9FF"}}},{content:"(",props:{style:{color:"#ECEFF4"}}},{content:"default:",props:{style:{color:"#D8DEE9FF"}}}]},{tokens:[{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"./tsconfig.json",props:{style:{color:"#A3BE8C"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:")",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" --platform ",props:{style:{color:"#D8DEE9FF"}}},{content:"[",props:{style:{color:"#ECEFF4"}}},{content:"platform",props:{style:{color:"#D8DEE9FF"}}},{content:"]",props:{style:{color:"#ECEFF4"}}},{content:" \u6784\u5efa\u6240\u6709\u6216\u8005\u6307\u5b9a\u5e73\u53f0\u7684\u4ea7\u7269",props:{style:{color:"#D8DEE9FF"}}}]},{tokens:[{content:" --no-dts \u5173\u95ed DTS \u7c7b\u578b\u6587\u4ef6\u751f\u6210\u548c\u7c7b\u578b\u68c0\u67e5",props:{style:{color:"#D8DEE9FF"}}}]},{tokens:[{content:" --no-clear \u5173\u95ed\u81ea\u52a8\u6e05\u9664\u4ea7\u7269\u8f93\u51fa\u76ee\u5f55\u7684\u884c\u4e3a",props:{style:{color:"#D8DEE9FF"}}}]},{tokens:[{content:" -h, --help \u5c55\u793a\u5f53\u524d\u547d\u4ee4\u7684\u4fe1\u606f",props:{style:{color:"#D8DEE9FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,n.jsxs)(o.p,{children:["\u5f53\u60f3\u8981\u542f\u52a8\u9879\u76ee\u6784\u5efa\u7684\u65f6\u5019\uff0c\u53ef\u4ee5\u6267\u884c ",(0,n.jsx)(o.code,{children:"modern build"})," \u547d\u4ee4\u3002\u5728\u4f7f\u7528\u8fd9\u4e2a\u547d\u4ee4\u7684\u65f6\u5019\uff0c\u6211\u4eec\u53ef\u4ee5\uff1a"]}),"\n",(0,n.jsxs)(o.ul,{children:["\n",(0,n.jsxs)(o.li,{children:["\u5f53\u60f3\u8981\u4ee5\u89c2\u5bdf\u6a21\u5f0f\u542f\u52a8\u6784\u5efa\u65f6\uff0c\u4f7f\u7528 ",(0,n.jsx)(o.code,{children:"--watch"})," \u9009\u9879\u3002"]}),"\n",(0,n.jsxs)(o.li,{children:["\u5f53\u60f3\u8981\u6307\u5b9a\u9879\u76ee\u7f16\u8bd1\u8bfb\u53d6\u7684 TypeScript \u914d\u7f6e\u6587\u4ef6\u7684\u8def\u5f84\u65f6\uff0c\u4f7f\u7528 ",(0,n.jsx)(o.code,{children:"build --tsconfig ./path/config.json"})," \u9009\u9879\u3002\u4f7f\u7528\u8be5\u9009\u9879\u540e\uff0c\u4f1a\u8986\u76d6\u6240\u6709 ",(0,n.jsx)(o.a,{href:"/module-tools/api/config/build-config.html",children:(0,n.jsx)(o.code,{children:"buildConfig"})})," \u91cc ",(0,n.jsx)(o.a,{href:"/module-tools/api/config/build-config.html",children:(0,n.jsx)(o.code,{children:"dts.tsconfigPath"})})," \u914d\u7f6e\u3002"]}),"\n",(0,n.jsxs)(o.li,{children:["\u5f53\u9700\u8981\u5173\u95ed\u9879\u76ee\u7684 DTS \u7c7b\u578b\u6587\u4ef6\u751f\u6210\u548c\u7c7b\u578b\u68c0\u67e5\u884c\u4e3a\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528 ",(0,n.jsx)(o.code,{children:"--no-dts"})," \u9009\u9879\u3002",(0,n.jsx)(o.strong,{children:"\u6ce8\u610f\uff1a\u7c7b\u578b\u6587\u4ef6\u7684\u751f\u6210\u4f9d\u8d56\u7c7b\u578b\u68c0\u67e5\u7684\u7ed3\u679c\u3002\u5982\u679c\u5173\u95ed\u4e86\u7c7b\u578b\u68c0\u67e5\uff0c\u90a3\u4e48\u7c7b\u578b\u6587\u4ef6\u4e5f\u4e0d\u4f1a\u751f\u6210"}),"\u3002"]}),"\n",(0,n.jsxs)(o.li,{children:["\u5f53\u9700\u8981\u5173\u95ed\u81ea\u52a8\u6e05\u9664\u4ea7\u7269\u8f93\u51fa\u76ee\u5f55\u7684\u884c\u4e3a\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528 ",(0,n.jsx)(o.code,{children:"--no-clear"})," \u9009\u9879\u3002"]}),"\n"]}),"\n",(0,n.jsxs)(o.p,{children:["\u9664\u4e86\u4ee5\u4e0a\uff0c\u6a21\u5757\u5de5\u7a0b\u8fd8\u652f\u6301 ",(0,n.jsx)(o.code,{children:"platform"})," \u6784\u5efa\u6a21\u5f0f\uff0c\u53ef\u4ee5\u7528\u4e8e\u6267\u884c\u5176\u4ed6\u5de5\u5177\u7684\u6784\u5efa\u4efb\u52a1\u3002\u4f8b\u5982\uff0c\u76ee\u524d\u5b98\u65b9\u652f\u6301\u5728\u5b89\u88c5\u4e86 ",(0,n.jsx)(o.code,{children:"@modern-js/plugin-storybook"})," \u63d2\u4ef6\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u6267\u884c ",(0,n.jsx)(o.code,{children:"modern build --platform"})," \u6216\u8005 ",(0,n.jsx)(o.code,{children:"modern build --platform storybook"})," \u547d\u4ee4\u542f\u52a8 Storybook \u6784\u5efa\u4efb\u52a1\u751f\u6210 Storybook \u4ea7\u7269\u3002"]}),"\n",(0,n.jsxs)(o.div,{className:"modern-directive tip",children:[(0,n.jsx)(o.p,{className:"modern-directive-title",children:"\u6ce8\u610f"}),(0,n.jsx)(o.div,{className:"modern-directive-content",children:(0,n.jsxs)(o.p,{children:["\n\u5728\u6267\u884c Storybook \u6784\u5efa\u7684\u65f6\u5019\uff0c\u5b83\u9700\u8981\u8bfb\u53d6\u9879\u76ee\u7684\u6784\u5efa\u4ea7\u7269\u3002\u56e0\u6b64",(0,n.jsxs)(o.strong,{children:["\u5728\u6267\u884c ",(0,n.jsx)(o.code,{children:"modern build --platform"})," \u547d\u4ee4\u542f\u52a8 Storybook \u6784\u5efa\u7684\u65f6\u5019\uff0c\u8981\u5148\u6267\u884c\u4e00\u6b21 ",(0,n.jsx)(o.code,{children:"modern build"})," \u786e\u4fdd\u6e90\u7801\u6784\u5efa\u4ea7\u7269\u7684\u5b58\u5728"]}),"\u3002"]})})]}),"\n",(0,n.jsxs)(o.h2,{id:"modern-new",children:[(0,n.jsx)(o.a,{className:"header-anchor","aria-hidden":"true",href:"#modern-new",children:"#"}),(0,n.jsx)(o.code,{children:"modern new"})]}),"\n",(0,n.jsx)(s.Code,{codeConfig:c,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"Usage: modern new ",props:{style:{color:"#D8DEE9FF"}}},{content:"[",props:{style:{color:"#ECEFF4"}}},{content:"options",props:{style:{color:"#D8DEE9FF"}}},{content:"]",props:{style:{color:"#ECEFF4"}}}]},{tokens:[]},{tokens:[{content:"\u6a21\u5757\u5316\u5de5\u7a0b\u65b9\u6848\u4e2d\u6267\u884c\u751f\u6210\u5668",props:{style:{color:"#D8DEE9FF"}}}]},{tokens:[]},{tokens:[{content:"Options:",props:{style:{color:"#D8DEE9FF"}}}]},{tokens:[{content:" -d, --debug \u5f00\u542f Debug \u6a21\u5f0f\uff0c\u6253\u5370\u8c03\u8bd5\u65e5\u5fd7\u4fe1\u606f ",props:{style:{color:"#D8DEE9FF"}}},{content:"(",props:{style:{color:"#ECEFF4"}}},{content:"default: false",props:{style:{color:"#D8DEE9FF"}}},{content:")",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" -c, --config ",props:{style:{color:"#D8DEE9FF"}}},{content:"<",props:{style:{color:"#81A1C1"}}},{content:"config",props:{style:{color:"#D8DEE9FF"}}},{content:">",props:{style:{color:"#81A1C1"}}},{content:" \u751f\u6210\u5668\u8fd0\u884c\u9ed8\u8ba4\u914d\u7f6e",props:{style:{color:"#D8DEE9FF"}}},{content:"(",props:{style:{color:"#ECEFF4"}}},{content:"JSON \u5b57\u7b26\u4e32",props:{style:{color:"#D8DEE9FF"}}},{content:")",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" --dist-tag ",props:{style:{color:"#D8DEE9FF"}}},{content:"<",props:{style:{color:"#81A1C1"}}},{content:"tag",props:{style:{color:"#D8DEE9FF"}}},{content:">",props:{style:{color:"#81A1C1"}}},{content:" \u751f\u6210\u5668\u4f7f\u7528\u7279\u6b8a\u7684 npm Tag \u7248\u672c",props:{style:{color:"#D8DEE9FF"}}}]},{tokens:[{content:" --registry \u751f\u6210\u5668\u8fd0\u884c\u8fc7\u7a0b\u4e2d\u5b9a\u5236 npm Registry",props:{style:{color:"#D8DEE9FF"}}}]},{tokens:[{content:" -h, --help display ",props:{style:{color:"#D8DEE9FF"}}},{content:"help",props:{style:{color:"#88C0D0"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"for",props:{style:{color:"#81A1C1"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"command",props:{style:{color:"#88C0D0"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,n.jsxs)(o.p,{children:[(0,n.jsx)(o.code,{children:"modern new"})," \u547d\u4ee4\u7528\u4e8e\u542f\u52a8\u5fae\u751f\u6210\u5668\u529f\u80fd\uff0c\u5b83\u53ef\u4ee5\u4e3a\u9879\u76ee\u542f\u7528\u9ed8\u8ba4\u6ca1\u6709\u63d0\u4f9b\u7684\u529f\u80fd\u3002"]}),"\n",(0,n.jsx)(o.p,{children:"\u76ee\u524d\u53ef\u4ee5\u5f00\u542f\u7684\u529f\u80fd\u6709\uff1a"}),"\n",(0,n.jsxs)(o.ul,{children:["\n",(0,n.jsx)(o.li,{children:"Test \u6d4b\u8bd5"}),"\n",(0,n.jsx)(o.li,{children:"Storybook \u8c03\u8bd5"}),"\n",(0,n.jsx)(o.li,{children:"Tailwind CSS \u652f\u6301"}),"\n",(0,n.jsx)(o.li,{children:"Modern.js Runtime API"}),"\n"]}),"\n",(0,n.jsxs)(o.p,{children:["\u5173\u4e8e\u8fd9\u4e9b\u529f\u80fd\uff0c\u53ef\u4ee5\u901a\u8fc7",(0,n.jsx)(o.a,{href:"/module-tools/guide/basic/use-micro-generator.html",children:"\u3010\u4f7f\u7528\u5fae\u751f\u6210\u5668\u3011"})," \u7ae0\u8282\u4e86\u89e3\u66f4\u591a\u3002"]}),"\n",(0,n.jsxs)(o.h2,{id:"modern-dev",children:[(0,n.jsx)(o.a,{className:"header-anchor","aria-hidden":"true",href:"#modern-dev",children:"#"}),(0,n.jsx)(o.code,{children:"modern dev"})]}),"\n",(0,n.jsx)(s.Code,{codeConfig:c,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"Usage: modern dev ",props:{style:{color:"#D8DEE9FF"}}},{content:"[",props:{style:{color:"#ECEFF4"}}},{content:"options",props:{style:{color:"#D8DEE9FF"}}},{content:"]",props:{style:{color:"#ECEFF4"}}}]},{tokens:[]},{tokens:[{content:"\u672c\u5730\u5f00\u53d1\u547d\u4ee4",props:{style:{color:"#D8DEE9FF"}}}]},{tokens:[]},{tokens:[{content:"Options:",props:{style:{color:"#D8DEE9FF"}}}]},{tokens:[{content:" -h, --help display ",props:{style:{color:"#D8DEE9FF"}}},{content:"help",props:{style:{color:"#88C0D0"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"for",props:{style:{color:"#81A1C1"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"command",props:{style:{color:"#88C0D0"}}}]},{tokens:[]},{tokens:[{content:"Commands:",props:{style:{color:"#D8DEE9FF"}}}]},{tokens:[{content:"[",props:{style:{color:"#ECEFF4"}}},{content:"dev-tools-subCommand",props:{style:{color:"#D8DEE9FF"}}},{content:"]",props:{style:{color:"#ECEFF4"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,n.jsxs)(o.p,{children:["\u6a21\u5757\u5de5\u7a0b\u89e3\u51b3\u65b9\u6848\u63d0\u4f9b\u4e86\u4f7f\u7528\u8c03\u8bd5\u5de5\u5177\u7684\u80fd\u529b\uff0c\u53ef\u4ee5\u901a\u8fc7 ",(0,n.jsx)(o.code,{children:"modern dev"})," \u547d\u4ee4\u6765\u542f\u52a8\u3002\u4e0d\u8fc7\u8981\u6ce8\u610f\u7684\u662f\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u662f\u6ca1\u6709\u63d0\u4f9b\u8c03\u8bd5\u76f8\u5173\u7684\u63d2\u4ef6\uff0c\u56e0\u6b64\u6b64\u65f6\u6267\u884c ",(0,n.jsx)(o.code,{children:"modern dev"})," \u4f1a\u63d0\u793a\uff1a ",(0,n.jsx)(o.em,{children:'"No dev tools found available"'}),"\u3002"]}),"\n",(0,n.jsxs)(o.p,{children:["\u76ee\u524d\u5b98\u65b9\u652f\u6301\u7684\u8c03\u8bd5\u5de5\u5177\u6709 ",(0,n.jsx)(o.a,{href:"https://storybook.js.org/",target:"_blank",rel:"nofollow",children:"Storybook"}),"\uff0c\u56e0\u6b64\u5728\u4f60\u6267\u884c ",(0,n.jsx)(o.code,{children:"modern new"})," \u547d\u4ee4\u5f00\u542f\u5b83\u540e\uff0c\u5c31\u53ef\u4ee5\u6267\u884c ",(0,n.jsx)(o.code,{children:"modern dev"})," \u6216\u8005 ",(0,n.jsx)(o.code,{children:"modern dev storybook"})," \u6267\u884c\u5b83\u3002"]}),"\n",(0,n.jsxs)(o.h2,{id:"modern-test",children:[(0,n.jsx)(o.a,{className:"header-anchor","aria-hidden":"true",href:"#modern-test",children:"#"}),(0,n.jsx)(o.code,{children:"modern test"})]}),"\n",(0,n.jsx)(s.Code,{codeConfig:c,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"Usage: modern ",props:{style:{color:"#D8DEE9FF"}}},{content:"test",props:{style:{color:"#88C0D0"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"[",props:{style:{color:"#ECEFF4"}}},{content:"options",props:{style:{color:"#D8DEE9FF"}}},{content:"]",props:{style:{color:"#ECEFF4"}}}]},{tokens:[]},{tokens:[{content:"Options:",props:{style:{color:"#D8DEE9FF"}}}]},{tokens:[{content:" -h, --help display ",props:{style:{color:"#D8DEE9FF"}}},{content:"help",props:{style:{color:"#88C0D0"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"for",props:{style:{color:"#81A1C1"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"command",props:{style:{color:"#88C0D0"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,n.jsxs)(o.p,{children:["\u9700\u8981\u5148\u6267\u884c ",(0,n.jsx)(o.code,{children:"modern new"})," \u5f00\u542f\u6d4b\u8bd5\u529f\u80fd\uff0c\u7136\u540e\u624d\u53ef\u4ee5\u6267\u884c ",(0,n.jsx)(o.code,{children:"modern test"})," \u547d\u4ee4\u3002\n",(0,n.jsx)(o.code,{children:"modern test"})," \u547d\u4ee4\u4f1a\u81ea\u52a8\u5c06 ",(0,n.jsx)(o.code,{children:"src/tests/*.test.(js|ts|jsx|tsx)"})," \u6587\u4ef6\u5f53\u505a\u6d4b\u8bd5\u7528\u4f8b\u8fd0\u884c\u3002"]}),"\n",(0,n.jsxs)(o.h2,{id:"modern-lint",children:[(0,n.jsx)(o.a,{className:"header-anchor","aria-hidden":"true",href:"#modern-lint",children:"#"}),(0,n.jsx)(o.code,{children:"modern lint"})]}),"\n",(0,n.jsx)(s.Code,{codeConfig:c,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"Usage: modern lint ",props:{style:{color:"#D8DEE9FF"}}},{content:"[",props:{style:{color:"#ECEFF4"}}},{content:"options",props:{style:{color:"#D8DEE9FF"}}},{content:"]",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"[",props:{style:{color:"#ECEFF4"}}},{content:"...files",props:{style:{color:"#D8DEE9FF"}}},{content:"]",props:{style:{color:"#ECEFF4"}}}]},{tokens:[]},{tokens:[{content:"lint and fix ",props:{style:{color:"#D8DEE9FF"}}},{content:"source",props:{style:{color:"#88C0D0"}}},{content:" files",props:{style:{color:"#D8DEE9FF"}}}]},{tokens:[]},{tokens:[{content:"Options:",props:{style:{color:"#D8DEE9FF"}}}]},{tokens:[{content:" --no-fix disable auto fix ",props:{style:{color:"#D8DEE9FF"}}},{content:"source",props:{style:{color:"#88C0D0"}}},{content:" file",props:{style:{color:"#D8DEE9FF"}}}]},{tokens:[{content:" -h, --help display ",props:{style:{color:"#D8DEE9FF"}}},{content:"help",props:{style:{color:"#88C0D0"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"for",props:{style:{color:"#81A1C1"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"command",props:{style:{color:"#88C0D0"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,n.jsxs)(o.p,{children:["\u8fd0\u884c ",(0,n.jsx)(o.a,{href:"https://eslint.org/",target:"_blank",rel:"nofollow",children:"ESLint"})," \u68c0\u67e5\u4ee3\u7801\u8bed\u6cd5\u60c5\u51b5\u3002\u901a\u5e38\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u53ea\u9700\u8981\u5728 ",(0,n.jsx)(o.code,{children:"git commit"})," \u9636\u6bb5\u901a\u8fc7 ",(0,n.jsx)(o.a,{href:"https://github.com/okonet/lint-staged",target:"_blank",rel:"nofollow",children:"lint-staged"})," \u68c0\u67e5\u672c\u6b21\u63d0\u4ea4\u4fee\u6539\u7684\u90e8\u5206\u4ee3\u7801\u3002"]}),"\n",(0,n.jsxs)(o.ul,{children:["\n",(0,n.jsxs)(o.li,{children:[(0,n.jsx)(o.code,{children:"--no-fix"})," \u53c2\u6570\u8bbe\u7f6e\u540e\u53ef\u4ee5\u5173\u95ed\u81ea\u52a8\u4fee\u590d lint \u9519\u8bef\u4ee3\u7801\u7684\u80fd\u529b\u3002"]}),"\n"]}),"\n",(0,n.jsxs)(o.h2,{id:"modern-change",children:[(0,n.jsx)(o.a,{className:"header-anchor","aria-hidden":"true",href:"#modern-change",children:"#"}),(0,n.jsx)(o.code,{children:"modern change"})]}),"\n",(0,n.jsx)(s.Code,{codeConfig:c,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"Usage: modern change ",props:{style:{color:"#D8DEE9FF"}}},{content:"[",props:{style:{color:"#ECEFF4"}}},{content:"options",props:{style:{color:"#D8DEE9FF"}}},{content:"]",props:{style:{color:"#ECEFF4"}}}]},{tokens:[]},{tokens:[{content:"\u521b\u5efa\u53d8\u66f4\u96c6",props:{style:{color:"#D8DEE9FF"}}}]},{tokens:[]},{tokens:[{content:"Options:",props:{style:{color:"#D8DEE9FF"}}}]},{tokens:[{content:" --empty \u521b\u5efa\u7a7a\u53d8\u66f4\u96c6 ",props:{style:{color:"#D8DEE9FF"}}},{content:"(",props:{style:{color:"#ECEFF4"}}},{content:"default: false",props:{style:{color:"#D8DEE9FF"}}},{content:")",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" --open \u4f7f\u7528\u7f16\u8f91\u5668\u4e2d\u6253\u5f00\u521b\u5efa\u7684\u53d8\u66f4\u96c6 ",props:{style:{color:"#D8DEE9FF"}}},{content:"(",props:{style:{color:"#ECEFF4"}}},{content:"default: false",props:{style:{color:"#D8DEE9FF"}}},{content:")",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" -h, --help display ",props:{style:{color:"#D8DEE9FF"}}},{content:"help",props:{style:{color:"#88C0D0"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"for",props:{style:{color:"#81A1C1"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"command",props:{style:{color:"#88C0D0"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,n.jsxs)(o.p,{children:[(0,n.jsx)(o.code,{children:"modern change"})," \u547d\u4ee4\u7528\u4e8e\u751f\u6210 ",(0,n.jsx)(o.a,{href:"https://github.com/changesets/changesets",target:"_blank",rel:"nofollow",children:"changesets"})," \u9700\u8981\u7684 Markdown \u6587\u4ef6\u3002"]}),"\n",(0,n.jsxs)(o.h2,{id:"modern-pre",children:[(0,n.jsx)(o.a,{className:"header-anchor","aria-hidden":"true",href:"#modern-pre",children:"#"}),(0,n.jsx)(o.code,{children:"modern pre"})]}),"\n",(0,n.jsx)(s.Code,{codeConfig:c,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"Usage: modern pre ",props:{style:{color:"#D8DEE9FF"}}},{content:"[",props:{style:{color:"#ECEFF4"}}},{content:"options",props:{style:{color:"#D8DEE9FF"}}},{content:"]",props:{style:{color:"#ECEFF4"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"<",props:{style:{color:"#81A1C1"}}},{content:"enter",props:{style:{color:"#D8DEE9FF"}}},{content:"|",props:{style:{color:"#81A1C1"}}},{content:"exit",props:{style:{color:"#D8DEE9FF"}}},{content:">",props:{style:{color:"#81A1C1"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"[",props:{style:{color:"#ECEFF4"}}},{content:"tag",props:{style:{color:"#D8DEE9FF"}}},{content:"]",props:{style:{color:"#ECEFF4"}}}]},{tokens:[]},{tokens:[{content:"\u8fdb\u5165\u548c\u9000\u51fa\u9884\u53d1\u5e03\u6a21\u5f0f",props:{style:{color:"#D8DEE9FF"}}}]},{tokens:[]},{tokens:[{content:"Options:",props:{style:{color:"#D8DEE9FF"}}}]},{tokens:[{content:" -h, --help display ",props:{style:{color:"#D8DEE9FF"}}},{content:"help",props:{style:{color:"#88C0D0"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"for",props:{style:{color:"#81A1C1"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"command",props:{style:{color:"#88C0D0"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,n.jsxs)(o.p,{children:["\u53ef\u4ee5\u4f7f\u7528 ",(0,n.jsx)(o.code,{children:"modern pre"})," \u547d\u4ee4\u5728\u6b63\u5f0f\u53d1\u5e03\u524d",(0,n.jsx)(o.a,{href:"https://github.com/atlassian/changesets/blob/main/docs/prereleases.md",target:"_blank",rel:"nofollow",children:"\u9884\u53d1\u5e03"}),"\u4e00\u4e2a\u7248\u672c\u3002"]}),"\n",(0,n.jsxs)(o.h2,{id:"modern-bump",children:[(0,n.jsx)(o.a,{className:"header-anchor","aria-hidden":"true",href:"#modern-bump",children:"#"}),(0,n.jsx)(o.code,{children:"modern bump"})]}),"\n",(0,n.jsx)(s.Code,{codeConfig:c,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"Usage: modern bump ",props:{style:{color:"#D8DEE9FF"}}},{content:"[",props:{style:{color:"#ECEFF4"}}},{content:"options",props:{style:{color:"#D8DEE9FF"}}},{content:"]",props:{style:{color:"#ECEFF4"}}}]},{tokens:[]},{tokens:[{content:"\u4f7f\u7528\u53d8\u66f4\u96c6\u81ea\u52a8\u66f4\u65b0\u53d1\u5e03\u7248\u672c\u548c\u53d8\u66f4\u65e5\u5fd7",props:{style:{color:"#D8DEE9FF"}}}]},{tokens:[]},{tokens:[{content:"Options:",props:{style:{color:"#D8DEE9FF"}}}]},{tokens:[{content:" --canary \u521b\u5efa\u4e00\u4e2a\u9884\u53d1\u5e03\u7248\u672c\u8fdb\u884c\u6d4b\u8bd5 ",props:{style:{color:"#D8DEE9FF"}}},{content:"(",props:{style:{color:"#ECEFF4"}}},{content:"default: false",props:{style:{color:"#D8DEE9FF"}}},{content:")",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" --preid ",props:{style:{color:"#D8DEE9FF"}}},{content:"<",props:{style:{color:"#81A1C1"}}},{content:"tag",props:{style:{color:"#D8DEE9FF"}}},{content:">",props:{style:{color:"#81A1C1"}}},{content:" \u5728\u5bf9\u9884\u53d1\u5e03\u7248\u672c\u8fdb\u884c\u7248\u672c\u63a7\u5236\u65f6\u6307\u5b9a\u6807\u8bc6\u7b26 ",props:{style:{color:"#D8DEE9FF"}}},{content:"(",props:{style:{color:"#ECEFF4"}}},{content:"default: ",props:{style:{color:"#D8DEE9FF"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:"next",props:{style:{color:"#A3BE8C"}}},{content:'"',props:{style:{color:"#ECEFF4"}}},{content:")",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" --snapshot \u521b\u5efa\u4e00\u4e2a\u7279\u6b8a\u7248\u672c\u8fdb\u884c\u6d4b\u8bd5 ",props:{style:{color:"#D8DEE9FF"}}},{content:"(",props:{style:{color:"#ECEFF4"}}},{content:"default: false",props:{style:{color:"#D8DEE9FF"}}},{content:")",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" -h, --help display ",props:{style:{color:"#D8DEE9FF"}}},{content:"help",props:{style:{color:"#88C0D0"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"for",props:{style:{color:"#81A1C1"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"command",props:{style:{color:"#88C0D0"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,n.jsxs)(o.p,{children:["\u6309\u7167 ",(0,n.jsx)(o.a,{href:"https://github.com/changesets/changesets",target:"_blank",rel:"nofollow",children:"changesets"})," \u751f\u6210\u7684\u53d8\u66f4\u8bb0\u5f55\u7684 Markdown \u6587\u4ef6\u4fee\u6539 ",(0,n.jsx)(o.code,{children:"package.json"})," \u4e2d\u7684\u7248\u672c\u53f7\uff0c \u540c\u65f6\u751f\u6210 ",(0,n.jsx)(o.code,{children:"CHANGELOG.md"})," \u6587\u4ef6\u3002"]}),"\n",(0,n.jsxs)(o.h2,{id:"modern-release",children:[(0,n.jsx)(o.a,{className:"header-anchor","aria-hidden":"true",href:"#modern-release",children:"#"}),(0,n.jsx)(o.code,{children:"modern release"})]}),"\n",(0,n.jsx)(s.Code,{codeConfig:c,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"Usage: modern release ",props:{style:{color:"#D8DEE9FF"}}},{content:"[",props:{style:{color:"#ECEFF4"}}},{content:"options",props:{style:{color:"#D8DEE9FF"}}},{content:"]",props:{style:{color:"#ECEFF4"}}}]},{tokens:[]},{tokens:[{content:"\u53d1\u5e03 npm \u5305",props:{style:{color:"#D8DEE9FF"}}}]},{tokens:[]},{tokens:[{content:"Options:",props:{style:{color:"#D8DEE9FF"}}}]},{tokens:[{content:" --tag ",props:{style:{color:"#D8DEE9FF"}}},{content:"<",props:{style:{color:"#81A1C1"}}},{content:"tag",props:{style:{color:"#D8DEE9FF"}}},{content:">",props:{style:{color:"#81A1C1"}}},{content:" \u53d1\u5e03 npm \u5305\u4f7f\u7528\u7279\u5b9a\u7684 tag ",props:{style:{color:"#D8DEE9FF"}}},{content:"(",props:{style:{color:"#ECEFF4"}}},{content:"default: ",props:{style:{color:"#D8DEE9FF"}}},{content:'""',props:{style:{color:"#ECEFF4"}}},{content:")",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" --ignore-scripts \u53d1\u5e03\u65f6\u5ffd\u7565 package.json \u4e2d\u7684 scripts \u547d\u4ee4\uff0c\u4ec5\u652f\u6301\u5728 pnpm monorepo",props:{style:{color:"#D8DEE9FF"}}}]},{tokens:[{content:" \u4e2d\u4f7f\u7528 ",props:{style:{color:"#D8DEE9FF"}}},{content:"(",props:{style:{color:"#ECEFF4"}}},{content:"default: ",props:{style:{color:"#D8DEE9FF"}}},{content:'""',props:{style:{color:"#ECEFF4"}}},{content:")",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" -h, --help display ",props:{style:{color:"#D8DEE9FF"}}},{content:"help",props:{style:{color:"#88C0D0"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"for",props:{style:{color:"#81A1C1"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"command",props:{style:{color:"#88C0D0"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,n.jsxs)(o.p,{children:[(0,n.jsx)(o.code,{children:"modern release"})," \u547d\u4ee4\u53ef\u4ee5\u5c06\u6a21\u5757\u53d1\u5e03\u5230 ",(0,n.jsx)(o.a,{href:"https://www.npmjs.com/",target:"_blank",rel:"nofollow",children:"npm Registry"})," \u4e0a\u3002"]}),"\n",(0,n.jsxs)(o.ul,{children:["\n",(0,n.jsxs)(o.li,{children:[(0,n.jsx)(o.code,{children:"--tag"})," \u53c2\u6570\u53ef\u4ee5\u6307\u5b9a\u53d1\u5e03\u65f6\u5177\u4f53\u7684 ",(0,n.jsx)(o.a,{href:"https://docs.npmjs.com/adding-dist-tags-to-packages",target:"_blank",rel:"nofollow",children:"dist tags"}),"\u3002"]}),"\n"]}),"\n",(0,n.jsxs)(o.h2,{id:"modern-gen-release-note",children:[(0,n.jsx)(o.a,{className:"header-anchor","aria-hidden":"true",href:"#modern-gen-release-note",children:"#"}),(0,n.jsx)(o.code,{children:"modern gen-release-note"})]}),"\n",(0,n.jsx)(s.Code,{codeConfig:c,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"Usage: modern gen-release-note ",props:{style:{color:"#D8DEE9FF"}}},{content:"[",props:{style:{color:"#ECEFF4"}}},{content:"options",props:{style:{color:"#D8DEE9FF"}}},{content:"]",props:{style:{color:"#ECEFF4"}}}]},{tokens:[]},{tokens:[{content:"\u6839\u636e\u5f53\u524d\u4ed3\u5e93 changeset \u4fe1\u606f\u751f\u6210 Release Note",props:{style:{color:"#D8DEE9FF"}}}]},{tokens:[]},{tokens:[{content:"Options:",props:{style:{color:"#D8DEE9FF"}}}]},{tokens:[{content:" --repo ",props:{style:{color:"#D8DEE9FF"}}},{content:"<",props:{style:{color:"#81A1C1"}}},{content:"repo",props:{style:{color:"#D8DEE9FF"}}},{content:">",props:{style:{color:"#81A1C1"}}},{content:" \u4ed3\u5e93\u540d\u79f0\uff0c\u7528\u4e8e\u751f\u6210 Pull Request \u94fe\u63a5\uff0c \u4f8b\u5982\uff1a modern-js-dev/modern.js",props:{style:{color:"#D8DEE9FF"}}}]},{tokens:[{content:" --custom ",props:{style:{color:"#D8DEE9FF"}}},{content:"<",props:{style:{color:"#81A1C1"}}},{content:"cumtom",props:{style:{color:"#D8DEE9FF"}}},{content:">",props:{style:{color:"#81A1C1"}}},{content:" \u81ea\u5b9a\u4e49 Release Note \u751f\u6210\u51fd\u6570",props:{style:{color:"#D8DEE9FF"}}}]},{tokens:[{content:" -h, --help display ",props:{style:{color:"#D8DEE9FF"}}},{content:"help",props:{style:{color:"#88C0D0"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"for",props:{style:{color:"#81A1C1"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"command",props:{style:{color:"#88C0D0"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,n.jsxs)(o.p,{children:["\u6839\u636e\u5f53\u524d\u4ed3\u5e93\u7684 changeset \u4fe1\u606f\u81ea\u52a8\u751f\u6210 ",(0,n.jsx)(o.a,{href:"https://en.wikipedia.org/wiki/Release_notes",target:"_blank",rel:"nofollow",children:"Release Note"}),"\u3002"]}),"\n",(0,n.jsxs)(o.div,{className:"modern-directive tip",children:[(0,n.jsx)(o.p,{className:"modern-directive-title",children:"\u6ce8\u610f"}),(0,n.jsx)(o.div,{className:"modern-directive-content",children:(0,n.jsxs)(o.p,{children:["\n\u9700\u8981\u5728 ",(0,n.jsx)(o.code,{children:"bump"}),"\u547d\u4ee4\u4e4b\u524d\u6267\u884c\u3002"]})})]}),"\n",(0,n.jsxs)(o.h2,{id:"modern-upgrade",children:[(0,n.jsx)(o.a,{className:"header-anchor","aria-hidden":"true",href:"#modern-upgrade",children:"#"}),(0,n.jsx)(o.code,{children:"modern upgrade"})]}),"\n",(0,n.jsx)(s.Code,{codeConfig:c,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"Usage: modern upgrade ",props:{style:{color:"#D8DEE9FF"}}},{content:"[",props:{style:{color:"#ECEFF4"}}},{content:"options",props:{style:{color:"#D8DEE9FF"}}},{content:"]",props:{style:{color:"#ECEFF4"}}}]},{tokens:[]},{tokens:[{content:"\u5347\u7ea7 Modern.js \u5230\u6700\u65b0\u7248\u672c",props:{style:{color:"#D8DEE9FF"}}}]},{tokens:[]},{tokens:[{content:"Options:",props:{style:{color:"#D8DEE9FF"}}}]},{tokens:[{content:" --registry ",props:{style:{color:"#D8DEE9FF"}}},{content:"<",props:{style:{color:"#81A1C1"}}},{content:"registry",props:{style:{color:"#D8DEE9FF"}}},{content:">",props:{style:{color:"#81A1C1"}}},{content:" \u5b9a\u5236 npm registry ",props:{style:{color:"#D8DEE9FF"}}},{content:"(",props:{style:{color:"#ECEFF4"}}},{content:"default: ",props:{style:{color:"#D8DEE9FF"}}},{content:'""',props:{style:{color:"#ECEFF4"}}},{content:")",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" -d,--debug \u5f00\u542f Debug \u6a21\u5f0f\uff0c\u6253\u5370\u8c03\u8bd5\u65e5\u5fd7\u4fe1\u606f ",props:{style:{color:"#D8DEE9FF"}}},{content:"(",props:{style:{color:"#ECEFF4"}}},{content:"default: false",props:{style:{color:"#D8DEE9FF"}}},{content:")",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" --cwd ",props:{style:{color:"#D8DEE9FF"}}},{content:"<",props:{style:{color:"#81A1C1"}}},{content:"cwd",props:{style:{color:"#D8DEE9FF"}}},{content:">",props:{style:{color:"#81A1C1"}}},{content:" \u9879\u76ee\u8def\u5f84 ",props:{style:{color:"#D8DEE9FF"}}},{content:"(",props:{style:{color:"#ECEFF4"}}},{content:"default: ",props:{style:{color:"#D8DEE9FF"}}},{content:'""',props:{style:{color:"#ECEFF4"}}},{content:")",props:{style:{color:"#ECEFF4"}}}]},{tokens:[{content:" -h, --help display ",props:{style:{color:"#D8DEE9FF"}}},{content:"help",props:{style:{color:"#88C0D0"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"for",props:{style:{color:"#81A1C1"}}},{content:" ",props:{style:{color:"#D8DEE9FF"}}},{content:"command",props:{style:{color:"#88C0D0"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,n.jsxs)(o.p,{children:[(0,n.jsx)(o.code,{children:"modern upgrade"})," \u547d\u4ee4\uff0c\u7528\u4e8e\u5347\u7ea7\u9879\u76ee Modern.js \u76f8\u5173\u4f9d\u8d56\u81f3\u6700\u65b0\u7248\u672c\u3002"]}),"\n",(0,n.jsxs)(o.p,{children:["\u5728\u9879\u76ee\u6839\u76ee\u5f55\u4e0b\u6267\u884c\u547d\u4ee4 ",(0,n.jsx)(o.code,{children:"npx modern upgrade"}),"\uff0c\u4f1a\u9ed8\u8ba4\u5c06\u5f53\u524d\u6267\u884c\u547d\u4ee4\u9879\u76ee\u7684 ",(0,n.jsx)(o.code,{children:"package.json"})," \u4e2d\u7684 Modern.js \u76f8\u5173\u4f9d\u8d56\u66f4\u65b0\u81f3\u6700\u65b0\u7248\u672c\u3002"]})]})}function u(e,o){throw new Error("Expected "+(o?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}o.default=function(e={}){const{wrapper:o}=e.components||{};return o?(0,n.jsx)(o,Object.assign({},e,{children:(0,n.jsx)(p,e)})):p(e)}}}]);
|