@modern-js/main-doc 2.0.0-beta.0 → 2.0.0-beta.1

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.
Files changed (507) hide show
  1. package/.turbo/turbo-build.log +4 -0
  2. package/en/docusaurus-plugin-content-docs/current/apis/app/commands/_category_.json +8 -0
  3. package/en/docusaurus-plugin-content-docs/current/apis/app/commands/build.md +44 -0
  4. package/en/docusaurus-plugin-content-docs/current/apis/app/commands/dev.md +31 -0
  5. package/en/docusaurus-plugin-content-docs/current/apis/app/commands/index.md +12 -0
  6. package/en/docusaurus-plugin-content-docs/current/apis/app/commands/inspect.md +39 -0
  7. package/en/docusaurus-plugin-content-docs/current/apis/app/commands/lint.md +22 -0
  8. package/en/docusaurus-plugin-content-docs/current/apis/app/commands/new.md +59 -0
  9. package/en/docusaurus-plugin-content-docs/current/apis/app/commands/start.md +32 -0
  10. package/en/docusaurus-plugin-content-docs/current/apis/app/commands/test.md +36 -0
  11. package/en/docusaurus-plugin-content-docs/current/apis/app/commands/upgrade.md +21 -0
  12. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/_category_.json +8 -0
  13. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/api/_category_.json +4 -0
  14. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/api/framework/_category_.json +4 -0
  15. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/api/framework/lambda.md +54 -0
  16. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/api/functions/_category_.json +4 -0
  17. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/api/functions/api.md +78 -0
  18. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/api/functions/app.md +12 -0
  19. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/api/functions/common.md +10 -0
  20. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/api/test.md +10 -0
  21. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/config/_category_.json +4 -0
  22. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/config/html.md +8 -0
  23. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/config/icon.md +15 -0
  24. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/config/mock.md +6 -0
  25. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/config/public.md +28 -0
  26. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/config/storybook.md +12 -0
  27. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/config/upload.md +42 -0
  28. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/index.md +7 -0
  29. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/modern-config.md +8 -0
  30. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/server/_category_.json +4 -0
  31. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/server/index_.md +14 -0
  32. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/server/test.md +10 -0
  33. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/shared.md +6 -0
  34. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/src/_category_.json +4 -0
  35. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/src/app.md +45 -0
  36. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/src/index_.md +34 -0
  37. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/src/pages.md +180 -0
  38. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/src/stories.md +12 -0
  39. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/src/test.md +12 -0
  40. package/en/docusaurus-plugin-content-docs/current/apis/app/overview.md +12 -0
  41. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/_category_.json +9 -0
  42. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/app/_category_.json +4 -0
  43. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/app/define-config.md +60 -0
  44. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/bff/_category_.json +4 -0
  45. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/bff/hook.md +43 -0
  46. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/bff/use-context.md +36 -0
  47. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/core/_category_.json +5 -0
  48. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/core/bootstrap.md +55 -0
  49. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/core/create-app.md +47 -0
  50. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/core/use-loader.md +83 -0
  51. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/core/use-module-apps.md +101 -0
  52. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/core/use-runtime-context.md +59 -0
  53. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/default-alias.md +25 -0
  54. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/env.md +72 -0
  55. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/index.md +12 -0
  56. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/Provider.md +35 -0
  57. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/_category_.json +4 -0
  58. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/auto-actions.md +120 -0
  59. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/connect.md +140 -0
  60. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/create-app.md +73 -0
  61. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/create-store.md +62 -0
  62. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/handle-effect.md +105 -0
  63. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/model_.md +197 -0
  64. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/use-local-model.md +27 -0
  65. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/use-model.md +89 -0
  66. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/use-static-model.md +49 -0
  67. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/use-store.md +48 -0
  68. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/plugin/_category_.json +4 -0
  69. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/plugin/abstract.md +26 -0
  70. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/plugin/hook-api.md +896 -0
  71. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/plugin/hook.md +170 -0
  72. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/plugin/plugin-api.md +117 -0
  73. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/router/_category_.json +4 -0
  74. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/router/router.md +492 -0
  75. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/ssr/_category_.json +4 -0
  76. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/ssr/no-ssr.md +44 -0
  77. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/ssr/pre-render.md +91 -0
  78. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/testing/_category_.json +4 -0
  79. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/testing/act.md +34 -0
  80. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/testing/cleanup.md +38 -0
  81. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/testing/render.md +72 -0
  82. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/testing/renderApp.md +33 -0
  83. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/utility/_category_.json +4 -0
  84. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/utility/css-in-js.md +42 -0
  85. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/utility/head.md +39 -0
  86. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/utility/loadable.md +85 -0
  87. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/web-server/_category_.json +4 -0
  88. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/web-server/hook.md +131 -0
  89. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/web-server/middleware.md +106 -0
  90. package/en/docusaurus-plugin-content-docs/current/configure/app/bff/fetcher.md +28 -0
  91. package/en/docusaurus-plugin-content-docs/current/configure/app/bff/prefix.md +33 -0
  92. package/en/docusaurus-plugin-content-docs/current/configure/app/bff/proxy.md +75 -0
  93. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/dev/asset-prefix.md +0 -1
  94. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/dev/hmr.md +0 -1
  95. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/dev/https.md +0 -1
  96. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/dev/port.md +0 -1
  97. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/dev/progress-bar.md +0 -1
  98. package/en/docusaurus-plugin-content-docs/current/configure/app/dev/proxy.md +80 -0
  99. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/dev/start-url.md +0 -1
  100. package/en/docusaurus-plugin-content-docs/current/configure/app/dev/with-master-app.md +32 -0
  101. package/en/docusaurus-plugin-content-docs/current/configure/app/experiments/lazy-compilation.md +12 -0
  102. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/app-icon.md +0 -1
  103. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/crossorigin.md +0 -1
  104. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/disable-html-folder.md +0 -1
  105. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/favicon-by-entries.md +0 -1
  106. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/favicon.md +0 -1
  107. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/inject-by-entries.md +0 -1
  108. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/inject.md +0 -1
  109. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/meta-by-entries.md +0 -1
  110. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/meta.md +0 -1
  111. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/mount-id.md +0 -1
  112. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/template-by-entries.md +0 -1
  113. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/template-parameters-by-entries.md +0 -1
  114. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/template-parameters.md +0 -1
  115. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/template.md +0 -1
  116. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/title-by-entries.md +0 -1
  117. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/title.md +0 -1
  118. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/asset-prefix.md +0 -1
  119. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/assets-retry.md +0 -1
  120. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/charset.md +0 -1
  121. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/clean-dist-path.md +0 -1
  122. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/convert-to-rem.md +0 -1
  123. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/copy.md +0 -1
  124. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/css-module-local-ident-name.md +0 -1
  125. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/data-uri-limit.md +0 -1
  126. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/disable-css-module-extension.md +0 -1
  127. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/disable-filename-hash.md +0 -1
  128. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/disable-inline-runtime-chunk.md +0 -1
  129. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/disable-minimize.md +0 -1
  130. package/en/docusaurus-plugin-content-docs/current/configure/app/output/disable-node-polyfill.md +20 -0
  131. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/disable-source-map.md +0 -1
  132. package/en/docusaurus-plugin-content-docs/current/configure/app/output/disable-ts-checker.md +12 -0
  133. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/dist-path.md +0 -1
  134. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/enable-asset-fallback.md +0 -1
  135. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/enable-asset-manifest.md +0 -1
  136. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/enable-css-module-tsdeclaration.md +0 -1
  137. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/enable-inline-scripts.md +0 -1
  138. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/enable-inline-styles.md +0 -1
  139. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/enable-latest-decorators.md +0 -1
  140. package/en/docusaurus-plugin-content-docs/current/configure/app/output/enable-modern-mode.md +34 -0
  141. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/externals.md +0 -1
  142. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/filename.md +0 -1
  143. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/legal-comments.md +0 -1
  144. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/override-browserslist.md +0 -1
  145. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/polyfill.md +0 -1
  146. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/svg-default-export.md +0 -1
  147. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/performance/build-cache.md +0 -1
  148. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/performance/bundle-analyze.md +0 -1
  149. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/performance/chunk-split.md +0 -1
  150. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/performance/print-file-size.md +0 -1
  151. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/performance/profile.md +0 -1
  152. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/performance/remove-console.md +0 -1
  153. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/performance/remove-moment-locale.md +0 -1
  154. package/en/docusaurus-plugin-content-docs/current/configure/app/plugins.md +74 -0
  155. package/en/docusaurus-plugin-content-docs/current/configure/app/runtime/intro.md +91 -0
  156. package/en/docusaurus-plugin-content-docs/current/configure/app/runtime/master-app.md +60 -0
  157. package/en/docusaurus-plugin-content-docs/current/configure/app/runtime/router.md +19 -0
  158. package/en/docusaurus-plugin-content-docs/current/configure/app/runtime/state.md +41 -0
  159. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/security/sri.md +0 -1
  160. package/en/docusaurus-plugin-content-docs/current/configure/app/server/base-url.md +33 -0
  161. package/en/docusaurus-plugin-content-docs/current/configure/app/server/port.md +18 -0
  162. package/en/docusaurus-plugin-content-docs/current/configure/app/server/public-routes.md +26 -0
  163. package/en/docusaurus-plugin-content-docs/current/configure/app/server/routes.md +91 -0
  164. package/en/docusaurus-plugin-content-docs/current/configure/app/server/ssr-by-entries.md +28 -0
  165. package/en/docusaurus-plugin-content-docs/current/configure/app/server/ssr.md +20 -0
  166. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/source/alias.md +0 -1
  167. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/source/compile-js-data-uri.md +0 -1
  168. package/en/docusaurus-plugin-content-docs/current/configure/app/source/config-dir.md +23 -0
  169. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/source/define.md +0 -1
  170. package/en/docusaurus-plugin-content-docs/current/configure/app/source/design-system.md +1150 -0
  171. package/en/docusaurus-plugin-content-docs/current/configure/app/source/disable-default-entries.md +28 -0
  172. package/en/docusaurus-plugin-content-docs/current/configure/app/source/enable-async-entry.md +50 -0
  173. package/en/docusaurus-plugin-content-docs/current/configure/app/source/entries-dir.md +38 -0
  174. package/en/docusaurus-plugin-content-docs/current/configure/app/source/entries.md +62 -0
  175. package/en/docusaurus-plugin-content-docs/current/configure/app/source/exclude.md +12 -0
  176. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/source/global-vars.md +0 -1
  177. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/source/include.md +0 -1
  178. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/source/module-scopes.md +0 -1
  179. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/source/pre-entry.md +0 -1
  180. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/source/resolve-extension-prefix.md +0 -1
  181. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/source/resolve-main-fields.md +0 -1
  182. package/en/docusaurus-plugin-content-docs/current/configure/app/testing/transformer.md +18 -0
  183. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/autoprefixer.md +0 -1
  184. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/babel.md +0 -1
  185. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/css-extract.md +0 -1
  186. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/css-loader.md +0 -1
  187. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/dev-server.md +0 -1
  188. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/esbuild.md +61 -0
  189. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/html-plugin.md +0 -1
  190. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/inspector.md +0 -1
  191. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/jest.md +39 -0
  192. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/less.md +0 -1
  193. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/minify-css.md +0 -1
  194. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/postcss.md +0 -1
  195. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/pug.md +0 -1
  196. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/sass.md +0 -1
  197. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/style-loader.md +0 -1
  198. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/styled-components.md +0 -1
  199. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/tailwindcss.md +47 -0
  200. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/terser.md +0 -1
  201. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/ts-checker.md +0 -1
  202. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/ts-loader.md +0 -1
  203. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/webpack-chain.md +0 -1
  204. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/webpack.md +0 -1
  205. package/en/docusaurus-plugin-content-docs/current/configure/app/usage.md +92 -0
  206. package/en/{tutorials → docusaurus-plugin-content-docs/current/tutorials}/foundations/_category_.json +0 -0
  207. package/en/{tutorials → docusaurus-plugin-content-docs/current/tutorials}/foundations/basic.md +0 -0
  208. package/en/{tutorials → docusaurus-plugin-content-docs/current/tutorials}/foundations/introduction.md +0 -0
  209. package/en/docusaurus-plugin-content-docs/current.json +262 -0
  210. package/package.json +7 -5
  211. package/scripts/config.ts +98 -0
  212. package/scripts/summary.en.json +1 -0
  213. package/scripts/summary.zh.json +1 -0
  214. package/scripts/sync.ts +26 -5
  215. package/zh/apis/app/commands/build.md +2 -2
  216. package/zh/apis/app/commands/dev.md +1 -1
  217. package/zh/apis/app/commands/index.md +1 -1
  218. package/zh/apis/app/commands/lint.md +2 -2
  219. package/zh/apis/app/commands/new.md +1 -1
  220. package/zh/apis/app/commands/start.md +1 -1
  221. package/zh/apis/app/commands/test.md +1 -1
  222. package/zh/apis/app/commands/upgrade.md +0 -2
  223. package/zh/apis/app/hooks/api/framework/_category_.json +1 -1
  224. package/zh/apis/app/hooks/api/framework/lambda.md +8 -33
  225. package/zh/apis/app/hooks/api/functions/_category_.json +1 -1
  226. package/zh/apis/app/hooks/api/functions/api.md +29 -2
  227. package/zh/apis/app/hooks/api/functions/app.md +5 -3
  228. package/zh/apis/app/hooks/api/functions/common.md +3 -5
  229. package/zh/apis/app/hooks/api/test.md +2 -4
  230. package/zh/apis/app/hooks/config/html.md +1 -3
  231. package/zh/apis/app/hooks/config/icon.md +2 -2
  232. package/zh/apis/app/hooks/config/mock.md +2 -8
  233. package/zh/apis/app/hooks/config/public.md +2 -4
  234. package/zh/apis/app/hooks/config/storybook.md +2 -4
  235. package/zh/apis/app/hooks/config/upload.md +1 -7
  236. package/zh/apis/app/hooks/modern-config.md +1 -3
  237. package/zh/apis/app/hooks/server/index_.md +12 -0
  238. package/zh/apis/app/hooks/server/test.md +3 -3
  239. package/zh/apis/app/hooks/shared.md +1 -2
  240. package/zh/apis/app/hooks/src/app.md +8 -4
  241. package/zh/apis/app/hooks/src/{index.md → index_.md} +2 -2
  242. package/zh/apis/app/hooks/src/pages.md +3 -4
  243. package/zh/apis/app/hooks/src/stories.md +2 -2
  244. package/zh/apis/app/hooks/src/test.md +1 -1
  245. package/zh/apis/app/overview.md +1 -1
  246. package/zh/apis/app/runtime/app/_category_.json +2 -2
  247. package/zh/apis/app/runtime/app/define-config.md +14 -10
  248. package/zh/apis/app/runtime/bff/_category_.json +4 -0
  249. package/zh/apis/app/runtime/bff/hook.md +43 -0
  250. package/zh/apis/app/runtime/bff/use-context.md +36 -0
  251. package/zh/apis/app/runtime/core/_category_.json +4 -0
  252. package/zh/apis/app/runtime/core/bootstrap.md +55 -0
  253. package/zh/apis/app/runtime/core/create-app.md +47 -0
  254. package/zh/apis/app/runtime/core/use-loader.md +83 -0
  255. package/zh/apis/app/runtime/core/use-module-apps.md +101 -0
  256. package/zh/apis/app/runtime/core/use-runtime-context.md +59 -0
  257. package/zh/apis/app/runtime/default-alias.md +4 -7
  258. package/zh/apis/app/runtime/env.md +22 -20
  259. package/zh/apis/app/runtime/model/Provider.md +6 -8
  260. package/zh/apis/app/runtime/model/_category_.json +1 -1
  261. package/zh/apis/app/runtime/model/auto-actions.md +1 -2
  262. package/zh/apis/app/runtime/model/connect.md +8 -5
  263. package/zh/apis/app/runtime/model/create-app.md +3 -4
  264. package/zh/apis/app/runtime/model/create-store.md +5 -3
  265. package/zh/apis/app/runtime/model/handle-effect.md +5 -5
  266. package/zh/apis/app/runtime/model/model_.md +3 -3
  267. package/zh/apis/app/runtime/model/use-local-model.md +2 -2
  268. package/zh/apis/app/runtime/model/use-model.md +6 -7
  269. package/zh/apis/app/runtime/model/use-static-model.md +2 -2
  270. package/zh/apis/app/runtime/model/use-store.md +3 -3
  271. package/zh/apis/app/runtime/router/_category_.json +4 -0
  272. package/zh/apis/app/runtime/{container → router}/router.md +0 -0
  273. package/zh/apis/app/runtime/ssr/_category_.json +4 -0
  274. package/zh/apis/app/runtime/ssr/no-ssr.md +41 -0
  275. package/zh/apis/app/runtime/ssr/pre-render.md +91 -0
  276. package/zh/apis/app/runtime/testing/_category_.json +1 -1
  277. package/zh/apis/app/runtime/testing/act.md +8 -8
  278. package/zh/apis/app/runtime/testing/cleanup.md +10 -9
  279. package/zh/apis/app/runtime/testing/render.md +43 -23
  280. package/zh/apis/app/runtime/testing/renderApp.md +8 -8
  281. package/zh/apis/app/runtime/utility/_category_.json +1 -1
  282. package/zh/apis/app/runtime/utility/css-in-js.md +17 -35
  283. package/zh/apis/app/runtime/{app → utility}/head.md +6 -10
  284. package/zh/apis/app/runtime/utility/{loadable/loadable_.md → loadable.md} +29 -56
  285. package/zh/apis/app/runtime/web-server/_category_.json +1 -1
  286. package/zh/apis/app/runtime/web-server/hook.md +100 -90
  287. package/zh/apis/app/runtime/web-server/middleware.md +106 -0
  288. package/zh/apis/monorepo/commands/bump.md +1 -1
  289. package/zh/apis/monorepo/commands/change.md +1 -1
  290. package/zh/apis/monorepo/commands/clear.md +1 -1
  291. package/zh/apis/monorepo/commands/deploy.md +1 -1
  292. package/zh/apis/monorepo/commands/gen-release-note.md +1 -1
  293. package/zh/apis/monorepo/commands/lint.md +1 -1
  294. package/zh/apis/monorepo/commands/new.md +1 -1
  295. package/zh/apis/monorepo/commands/pre.md +1 -1
  296. package/zh/apis/monorepo/commands/release.md +1 -1
  297. package/zh/configure/app/bff/fetcher.md +1 -2
  298. package/zh/configure/app/bff/prefix.md +2 -3
  299. package/zh/configure/app/bff/proxy.md +8 -13
  300. package/zh/configure/app/dev/asset-prefix.md +0 -1
  301. package/zh/configure/app/dev/hmr.md +0 -1
  302. package/zh/configure/app/dev/https.md +0 -1
  303. package/zh/configure/app/dev/port.md +0 -1
  304. package/zh/configure/app/dev/progress-bar.md +0 -1
  305. package/zh/configure/app/dev/proxy.md +2 -3
  306. package/zh/configure/app/dev/start-url.md +0 -1
  307. package/zh/configure/app/dev/with-master-app.md +0 -1
  308. package/zh/configure/app/experiments/lazy-compilation.md +12 -0
  309. package/zh/configure/app/html/app-icon.md +0 -1
  310. package/zh/configure/app/html/crossorigin.md +0 -1
  311. package/zh/configure/app/html/disable-html-folder.md +0 -1
  312. package/zh/configure/app/html/favicon-by-entries.md +0 -1
  313. package/zh/configure/app/html/favicon.md +0 -1
  314. package/zh/configure/app/html/inject-by-entries.md +0 -1
  315. package/zh/configure/app/html/inject.md +0 -1
  316. package/zh/configure/app/html/meta-by-entries.md +0 -1
  317. package/zh/configure/app/html/meta.md +0 -1
  318. package/zh/configure/app/html/mount-id.md +0 -1
  319. package/zh/configure/app/html/template-by-entries.md +0 -1
  320. package/zh/configure/app/html/template-parameters-by-entries.md +0 -1
  321. package/zh/configure/app/html/template-parameters.md +0 -1
  322. package/zh/configure/app/html/template.md +0 -1
  323. package/zh/configure/app/html/title-by-entries.md +0 -1
  324. package/zh/configure/app/html/title.md +0 -1
  325. package/zh/configure/app/output/asset-prefix.md +0 -1
  326. package/zh/configure/app/output/assets-retry.md +0 -1
  327. package/zh/configure/app/output/charset.md +0 -1
  328. package/zh/configure/app/output/clean-dist-path.md +0 -1
  329. package/zh/configure/app/output/convert-to-rem.md +0 -1
  330. package/zh/configure/app/output/copy.md +0 -1
  331. package/zh/configure/app/output/css-module-local-ident-name.md +0 -1
  332. package/zh/configure/app/output/data-uri-limit.md +0 -1
  333. package/zh/configure/app/output/disable-css-module-extension.md +0 -1
  334. package/zh/configure/app/output/disable-filename-hash.md +0 -1
  335. package/zh/configure/app/output/disable-inline-runtime-chunk.md +0 -1
  336. package/zh/configure/app/output/disable-minimize.md +0 -1
  337. package/zh/configure/app/output/disable-node-polyfill.md +2 -4
  338. package/zh/configure/app/output/disable-source-map.md +0 -1
  339. package/zh/configure/app/output/disable-ts-checker.md +12 -0
  340. package/zh/configure/app/output/dist-path.md +0 -1
  341. package/zh/configure/app/output/enable-asset-fallback.md +0 -1
  342. package/zh/configure/app/output/enable-asset-manifest.md +0 -1
  343. package/zh/configure/app/output/enable-css-module-tsdeclaration.md +0 -1
  344. package/zh/configure/app/output/enable-inline-scripts.md +0 -1
  345. package/zh/configure/app/output/enable-inline-styles.md +0 -1
  346. package/zh/configure/app/output/enable-latest-decorators.md +0 -1
  347. package/zh/configure/app/output/enable-modern-mode.md +13 -5
  348. package/zh/configure/app/output/externals.md +0 -1
  349. package/zh/configure/app/output/filename.md +0 -1
  350. package/zh/configure/app/output/legal-comments.md +0 -1
  351. package/zh/configure/app/output/override-browserslist.md +0 -1
  352. package/zh/configure/app/output/polyfill.md +0 -1
  353. package/zh/configure/app/output/svg-default-export.md +0 -1
  354. package/zh/configure/app/performance/build-cache.md +0 -1
  355. package/zh/configure/app/performance/bundle-analyze.md +0 -1
  356. package/zh/configure/app/performance/chunk-split.md +0 -1
  357. package/zh/configure/app/performance/print-file-size.md +0 -1
  358. package/zh/configure/app/performance/profile.md +0 -1
  359. package/zh/configure/app/performance/remove-console.md +0 -1
  360. package/zh/configure/app/performance/remove-moment-locale.md +0 -1
  361. package/zh/configure/app/runtime/intro.md +92 -0
  362. package/zh/configure/app/runtime/master-app.md +8 -21
  363. package/zh/configure/app/runtime/router.md +4 -38
  364. package/zh/configure/app/runtime/state.md +10 -13
  365. package/zh/configure/app/security/sri.md +0 -1
  366. package/zh/configure/app/server/base-url.md +1 -2
  367. package/zh/configure/app/server/port.md +1 -2
  368. package/zh/configure/app/server/public-routes.md +1 -2
  369. package/zh/configure/app/server/routes.md +4 -5
  370. package/zh/configure/app/server/ssr-by-entries.md +2 -3
  371. package/zh/configure/app/server/ssr.md +1 -2
  372. package/zh/configure/app/source/alias.md +0 -1
  373. package/zh/configure/app/source/compile-js-data-uri.md +0 -1
  374. package/zh/configure/app/source/config-dir.md +12 -4
  375. package/zh/configure/app/source/define.md +0 -1
  376. package/zh/configure/app/source/design-system.md +14 -24
  377. package/zh/configure/app/source/disable-default-entries.md +8 -3
  378. package/zh/configure/app/source/enable-async-entry.md +3 -3
  379. package/zh/configure/app/source/entries-dir.md +1 -1
  380. package/zh/configure/app/source/entries.md +16 -9
  381. package/zh/configure/app/source/exclude.md +12 -0
  382. package/zh/configure/app/source/global-vars.md +0 -1
  383. package/zh/configure/app/source/include.md +0 -1
  384. package/zh/configure/app/source/module-scopes.md +0 -1
  385. package/zh/configure/app/source/pre-entry.md +0 -1
  386. package/zh/configure/app/source/resolve-extension-prefix.md +0 -1
  387. package/zh/configure/app/source/resolve-main-fields.md +0 -1
  388. package/zh/configure/app/testing/transformer.md +2 -4
  389. package/zh/configure/app/tools/autoprefixer.md +0 -1
  390. package/zh/configure/app/tools/babel.md +0 -1
  391. package/zh/configure/app/tools/css-extract.md +0 -1
  392. package/zh/configure/app/tools/css-loader.md +0 -1
  393. package/zh/configure/app/tools/dev-server.md +0 -1
  394. package/zh/configure/app/tools/esbuild.md +5 -5
  395. package/zh/configure/app/tools/html-plugin.md +0 -1
  396. package/zh/configure/app/tools/inspector.md +0 -1
  397. package/zh/configure/app/tools/jest.md +2 -4
  398. package/zh/configure/app/tools/less.md +0 -1
  399. package/zh/configure/app/tools/minify-css.md +0 -1
  400. package/zh/configure/app/tools/postcss.md +0 -1
  401. package/zh/configure/app/tools/pug.md +0 -1
  402. package/zh/configure/app/tools/sass.md +0 -1
  403. package/zh/configure/app/tools/style-loader.md +0 -1
  404. package/zh/configure/app/tools/styled-components.md +0 -1
  405. package/zh/configure/app/tools/terser.md +0 -1
  406. package/zh/configure/app/tools/ts-checker.md +0 -1
  407. package/zh/configure/app/tools/ts-loader.md +0 -1
  408. package/zh/configure/app/tools/webpack-chain.md +0 -1
  409. package/zh/configure/app/tools/webpack.md +0 -1
  410. package/zh/configure/app/usage.md +15 -4
  411. package/zh/guides/advanced-features/bff/bff-server.md +1 -1
  412. package/zh/guides/advanced-features/bff/frameworks.md +0 -221
  413. package/zh/guides/advanced-features/code-split.md +1 -1
  414. package/zh/guides/advanced-features/low-level.md +2 -2
  415. package/zh/guides/advanced-features/ssg.md +2 -2
  416. package/zh/guides/advanced-features/ssr.md +4 -4
  417. package/zh/guides/basic-features/alias.md +1 -1
  418. package/zh/guides/basic-features/css/postcss.md +1 -1
  419. package/zh/guides/basic-features/css/tailwindcss.md +2 -2
  420. package/zh/guides/basic-features/env-vars.md +2 -3
  421. package/zh/guides/basic-features/proxy.md +2 -2
  422. package/zh/guides/topic-detail/compile-speed.md +5 -5
  423. package/zh/guides/topic-detail/generator/_category_.json +4 -0
  424. package/zh/guides/topic-detail/generator/codesmith/_category_.json +4 -0
  425. package/zh/guides/topic-detail/generator/codesmith/introduce.md +5 -0
  426. package/zh/guides/topic-detail/generator/config/_category_.json +4 -0
  427. package/zh/{configure/generator/introduce.md → guides/topic-detail/generator/config/common.md} +35 -42
  428. package/zh/{configure/generator → guides/topic-detail/generator/config}/module.md +7 -11
  429. package/zh/{configure/generator → guides/topic-detail/generator/config}/monorepo.md +4 -4
  430. package/zh/{configure/generator → guides/topic-detail/generator/config}/mwa.md +11 -45
  431. package/zh/guides/topic-detail/generator/plugin/_category_.json +4 -0
  432. package/zh/guides/topic-detail/{generator-plugin → generator/plugin}/abstract.md +0 -0
  433. package/zh/guides/topic-detail/generator/plugin/api/_category_.json +4 -0
  434. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/file/_category_.json +0 -0
  435. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/file/addFile.md +1 -1
  436. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/file/addHelper.md +0 -0
  437. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/file/addManyFile.md +1 -1
  438. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/file/addPartial.md +0 -0
  439. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/file/introduce.md +0 -0
  440. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/file/rmDir.md +0 -0
  441. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/file/rmFile.md +0 -0
  442. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/file/updateJSONFile.md +0 -0
  443. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/file/updateModernConfig.md +0 -0
  444. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/file/updateTextRawFile.md +0 -0
  445. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/git/_category_.json +0 -0
  446. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/git/gitAddAndCommit.md +0 -0
  447. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/git/initGitRepo.md +0 -0
  448. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/git/isInGitRepo.md +0 -0
  449. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/hook/_category_.json +0 -0
  450. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/hook/afterForged.md +1 -1
  451. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/hook/onForged.md +1 -1
  452. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/info/_category_.json +0 -0
  453. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/info/isFileExit.md +0 -0
  454. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/info/locale.md +0 -0
  455. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/info/readDir.md +0 -0
  456. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/input/_category_.json +0 -0
  457. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/input/addInputAfter.md +14 -6
  458. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/input/addInputBefore.md +14 -6
  459. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/input/setInput.md +2 -2
  460. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/input/setInputValue.md +0 -0
  461. package/zh/guides/topic-detail/generator/plugin/api/input/type.md +65 -0
  462. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/introduce.md +0 -0
  463. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/new/_category_.json +0 -0
  464. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/new/createElement.md +1 -1
  465. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/new/createSubProject.md +1 -1
  466. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/new/enableFunc.md +1 -3
  467. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/new/introduce.md +3 -3
  468. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/npm/_category_.json +0 -0
  469. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/npm/install.md +0 -0
  470. package/zh/guides/topic-detail/{generator-plugin → generator/plugin}/develop.md +4 -4
  471. package/zh/guides/topic-detail/{generator-plugin → generator/plugin}/use.md +0 -0
  472. package/zh/guides/topic-detail/generator/project.md +117 -0
  473. package/zh/guides/topic-detail/micro-frontend/debugging.md +5 -5
  474. package/zh/guides/topic-detail/micro-frontend/route-mode.md +2 -2
  475. package/zh/guides/troubleshooting/compile.md +3 -3
  476. package/zh/tutorials/first-app/c01-getting-started/1.4-enable-ssr.md +2 -2
  477. package/zh/tutorials/first-app/c04-es6-plus-and-ts/4.3-compatibility.md +4 -4
  478. package/zh/tutorials/first-app/c06-css-and-component/6.4-design-system.md +3 -3
  479. package/zh/tutorials/first-app/c07-app-entry/7.3-manage-entries-by-hand.md +2 -2
  480. package/zh/tutorials/first-app/c08-client-side-routing/8.1-code-based-routing.md +1 -1
  481. package/scripts/gen-config.ts +0 -60
  482. package/zh/apis/app/hooks/api/framework/app.md +0 -100
  483. package/zh/apis/app/hooks/server/index.md +0 -14
  484. package/zh/apis/app/hooks/src/error.md +0 -10
  485. package/zh/apis/app/hooks/src/eslint.md +0 -9
  486. package/zh/apis/app/runtime/app/bootstrap.md +0 -83
  487. package/zh/apis/app/runtime/app/create-app.md +0 -47
  488. package/zh/apis/app/runtime/app/no-ssr.md +0 -41
  489. package/zh/apis/app/runtime/app/pre-render.md +0 -77
  490. package/zh/apis/app/runtime/app/use-module-app.md +0 -60
  491. package/zh/apis/app/runtime/app/use-module-apps.md +0 -64
  492. package/zh/apis/app/runtime/app/use-runtime-context.md +0 -39
  493. package/zh/apis/app/runtime/bff-server/_category_.json +0 -4
  494. package/zh/apis/app/runtime/bff-server/after-lambda-registed.md +0 -35
  495. package/zh/apis/app/runtime/bff-server/hook.md +0 -120
  496. package/zh/apis/app/runtime/bff-server/use-context.md +0 -70
  497. package/zh/apis/app/runtime/container/_category_.json +0 -4
  498. package/zh/apis/app/runtime/container/use-loader.md +0 -64
  499. package/zh/apis/app/runtime/utility/loadable/_category_.json +0 -4
  500. package/zh/apis/app/runtime/utility/loadable/lazy.md +0 -29
  501. package/zh/apis/app/runtime/utility/loadable/loadable-component.md +0 -61
  502. package/zh/apis/app/runtime/utility/loadable/loadable-library.md +0 -67
  503. package/zh/apis/generator/plugin/_category_.json +0 -4
  504. package/zh/apis/generator/plugin/input/addOptionAfter.md +0 -45
  505. package/zh/apis/generator/plugin/input/addOptionBefore.md +0 -45
  506. package/zh/apis/generator/plugin/input/type.md +0 -101
  507. package/zh/guides/topic-detail/generator-plugin/_category_.json +0 -4
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  title: performance.removeMomentLocale
3
3
  sidebar_label: removeMomentLocale
4
- sidebar_position: 1
5
4
  ---
6
5
 
7
6
  :::info BUILDER
@@ -0,0 +1,74 @@
1
+ ---
2
+ title: plugins
3
+ sidebar_position: 9
4
+ ---
5
+
6
+ * Type: `CliPlugin[] | { cli: CliPlugin[] }`
7
+ * Default: `[]`
8
+
9
+ Used to configure custom Modern.js plugins.
10
+
11
+ For the way to write custom plugins, please refer to [How to Write Plugins](/docs/guides/topic-detail/framework-plugin/implement).
12
+
13
+ This option is used to configure the framework plugin. If you need to configure the webpack plugin, please use [tools.webpack](/docs/configure/app/tools/webpack) or [tools.webpack Chain](/docs/configure/app/tools/webpack-chain); If you need to configure the babel plugin, please use [tools.babel](/docs/configure/app/tools/babel).
14
+
15
+ ## Plugin type
16
+
17
+ There are three different plug-in mechanisms built into the Modern.js:
18
+
19
+ - `CLI Plugin`,for local development, compilation and build phases, can extend various capabilities on the command line and compilation phases.
20
+ - `Server Plugin`,for server-level.
21
+ - `Runtime Plugin`,for runtime.
22
+
23
+ The ability to customize CLI plugins is currently open Modern.js, and the Server plugin and Runtime plugin will be available in the future.
24
+
25
+ ## Plugin execution order
26
+
27
+ By default, custom plugins are executed sequentially in the order of an array of `plugins`, Modern.js built-in plugins are executed earlier than custom plugins.
28
+
29
+ When the plugin uses related fields that control the order, such as `pre` and `post`, the execution order will be adjusted based on the declared fields, see [Relationship between plugins](/docs/guides/topic-detail/framework-plugin/relationship).
30
+
31
+ ## Example
32
+
33
+ Below is an example of using the CLI plugin.
34
+
35
+ ### Using plugins on npm
36
+
37
+ To use the plugin on npm, you need to install the plugin through the package manager and import it.
38
+
39
+ ```ts title="modern.config.ts"
40
+ import MyPlugin from 'my-plugin';
41
+
42
+ export default defineConfig({
43
+ plugins: [MyPlugin()],
44
+ });
45
+ ```
46
+
47
+ ### Use local plugins
48
+
49
+ Using the plugin in the local code repository, you can import it directly through the relative path import.
50
+
51
+ ```ts title="modern.config.ts"
52
+ import MyPlugin from './config/plugin/MyPlugin';
53
+
54
+ export default defineConfig({
55
+ plugins: [MyPlugin()],
56
+ });
57
+ ```
58
+
59
+ ### Plugin configuration
60
+
61
+ If the plugin provides some custom configuration options, you can pass in the configuration through the parameters of the plugin function.
62
+
63
+ ```ts title="modern.config.ts"
64
+ import MyPlugin from 'my-plugin';
65
+
66
+ export default defineConfig({
67
+ plugins: [
68
+ MyPlugin({
69
+ foo: 1,
70
+ bar: 2,
71
+ }),
72
+ ],
73
+ });
74
+ ```
@@ -0,0 +1,91 @@
1
+ ---
2
+ sidebar_label: Overview
3
+ sidebar_position: 1
4
+ ---
5
+
6
+ # Overview
7
+
8
+ This section describes the configuration of the Runtime plugin.
9
+
10
+ ## Configuration
11
+
12
+ ### runtime
13
+
14
+ * Type: `Object`
15
+
16
+ The runtime is configured as follows:
17
+
18
+ #### Base
19
+
20
+ Configure in `modern.config.ts`:
21
+
22
+ ```ts title="modern.config.ts"
23
+ import { defineConfig } from '@modern-js/app-tools';
24
+
25
+ export default defineConfig({
26
+ runtime: {
27
+ state: true,
28
+ router: true
29
+ }
30
+ });
31
+ ```
32
+
33
+ #### DefineConfig
34
+
35
+ Configure use [`defineConfig`](/docs/apis/app/runtime/app/define-config) API:
36
+
37
+ :::info
38
+ When there is a function in the runtime configuration, it can only be configured in this way.
39
+ :::
40
+
41
+ ```ts title="src/App.tsx"
42
+ import { defineConfig } from '@modern-js/runtime';
43
+
44
+ const App = () => {
45
+ /** */
46
+ };
47
+
48
+ defineConfig(App, {
49
+ router: {
50
+ supportHtml5History: false
51
+ }
52
+ })
53
+
54
+ export default App;
55
+ ```
56
+
57
+ :::info
58
+ Using runtime configuration, you can solve the problem that runtime plugin configuration needs to be at runtime to get specific content.
59
+
60
+ Runtime plugin runtime configuration and configuration directly in `modern.config.ts` are merged by default, and runtime configuration takes precedence.
61
+ :::
62
+
63
+ :::warning
64
+ defineConfig 中只能定义 Runtime 插件的具体配置内容,确认是否开启插件还需要通过 `package.json` 中的 `modernConfig` 或者 `modern.config.ts` 中的配置决定。
65
+ :::
66
+
67
+ ### runtimeByEntries
68
+
69
+ * Type: `Object`
70
+
71
+ #### Introduce
72
+
73
+ Add the runtime configuration according to the entry. The option attribute is consistent with the runtime. The specified value will be replaced and merged with the content of the runtime attribute.
74
+
75
+ ```ts title="modern.config.ts"
76
+ import { defineConfig } from '@modern-js/app-tools';
77
+
78
+ export default defineConfig({
79
+ runtime: {
80
+ state: false,
81
+ },
82
+ runtimeByEntries: {
83
+ entry1: {
84
+ state: true, // { state: true }
85
+ },
86
+ entry2: { // { state: false, router: true }
87
+ router: true,
88
+ },
89
+ },
90
+ });
91
+ ```
@@ -0,0 +1,60 @@
1
+ ---
2
+ sidebar_label: masterApp
3
+ ---
4
+
5
+ # runtime.masterApp
6
+
7
+ * 类型: `Object`
8
+
9
+ :::info
10
+ First you need to enable the "micro frontend" function using [new command](/docs/apis/app/commands/new).
11
+ :::
12
+
13
+ ## `manifest`
14
+
15
+ The main application adds sub-application information.
16
+
17
+ * Type: `modules: Array<{
18
+ name: string;
19
+ entry: string;
20
+ activeWhen?: string;
21
+ }> | string;`
22
+ * Default: `null`
23
+
24
+ ### `modules`
25
+
26
+ When `modules` is an object type, it represents the information of the sub-application module.
27
+
28
+ - name: The name of the child application
29
+ - entry: The entry of the child application
30
+ - activeWhen?: The path of the child application
31
+
32
+ When `modules` is `string`, it is a url address, and requesting this address can get the same data structure as the `modules` object format.
33
+
34
+ ## `LoadingComponent`
35
+
36
+ * Type: `React.ComponentType | React.ElementType`
37
+ * Default: `null`
38
+
39
+ A transition animation to load when loading or switching child applications.
40
+
41
+ `LoadingComponent` needs to be configured with [defineConfig](/docs/apis/app/runtime/app/define-config).
42
+
43
+ ```tsx
44
+ import { defineConfig } from '@modern-js/runtime';
45
+
46
+ function App() {
47
+ ...
48
+ }
49
+
50
+ defineConfig(
51
+ App,
52
+ {
53
+ masterApp: {
54
+ LoadingComponent: () => {
55
+ return <div>loading...</div>
56
+ }
57
+ }
58
+ }
59
+ )
60
+ ```
@@ -0,0 +1,19 @@
1
+ ---
2
+ sidebar_label: router
3
+ ---
4
+
5
+ # runtime.router
6
+
7
+ * Type: `boolean | Object`
8
+ * Default: `false`。
9
+
10
+ When `router` is enabled, routing management using conventional routes provided by Modern.js default is supported.
11
+
12
+ 具体配置如下:
13
+
14
+ ### supportHtml5History
15
+
16
+ * Type: `Boolean`
17
+ * Default: `true`
18
+
19
+ If the value of `supportHtml5History` is `true`, the project will use `BrowserRouter`, otherwise `HashRouter`.
@@ -0,0 +1,41 @@
1
+ ---
2
+ sidebar_label: state
3
+ ---
4
+
5
+ # runtime.state
6
+
7
+ * Type:`boolean | object`
8
+ * Default: `false`
9
+
10
+ Once `state` is enabled, you can use [Model](/docs/guides/topic-detail/model/quick-start) for state management.
11
+
12
+ The specific configuration items are as follows:
13
+
14
+ ## `immer`
15
+
16
+ * Type:`boolean`
17
+ * Default: `true`
18
+
19
+ Whether to enable to update the state with mutable, it is enabled by default, and set to `false` if you want to disable it.
20
+
21
+ ## `effects`
22
+
23
+ * Type:`boolean`
24
+ * Default: `true`
25
+
26
+ Whether to enable the side effect management feature, it is enabled by default, and set to `false` if you want to disable it.
27
+
28
+ ## `autoActions`
29
+
30
+ * Type:`boolean`
31
+ * Default: `true`
32
+
33
+ Whether to enable the auto-generated actions feature, it is enabled by default, and set to `false` if you want to disable it.
34
+
35
+
36
+ ## `devtools`
37
+
38
+ * Type:`boolean | EnhancerOptions`
39
+ * Default: `true`
40
+
41
+ Whether to enable devtools, it is enabled by default, and all parameters of [redux-devtools-extension](https://github.com/zalmoxisus/redux-devtools-extension/blob/master/docs/API/Arguments.md) are supported at the same time. If you want to disable it, set it to `false`.
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  title: security.sri
3
3
  sidebar_label: sri
4
- sidebar_position: 1
5
4
  ---
6
5
 
7
6
  :::info BUILDER
@@ -0,0 +1,33 @@
1
+ ---
2
+ sidebar_label: baseUrl
3
+ ---
4
+
5
+ # server.baseUrl
6
+
7
+ * Type: `string | string[]`
8
+ * Default: `undefined`
9
+
10
+
11
+ Uniformly set the server-level routing prefix (often used in the case of shared domain names to distinguish traffic).
12
+
13
+ ```typescript title="modern.config.ts"
14
+ export default defineConfig({
15
+ server: {
16
+ // 所有生成的路由前面都会自动加上前缀 `/base`
17
+ // 生成的服务端路由文件路径:dist/route.json
18
+ baseUrl: '/base'
19
+
20
+ // 多 baseUrl
21
+ baseUrl: ['/base-new', '/base-old']
22
+ }
23
+ })
24
+ ```
25
+
26
+ After `dev`, you can see that the routed access will be prefixed accordingly:
27
+
28
+ ```bash
29
+ App running at:
30
+
31
+ > Local: http://localhost:8080/base/
32
+ > Network: http://192.168.0.1:8080/base/
33
+ ```
@@ -0,0 +1,18 @@
1
+ ---
2
+ sidebar_label: port
3
+ ---
4
+
5
+ # server.port
6
+
7
+ * Type: `Number`
8
+ * Default: `8080`
9
+
10
+ Modern.js' default port is '8080', when using the `dev` or `start` command. You can change the port number using this configuration:
11
+
12
+ ```js title="modern.config.ts"
13
+ export default defineConfig({
14
+ server: {
15
+ port: 3000,
16
+ }
17
+ });
18
+ ```
@@ -0,0 +1,26 @@
1
+ ---
2
+ sidebar_label: publicRoutes
3
+ ---
4
+
5
+ # server.publicRoutes
6
+
7
+ * Type: `Object`
8
+ * Default: Automatic generation of server-level routing rules based on file conventions: One routing rule is generated per file of the application.
9
+
10
+ This configuration option only applies to server-level routing, and you can customize the access route of resources in `config/public/`.
11
+
12
+ The `key` of the object is the relative file path of the current application (not used `./`), value can be `string`.
13
+
14
+ ```typescript title="modern.config.ts"
15
+ export default defineConfig({
16
+ server: {
17
+ publicRoutes: {
18
+ // Set up a long route
19
+ 'index.json': '/user-config/card-info/extra/help.json',
20
+
21
+ // Set up a route without a suffix
22
+ 'robot.txt': '/app/authentication'
23
+ }
24
+ }
25
+ });
26
+ ```
@@ -0,0 +1,91 @@
1
+ ---
2
+ sidebar_label: routes
3
+ ---
4
+
5
+ # server.routes
6
+
7
+ * Type: `Object`
8
+ * Default: Automatic generation of server-level routing rules based on file conventions: One routing rule is generated per file of the application,and the default route is the same as the entry name.
9
+
10
+ This configuration option only applies to server-level routing, and can customize the service access configuration of the application entry.
11
+
12
+ ## Custom access routing
13
+
14
+ The `key` of the object is the entry name of the current application, and the value can be `string | Array<string>`.
15
+
16
+ When the value type is `string`, the current value represents the name of the route to access the entry.
17
+
18
+ ```typescript title="modern.config.ts"
19
+ export default defineConfig({
20
+ server: {
21
+ routes: {
22
+ // The default route is /entryName1, /p/test1 after customization
23
+ entryName1: '/p/test1'
24
+ // Support dynamic server-level routing configuration
25
+ entryName2: '/detail/:id'
26
+ }
27
+ }
28
+ });
29
+ ```
30
+
31
+ Multiple access routes can also be set for entries using the `Array<string>`:
32
+
33
+ ```typescript title="modern.config.ts"
34
+ export default defineConfig({
35
+ server: {
36
+ routes: {
37
+ 'page-a': [`/a`, '/b'],
38
+ },
39
+ },
40
+ });
41
+ ```
42
+
43
+ At this point, the '`page-a` entry can be accessed through both `/a` and `/b` routes.
44
+
45
+ After executing the `dev` command, you can see in `dist/route.json` that there are two routing records in the entry `page-a`:
46
+
47
+ ```json
48
+ {
49
+ "routes": [
50
+ {
51
+ "urlPath": "/a",
52
+ "entryName": "page-a",
53
+ "entryPath": "html/page-a/index.html",
54
+ "isSPA": true,
55
+ "isSSR": false,
56
+ "enableModernMode": false
57
+ },
58
+ {
59
+ "urlPath": "/b",
60
+ "entryName": "page-a",
61
+ "entryPath": "html/page-a/index.html",
62
+ "isSPA": true,
63
+ "isSSR": false,
64
+ "enableModernMode": false
65
+ },
66
+ ]
67
+ }
68
+ ```
69
+
70
+ ## Custom response header
71
+
72
+ The response header can be set by configuring the resHeaders of the entry:
73
+
74
+ ```typescript title="modern.config.ts"
75
+ export default defineConfig({
76
+ server: {
77
+ routes: {
78
+ 'page-a': {
79
+ route: ['/a', '/b'],
80
+ resHeaders: {
81
+ 'x-modern-test': '1',
82
+ },
83
+ },
84
+ },
85
+ },
86
+ });
87
+ ```
88
+
89
+ :::note
90
+ This configuration takes effect in both the production environment and the development environment, and can set different response headers according to the NODE_ENV. But if you only need to set response headers in the development environment, `tools.devServer.headers` is recommended.
91
+ :::
@@ -0,0 +1,28 @@
1
+ ---
2
+ sidebar_label: ssrByEntries
3
+ ---
4
+
5
+ # server.ssrByEntries
6
+
7
+ * Type: `Object`
8
+ * Default: `undefined`
9
+
10
+ Set the ssr option according to the entry. The attributes in the option are the same as [ssr](./ssr.md). The specified value will be replaced and merged with the content of the ssr attribute. For example:
11
+
12
+ :::info
13
+ The "entry name" defaults to the directory name. In a few cases, when the entry is customized by `source.entries`, the entry name `source.entries` the `key` of the object.
14
+ :::
15
+
16
+ ```typescript title="modern.config.ts"
17
+ export default defineConfig({
18
+ server: {
19
+ ssr: true,
20
+ ssrByEntries: {
21
+ // page-a does not enable ssr
22
+ 'page-a': false,
23
+ }
24
+ }
25
+ });
26
+ ```
27
+
28
+ As configured above, the project has ssr enabled as a whole, but the ssr rendering capability is turned off for the entry `page-a`.
@@ -0,0 +1,20 @@
1
+ ---
2
+ sidebar_label: ssr
3
+ ---
4
+
5
+ # server.ssr
6
+
7
+ * Type: `boolean`
8
+ * Default: `false`
9
+
10
+ Enalbe SSR configuration.
11
+
12
+ When the value type is `boolean`, it indicates whether to enable SSR deployment mode, and `false` is not enabled by default.
13
+
14
+ ```typescript title="modern.config.ts"
15
+ export default defineConfig({
16
+ server: {
17
+ ssr: true,
18
+ }
19
+ });
20
+ ```
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  title: source.alias
3
3
  sidebar_label: alias
4
- sidebar_position: 1
5
4
  ---
6
5
 
7
6
  :::info BUILDER
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  title: source.compileJsDataURI
3
3
  sidebar_label: compileJsDataURI
4
- sidebar_position: 1
5
4
  ---
6
5
 
7
6
  :::info BUILDER
@@ -0,0 +1,23 @@
1
+ ---
2
+ title: source.configDir
3
+ sidebar_label: configDir
4
+ ---
5
+
6
+ * Type: `string`
7
+ * Default: `./config`
8
+
9
+ Modern.js supports placing some files in the `./config` folder to customize HTML templates, icons, static resources, etc. For details, please refer to [File Convention](/docs/apis/app/hooks/config/html).
10
+
11
+ This option allows you to customize the directory of configuration files.
12
+
13
+ For example, adjust the resource file directory to the `resources` directory:
14
+
15
+ ```js title="modern.config.ts"
16
+ import { defineConfig } from '@modern-js/app-tools';
17
+
18
+ export default defineConfig({
19
+ source: {
20
+ configDir: './resources',
21
+ },
22
+ });
23
+ ```
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  title: source.define
3
3
  sidebar_label: define
4
- sidebar_position: 1
5
4
  ---
6
5
 
7
6
  :::info BUILDER