@modern-js/main-doc 2.3.0 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (212) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/en/components/init-app.mdx +1 -1
  3. package/en/configure/app/dev/asset-prefix.mdx +1 -1
  4. package/en/configure/app/dev/hmr.mdx +1 -1
  5. package/en/configure/app/dev/https.mdx +1 -1
  6. package/en/configure/app/dev/port.mdx +1 -1
  7. package/en/configure/app/dev/progress-bar.mdx +1 -1
  8. package/en/configure/app/dev/start-url.mdx +1 -1
  9. package/en/configure/app/experiments/lazy-compilation.mdx +1 -1
  10. package/en/configure/app/html/app-icon.mdx +1 -1
  11. package/en/configure/app/html/crossorigin.mdx +1 -1
  12. package/en/configure/app/html/disable-html-folder.mdx +1 -1
  13. package/en/configure/app/html/favicon-by-entries.mdx +1 -1
  14. package/en/configure/app/html/favicon.mdx +1 -1
  15. package/en/configure/app/html/inject-by-entries.mdx +1 -1
  16. package/en/configure/app/html/inject.mdx +1 -1
  17. package/en/configure/app/html/meta-by-entries.mdx +1 -1
  18. package/en/configure/app/html/meta.mdx +1 -1
  19. package/en/configure/app/html/mount-id.mdx +1 -1
  20. package/en/configure/app/html/tags-by-entries.mdx +1 -1
  21. package/en/configure/app/html/tags.mdx +1 -1
  22. package/en/configure/app/html/template-by-entries.mdx +1 -1
  23. package/en/configure/app/html/template-parameters-by-entries.mdx +1 -1
  24. package/en/configure/app/html/template-parameters.mdx +1 -1
  25. package/en/configure/app/html/template.mdx +1 -1
  26. package/en/configure/app/html/title-by-entries.mdx +1 -1
  27. package/en/configure/app/html/title.mdx +1 -1
  28. package/en/configure/app/output/asset-prefix.mdx +1 -1
  29. package/en/configure/app/output/assets-retry.mdx +1 -1
  30. package/en/configure/app/output/charset.mdx +1 -1
  31. package/en/configure/app/output/clean-dist-path.mdx +1 -1
  32. package/en/configure/app/output/convert-to-rem.mdx +1 -1
  33. package/en/configure/app/output/copy.mdx +1 -1
  34. package/en/configure/app/output/css-module-local-ident-name.mdx +1 -1
  35. package/en/configure/app/output/data-uri-limit.mdx +1 -1
  36. package/en/configure/app/output/disable-css-extract.mdx +1 -1
  37. package/en/configure/app/output/disable-css-module-extension.mdx +1 -1
  38. package/en/configure/app/output/disable-filename-hash.mdx +1 -1
  39. package/en/configure/app/output/disable-inline-runtime-chunk.mdx +1 -1
  40. package/en/configure/app/output/disable-minimize.mdx +1 -1
  41. package/en/configure/app/output/disable-source-map.mdx +1 -1
  42. package/en/configure/app/output/disable-ts-checker.mdx +1 -1
  43. package/en/configure/app/output/dist-path.mdx +1 -1
  44. package/en/configure/app/output/enable-asset-fallback.mdx +1 -1
  45. package/en/configure/app/output/enable-asset-manifest.mdx +1 -1
  46. package/en/configure/app/output/enable-css-module-tsdeclaration.mdx +1 -1
  47. package/en/configure/app/output/enable-inline-scripts.mdx +1 -1
  48. package/en/configure/app/output/enable-inline-styles.mdx +1 -1
  49. package/en/configure/app/output/enable-latest-decorators.mdx +1 -1
  50. package/en/configure/app/output/externals.mdx +1 -1
  51. package/en/configure/app/output/filename.mdx +1 -1
  52. package/en/configure/app/output/legal-comments.mdx +1 -1
  53. package/en/configure/app/output/override-browserslist.mdx +1 -1
  54. package/en/configure/app/output/polyfill.mdx +1 -1
  55. package/en/configure/app/output/svg-default-export.mdx +1 -1
  56. package/en/configure/app/performance/build-cache.mdx +1 -1
  57. package/en/configure/app/performance/bundle-analyze.mdx +1 -1
  58. package/en/configure/app/performance/chunk-split.mdx +1 -1
  59. package/en/configure/app/performance/print-file-size.mdx +1 -1
  60. package/en/configure/app/performance/profile.mdx +1 -1
  61. package/en/configure/app/performance/remove-console.mdx +1 -1
  62. package/en/configure/app/performance/remove-moment-locale.mdx +1 -1
  63. package/en/configure/app/security/check-syntax.mdx +1 -1
  64. package/en/configure/app/security/sri.mdx +1 -1
  65. package/en/configure/app/source/alias.mdx +1 -1
  66. package/en/configure/app/source/compile-js-data-uri.mdx +1 -1
  67. package/en/configure/app/source/define.mdx +1 -1
  68. package/en/configure/app/source/exclude.mdx +1 -1
  69. package/en/configure/app/source/global-vars.mdx +1 -1
  70. package/en/configure/app/source/include.mdx +1 -1
  71. package/en/configure/app/source/module-scopes.mdx +1 -1
  72. package/en/configure/app/source/pre-entry.mdx +1 -1
  73. package/en/configure/app/source/resolve-extension-prefix.mdx +1 -1
  74. package/en/configure/app/source/resolve-main-fields.mdx +1 -1
  75. package/en/configure/app/tools/autoprefixer.mdx +1 -1
  76. package/en/configure/app/tools/babel.mdx +1 -1
  77. package/en/configure/app/tools/css-extract.mdx +1 -1
  78. package/en/configure/app/tools/css-loader.mdx +1 -1
  79. package/en/configure/app/tools/dev-server.mdx +1 -1
  80. package/en/configure/app/tools/html-plugin.mdx +1 -1
  81. package/en/configure/app/tools/inspector.mdx +1 -1
  82. package/en/configure/app/tools/less.mdx +1 -1
  83. package/en/configure/app/tools/minify-css.mdx +1 -1
  84. package/en/configure/app/tools/postcss.mdx +1 -1
  85. package/en/configure/app/tools/pug.mdx +1 -1
  86. package/en/configure/app/tools/sass.mdx +1 -1
  87. package/en/configure/app/tools/style-loader.mdx +1 -1
  88. package/en/configure/app/tools/styled-components.mdx +1 -1
  89. package/en/configure/app/tools/terser.mdx +1 -1
  90. package/en/configure/app/tools/ts-checker.mdx +1 -1
  91. package/en/configure/app/tools/ts-loader.mdx +1 -1
  92. package/en/configure/app/tools/webpack-chain.mdx +1 -1
  93. package/en/configure/app/tools/webpack.mdx +1 -1
  94. package/en/configure/app/usage.mdx +63 -0
  95. package/en/guides/advanced-features/_category_.json +5 -0
  96. package/en/guides/advanced-features/ssr.mdx +2 -2
  97. package/en/guides/basic-features/_category_.json +5 -0
  98. package/en/guides/basic-features/builder.mdx +1 -1
  99. package/en/guides/basic-features/routes.mdx +28 -0
  100. package/en/guides/concept/_category_.json +5 -0
  101. package/en/guides/get-started/_category_.json +5 -0
  102. package/en/guides/topic-detail/generator/config/{mwa.mdx → app.mdx} +1 -1
  103. package/en/guides/topic-detail/generator/plugin/api/new/createElement.mdx +1 -1
  104. package/en/guides/topic-detail/generator/plugin/api/new/enableFunc.mdx +1 -1
  105. package/en/guides/topic-detail/generator/plugin/api/new/introduce.mdx +1 -1
  106. package/en/guides/topic-detail/generator/plugin/develop.mdx +2 -2
  107. package/package.json +3 -3
  108. package/scripts/config.ts +1 -1
  109. package/zh/components/custom-router-micro-frontend.mdx +40 -0
  110. package/zh/components/enable-micro-frontend.mdx +12 -2
  111. package/zh/components/micro-runtime-config.mdx +9 -10
  112. package/zh/configure/app/dev/asset-prefix.mdx +1 -1
  113. package/zh/configure/app/dev/hmr.mdx +1 -1
  114. package/zh/configure/app/dev/https.mdx +1 -1
  115. package/zh/configure/app/dev/port.mdx +1 -1
  116. package/zh/configure/app/dev/progress-bar.mdx +1 -1
  117. package/zh/configure/app/dev/start-url.mdx +1 -1
  118. package/zh/configure/app/experiments/lazy-compilation.mdx +1 -1
  119. package/zh/configure/app/html/app-icon.mdx +1 -1
  120. package/zh/configure/app/html/crossorigin.mdx +1 -1
  121. package/zh/configure/app/html/disable-html-folder.mdx +1 -1
  122. package/zh/configure/app/html/favicon-by-entries.mdx +1 -1
  123. package/zh/configure/app/html/favicon.mdx +1 -1
  124. package/zh/configure/app/html/inject-by-entries.mdx +1 -1
  125. package/zh/configure/app/html/inject.mdx +1 -1
  126. package/zh/configure/app/html/meta-by-entries.mdx +1 -1
  127. package/zh/configure/app/html/meta.mdx +1 -1
  128. package/zh/configure/app/html/mount-id.mdx +1 -1
  129. package/zh/configure/app/html/tags-by-entries.mdx +1 -1
  130. package/zh/configure/app/html/tags.mdx +1 -1
  131. package/zh/configure/app/html/template-by-entries.mdx +1 -1
  132. package/zh/configure/app/html/template-parameters-by-entries.mdx +1 -1
  133. package/zh/configure/app/html/template-parameters.mdx +1 -1
  134. package/zh/configure/app/html/template.mdx +1 -1
  135. package/zh/configure/app/html/title-by-entries.mdx +1 -1
  136. package/zh/configure/app/html/title.mdx +1 -1
  137. package/zh/configure/app/output/asset-prefix.mdx +1 -1
  138. package/zh/configure/app/output/assets-retry.mdx +1 -1
  139. package/zh/configure/app/output/charset.mdx +1 -1
  140. package/zh/configure/app/output/clean-dist-path.mdx +1 -1
  141. package/zh/configure/app/output/convert-to-rem.mdx +1 -1
  142. package/zh/configure/app/output/copy.mdx +1 -1
  143. package/zh/configure/app/output/css-module-local-ident-name.mdx +1 -1
  144. package/zh/configure/app/output/data-uri-limit.mdx +1 -1
  145. package/zh/configure/app/output/disable-css-extract.mdx +1 -1
  146. package/zh/configure/app/output/disable-css-module-extension.mdx +1 -1
  147. package/zh/configure/app/output/disable-filename-hash.mdx +1 -1
  148. package/zh/configure/app/output/disable-inline-runtime-chunk.mdx +1 -1
  149. package/zh/configure/app/output/disable-minimize.mdx +1 -1
  150. package/zh/configure/app/output/disable-source-map.mdx +1 -1
  151. package/zh/configure/app/output/disable-ts-checker.mdx +1 -1
  152. package/zh/configure/app/output/dist-path.mdx +1 -1
  153. package/zh/configure/app/output/enable-asset-fallback.mdx +1 -1
  154. package/zh/configure/app/output/enable-asset-manifest.mdx +1 -1
  155. package/zh/configure/app/output/enable-css-module-tsdeclaration.mdx +1 -1
  156. package/zh/configure/app/output/enable-inline-scripts.mdx +1 -1
  157. package/zh/configure/app/output/enable-inline-styles.mdx +1 -1
  158. package/zh/configure/app/output/enable-latest-decorators.mdx +1 -1
  159. package/zh/configure/app/output/externals.mdx +1 -1
  160. package/zh/configure/app/output/filename.mdx +1 -1
  161. package/zh/configure/app/output/legal-comments.mdx +1 -1
  162. package/zh/configure/app/output/override-browserslist.mdx +1 -1
  163. package/zh/configure/app/output/polyfill.mdx +1 -1
  164. package/zh/configure/app/output/svg-default-export.mdx +1 -1
  165. package/zh/configure/app/performance/build-cache.mdx +1 -1
  166. package/zh/configure/app/performance/bundle-analyze.mdx +1 -1
  167. package/zh/configure/app/performance/chunk-split.mdx +1 -1
  168. package/zh/configure/app/performance/print-file-size.mdx +1 -1
  169. package/zh/configure/app/performance/profile.mdx +1 -1
  170. package/zh/configure/app/performance/remove-console.mdx +1 -1
  171. package/zh/configure/app/performance/remove-moment-locale.mdx +1 -1
  172. package/zh/configure/app/security/check-syntax.mdx +1 -1
  173. package/zh/configure/app/security/sri.mdx +1 -1
  174. package/zh/configure/app/source/alias.mdx +1 -1
  175. package/zh/configure/app/source/compile-js-data-uri.mdx +1 -1
  176. package/zh/configure/app/source/define.mdx +1 -1
  177. package/zh/configure/app/source/exclude.mdx +1 -1
  178. package/zh/configure/app/source/global-vars.mdx +1 -1
  179. package/zh/configure/app/source/include.mdx +1 -1
  180. package/zh/configure/app/source/module-scopes.mdx +1 -1
  181. package/zh/configure/app/source/pre-entry.mdx +1 -1
  182. package/zh/configure/app/source/resolve-extension-prefix.mdx +1 -1
  183. package/zh/configure/app/source/resolve-main-fields.mdx +1 -1
  184. package/zh/configure/app/tools/autoprefixer.mdx +1 -1
  185. package/zh/configure/app/tools/babel.mdx +1 -1
  186. package/zh/configure/app/tools/css-extract.mdx +1 -1
  187. package/zh/configure/app/tools/css-loader.mdx +1 -1
  188. package/zh/configure/app/tools/dev-server.mdx +1 -1
  189. package/zh/configure/app/tools/html-plugin.mdx +1 -1
  190. package/zh/configure/app/tools/inspector.mdx +1 -1
  191. package/zh/configure/app/tools/less.mdx +1 -1
  192. package/zh/configure/app/tools/minify-css.mdx +1 -1
  193. package/zh/configure/app/tools/postcss.mdx +1 -1
  194. package/zh/configure/app/tools/pug.mdx +1 -1
  195. package/zh/configure/app/tools/sass.mdx +1 -1
  196. package/zh/configure/app/tools/style-loader.mdx +1 -1
  197. package/zh/configure/app/tools/styled-components.mdx +1 -1
  198. package/zh/configure/app/tools/terser.mdx +1 -1
  199. package/zh/configure/app/tools/ts-checker.mdx +1 -1
  200. package/zh/configure/app/tools/ts-loader.mdx +1 -1
  201. package/zh/configure/app/tools/webpack-chain.mdx +1 -1
  202. package/zh/configure/app/tools/webpack.mdx +1 -1
  203. package/zh/configure/app/usage.mdx +63 -0
  204. package/zh/guides/advanced-features/ssr.mdx +2 -2
  205. package/zh/guides/basic-features/routes.mdx +28 -1
  206. package/zh/guides/topic-detail/generator/config/{mwa.mdx → app.mdx} +1 -1
  207. package/zh/guides/topic-detail/generator/plugin/api/new/createElement.mdx +1 -1
  208. package/zh/guides/topic-detail/generator/plugin/api/new/enableFunc.mdx +1 -1
  209. package/zh/guides/topic-detail/generator/plugin/api/new/introduce.mdx +2 -2
  210. package/zh/guides/topic-detail/generator/plugin/develop.mdx +3 -3
  211. package/zh/guides/topic-detail/micro-frontend/c02-development.mdx +128 -61
  212. package/zh/guides/topic-detail/micro-frontend/c03-main-app.mdx +71 -40
@@ -5,7 +5,7 @@ sidebar_label: printFileSize
5
5
  # performance.printFileSize
6
6
 
7
7
  :::tip
8
- This config is provided by Modern.js Builder, more detail can see [performance.printFileSize](https://modernjs.dev/builder/en/api/config-performance.html#performance-printfilesize)。
8
+ This config is provided by Modern.js Builder, more detail can see [performance.printFileSize](https://modernjs.dev/builder/en/api/config-performance.html#performanceprintfilesize)。
9
9
  :::
10
10
 
11
11
  import Main from '@modern-js/builder-doc/docs/en/config/performance/printFileSize.md'
@@ -5,7 +5,7 @@ sidebar_label: profile
5
5
  # performance.profile
6
6
 
7
7
  :::tip
8
- This config is provided by Modern.js Builder, more detail can see [performance.profile](https://modernjs.dev/builder/en/api/config-performance.html#performance-profile)。
8
+ This config is provided by Modern.js Builder, more detail can see [performance.profile](https://modernjs.dev/builder/en/api/config-performance.html#performanceprofile)。
9
9
  :::
10
10
 
11
11
  import Main from '@modern-js/builder-doc/docs/en/config/performance/profile.md'
@@ -5,7 +5,7 @@ sidebar_label: removeConsole
5
5
  # performance.removeConsole
6
6
 
7
7
  :::tip
8
- This config is provided by Modern.js Builder, more detail can see [performance.removeConsole](https://modernjs.dev/builder/en/api/config-performance.html#performance-removeconsole)。
8
+ This config is provided by Modern.js Builder, more detail can see [performance.removeConsole](https://modernjs.dev/builder/en/api/config-performance.html#performanceremoveconsole)。
9
9
  :::
10
10
 
11
11
  import Main from '@modern-js/builder-doc/docs/en/config/performance/removeConsole.md'
@@ -5,7 +5,7 @@ sidebar_label: removeMomentLocale
5
5
  # performance.removeMomentLocale
6
6
 
7
7
  :::tip
8
- This config is provided by Modern.js Builder, more detail can see [performance.removeMomentLocale](https://modernjs.dev/builder/en/api/config-performance.html#performance-removemomentlocale)。
8
+ This config is provided by Modern.js Builder, more detail can see [performance.removeMomentLocale](https://modernjs.dev/builder/en/api/config-performance.html#performanceremovemomentlocale)。
9
9
  :::
10
10
 
11
11
  import Main from '@modern-js/builder-doc/docs/en/config/performance/removeMomentLocale.md'
@@ -5,7 +5,7 @@ sidebar_label: checkSyntax
5
5
  # security.checkSyntax
6
6
 
7
7
  :::tip
8
- This config is provided by Modern.js Builder, more detail can see [security.checkSyntax](https://modernjs.dev/builder/en/api/config-security.html#security-checksyntax)。
8
+ This config is provided by Modern.js Builder, more detail can see [security.checkSyntax](https://modernjs.dev/builder/en/api/config-security.html#securitychecksyntax)。
9
9
  :::
10
10
 
11
11
  import Main from '@modern-js/builder-doc/docs/en/config/security/checkSyntax.md'
@@ -5,7 +5,7 @@ sidebar_label: sri
5
5
  # security.sri
6
6
 
7
7
  :::tip
8
- This config is provided by Modern.js Builder, more detail can see [security.sri](https://modernjs.dev/builder/en/api/config-security.html#security-sri)。
8
+ This config is provided by Modern.js Builder, more detail can see [security.sri](https://modernjs.dev/builder/en/api/config-security.html#securitysri)。
9
9
  :::
10
10
 
11
11
  import Main from '@modern-js/builder-doc/docs/en/config/security/sri.md'
@@ -5,7 +5,7 @@ sidebar_label: alias
5
5
  # source.alias
6
6
 
7
7
  :::tip
8
- This config is provided by Modern.js Builder, more detail can see [source.alias](https://modernjs.dev/builder/en/api/config-source.html#source-alias)。
8
+ This config is provided by Modern.js Builder, more detail can see [source.alias](https://modernjs.dev/builder/en/api/config-source.html#sourcealias)。
9
9
  :::
10
10
 
11
11
  import Main from '@modern-js/builder-doc/docs/en/config/source/alias.md'
@@ -5,7 +5,7 @@ sidebar_label: compileJsDataURI
5
5
  # source.compileJsDataURI
6
6
 
7
7
  :::tip
8
- This config is provided by Modern.js Builder, more detail can see [source.compileJsDataURI](https://modernjs.dev/builder/en/api/config-source.html#source-compilejsdatauri)。
8
+ This config is provided by Modern.js Builder, more detail can see [source.compileJsDataURI](https://modernjs.dev/builder/en/api/config-source.html#sourcecompilejsdatauri)。
9
9
  :::
10
10
 
11
11
  import Main from '@modern-js/builder-doc/docs/en/config/source/compileJsDataURI.md'
@@ -5,7 +5,7 @@ sidebar_label: define
5
5
  # source.define
6
6
 
7
7
  :::tip
8
- This config is provided by Modern.js Builder, more detail can see [source.define](https://modernjs.dev/builder/en/api/config-source.html#source-define)。
8
+ This config is provided by Modern.js Builder, more detail can see [source.define](https://modernjs.dev/builder/en/api/config-source.html#sourcedefine)。
9
9
  :::
10
10
 
11
11
  import Main from '@modern-js/builder-doc/docs/en/config/source/define.md'
@@ -5,7 +5,7 @@ sidebar_label: exclude
5
5
  # source.exclude
6
6
 
7
7
  :::tip
8
- This config is provided by Modern.js Builder, more detail can see [source.exclude](https://modernjs.dev/builder/en/api/config-source.html#source-exclude)。
8
+ This config is provided by Modern.js Builder, more detail can see [source.exclude](https://modernjs.dev/builder/en/api/config-source.html#sourceexclude)。
9
9
  :::
10
10
 
11
11
  import Main from '@modern-js/builder-doc/docs/en/config/source/exclude.md'
@@ -5,7 +5,7 @@ sidebar_label: globalVars
5
5
  # source.globalVars
6
6
 
7
7
  :::tip
8
- This config is provided by Modern.js Builder, more detail can see [source.globalVars](https://modernjs.dev/builder/en/api/config-source.html#source-globalvars)。
8
+ This config is provided by Modern.js Builder, more detail can see [source.globalVars](https://modernjs.dev/builder/en/api/config-source.html#sourceglobalvars)。
9
9
  :::
10
10
 
11
11
  import Main from '@modern-js/builder-doc/docs/en/config/source/globalVars.md'
@@ -5,7 +5,7 @@ sidebar_label: include
5
5
  # source.include
6
6
 
7
7
  :::tip
8
- This config is provided by Modern.js Builder, more detail can see [source.include](https://modernjs.dev/builder/en/api/config-source.html#source-include)。
8
+ This config is provided by Modern.js Builder, more detail can see [source.include](https://modernjs.dev/builder/en/api/config-source.html#sourceinclude)。
9
9
  :::
10
10
 
11
11
  import Main from '@modern-js/builder-doc/docs/en/config/source/include.md'
@@ -5,7 +5,7 @@ sidebar_label: moduleScopes
5
5
  # source.moduleScopes
6
6
 
7
7
  :::tip
8
- This config is provided by Modern.js Builder, more detail can see [source.moduleScopes](https://modernjs.dev/builder/en/api/config-source.html#source-modulescopes)。
8
+ This config is provided by Modern.js Builder, more detail can see [source.moduleScopes](https://modernjs.dev/builder/en/api/config-source.html#sourcemodulescopes)。
9
9
  :::
10
10
 
11
11
  import Main from '@modern-js/builder-doc/docs/en/config/source/moduleScopes.md'
@@ -5,7 +5,7 @@ sidebar_label: preEntry
5
5
  # source.preEntry
6
6
 
7
7
  :::tip
8
- This config is provided by Modern.js Builder, more detail can see [source.preEntry](https://modernjs.dev/builder/en/api/config-source.html#source-preentry)。
8
+ This config is provided by Modern.js Builder, more detail can see [source.preEntry](https://modernjs.dev/builder/en/api/config-source.html#sourcepreentry)。
9
9
  :::
10
10
 
11
11
  import Main from '@modern-js/builder-doc/docs/en/config/source/preEntry.md'
@@ -5,7 +5,7 @@ sidebar_label: resolveExtensionPrefix
5
5
  # source.resolveExtensionPrefix
6
6
 
7
7
  :::tip
8
- This config is provided by Modern.js Builder, more detail can see [source.resolveExtensionPrefix](https://modernjs.dev/builder/en/api/config-source.html#source-resolveextensionprefix)。
8
+ This config is provided by Modern.js Builder, more detail can see [source.resolveExtensionPrefix](https://modernjs.dev/builder/en/api/config-source.html#sourceresolveextensionprefix)。
9
9
  :::
10
10
 
11
11
  import Main from '@modern-js/builder-doc/docs/en/config/source/resolveExtensionPrefix.md'
@@ -5,7 +5,7 @@ sidebar_label: resolveMainFields
5
5
  # source.resolveMainFields
6
6
 
7
7
  :::tip
8
- This config is provided by Modern.js Builder, more detail can see [source.resolveMainFields](https://modernjs.dev/builder/en/api/config-source.html#source-resolvemainfields)。
8
+ This config is provided by Modern.js Builder, more detail can see [source.resolveMainFields](https://modernjs.dev/builder/en/api/config-source.html#sourceresolvemainfields)。
9
9
  :::
10
10
 
11
11
  import Main from '@modern-js/builder-doc/docs/en/config/source/resolveMainFields.md'
@@ -5,7 +5,7 @@ sidebar_label: autoprefixer
5
5
  # tools.autoprefixer
6
6
 
7
7
  :::tip
8
- This config is provided by Modern.js Builder, more detail can see [tools.autoprefixer](https://modernjs.dev/builder/en/api/config-tools.html#tools-autoprefixer)。
8
+ This config is provided by Modern.js Builder, more detail can see [tools.autoprefixer](https://modernjs.dev/builder/en/api/config-tools.html#toolsautoprefixer)。
9
9
  :::
10
10
 
11
11
  import Main from '@modern-js/builder-doc/docs/en/config/tools/autoprefixer.md'
@@ -5,7 +5,7 @@ sidebar_label: babel
5
5
  # tools.babel
6
6
 
7
7
  :::tip
8
- This config is provided by Modern.js Builder, more detail can see [tools.babel](https://modernjs.dev/builder/en/api/config-tools.html#tools-babel)。
8
+ This config is provided by Modern.js Builder, more detail can see [tools.babel](https://modernjs.dev/builder/en/api/config-tools.html#toolsbabel)。
9
9
  :::
10
10
 
11
11
  import Main from '@modern-js/builder-doc/docs/en/config/tools/babel.md'
@@ -5,7 +5,7 @@ sidebar_label: cssExtract
5
5
  # tools.cssExtract
6
6
 
7
7
  :::tip
8
- This config is provided by Modern.js Builder, more detail can see [tools.cssExtract](https://modernjs.dev/builder/en/api/config-tools.html#tools-cssextract)。
8
+ This config is provided by Modern.js Builder, more detail can see [tools.cssExtract](https://modernjs.dev/builder/en/api/config-tools.html#toolscssextract)。
9
9
  :::
10
10
 
11
11
  import Main from '@modern-js/builder-doc/docs/en/config/tools/cssExtract.md'
@@ -5,7 +5,7 @@ sidebar_label: cssLoader
5
5
  # tools.cssLoader
6
6
 
7
7
  :::tip
8
- This config is provided by Modern.js Builder, more detail can see [tools.cssLoader](https://modernjs.dev/builder/en/api/config-tools.html#tools-cssloader)。
8
+ This config is provided by Modern.js Builder, more detail can see [tools.cssLoader](https://modernjs.dev/builder/en/api/config-tools.html#toolscssloader)。
9
9
  :::
10
10
 
11
11
  import Main from '@modern-js/builder-doc/docs/en/config/tools/cssLoader.md'
@@ -5,7 +5,7 @@ sidebar_label: devServer
5
5
  # tools.devServer
6
6
 
7
7
  :::tip
8
- This config is provided by Modern.js Builder, more detail can see [tools.devServer](https://modernjs.dev/builder/en/api/config-tools.html#tools-devserver)。
8
+ This config is provided by Modern.js Builder, more detail can see [tools.devServer](https://modernjs.dev/builder/en/api/config-tools.html#toolsdevserver)。
9
9
  :::
10
10
 
11
11
  import Main from '@modern-js/builder-doc/docs/en/config/tools/devServer.md'
@@ -5,7 +5,7 @@ sidebar_label: htmlPlugin
5
5
  # tools.htmlPlugin
6
6
 
7
7
  :::tip
8
- This config is provided by Modern.js Builder, more detail can see [tools.htmlPlugin](https://modernjs.dev/builder/en/api/config-tools.html#tools-htmlplugin)。
8
+ This config is provided by Modern.js Builder, more detail can see [tools.htmlPlugin](https://modernjs.dev/builder/en/api/config-tools.html#toolshtmlplugin)。
9
9
  :::
10
10
 
11
11
  import Main from '@modern-js/builder-doc/docs/en/config/tools/htmlPlugin.md'
@@ -5,7 +5,7 @@ sidebar_label: inspector
5
5
  # tools.inspector
6
6
 
7
7
  :::tip
8
- This config is provided by Modern.js Builder, more detail can see [tools.inspector](https://modernjs.dev/builder/en/api/config-tools.html#tools-inspector)。
8
+ This config is provided by Modern.js Builder, more detail can see [tools.inspector](https://modernjs.dev/builder/en/api/config-tools.html#toolsinspector)。
9
9
  :::
10
10
 
11
11
  import Main from '@modern-js/builder-doc/docs/en/config/tools/inspector.md'
@@ -5,7 +5,7 @@ sidebar_label: less
5
5
  # tools.less
6
6
 
7
7
  :::tip
8
- This config is provided by Modern.js Builder, more detail can see [tools.less](https://modernjs.dev/builder/en/api/config-tools.html#tools-less)。
8
+ This config is provided by Modern.js Builder, more detail can see [tools.less](https://modernjs.dev/builder/en/api/config-tools.html#toolsless)。
9
9
  :::
10
10
 
11
11
  import Main from '@modern-js/builder-doc/docs/en/config/tools/less.md'
@@ -5,7 +5,7 @@ sidebar_label: minifyCss
5
5
  # tools.minifyCss
6
6
 
7
7
  :::tip
8
- This config is provided by Modern.js Builder, more detail can see [tools.minifyCss](https://modernjs.dev/builder/en/api/config-tools.html#tools-minifycss)。
8
+ This config is provided by Modern.js Builder, more detail can see [tools.minifyCss](https://modernjs.dev/builder/en/api/config-tools.html#toolsminifycss)。
9
9
  :::
10
10
 
11
11
  import Main from '@modern-js/builder-doc/docs/en/config/tools/minifyCss.md'
@@ -5,7 +5,7 @@ sidebar_label: postcss
5
5
  # tools.postcss
6
6
 
7
7
  :::tip
8
- This config is provided by Modern.js Builder, more detail can see [tools.postcss](https://modernjs.dev/builder/en/api/config-tools.html#tools-postcss)。
8
+ This config is provided by Modern.js Builder, more detail can see [tools.postcss](https://modernjs.dev/builder/en/api/config-tools.html#toolspostcss)。
9
9
  :::
10
10
 
11
11
  import Main from '@modern-js/builder-doc/docs/en/config/tools/postcss.md'
@@ -5,7 +5,7 @@ sidebar_label: pug
5
5
  # tools.pug
6
6
 
7
7
  :::tip
8
- This config is provided by Modern.js Builder, more detail can see [tools.pug](https://modernjs.dev/builder/en/api/config-tools.html#tools-pug)。
8
+ This config is provided by Modern.js Builder, more detail can see [tools.pug](https://modernjs.dev/builder/en/api/config-tools.html#toolspug)。
9
9
  :::
10
10
 
11
11
  import Main from '@modern-js/builder-doc/docs/en/config/tools/pug.md'
@@ -5,7 +5,7 @@ sidebar_label: sass
5
5
  # tools.sass
6
6
 
7
7
  :::tip
8
- This config is provided by Modern.js Builder, more detail can see [tools.sass](https://modernjs.dev/builder/en/api/config-tools.html#tools-sass)。
8
+ This config is provided by Modern.js Builder, more detail can see [tools.sass](https://modernjs.dev/builder/en/api/config-tools.html#toolssass)。
9
9
  :::
10
10
 
11
11
  import Main from '@modern-js/builder-doc/docs/en/config/tools/sass.md'
@@ -5,7 +5,7 @@ sidebar_label: styleLoader
5
5
  # tools.styleLoader
6
6
 
7
7
  :::tip
8
- This config is provided by Modern.js Builder, more detail can see [tools.styleLoader](https://modernjs.dev/builder/en/api/config-tools.html#tools-styleloader)。
8
+ This config is provided by Modern.js Builder, more detail can see [tools.styleLoader](https://modernjs.dev/builder/en/api/config-tools.html#toolsstyleloader)。
9
9
  :::
10
10
 
11
11
  import Main from '@modern-js/builder-doc/docs/en/config/tools/styleLoader.md'
@@ -5,7 +5,7 @@ sidebar_label: styledComponents
5
5
  # tools.styledComponents
6
6
 
7
7
  :::tip
8
- This config is provided by Modern.js Builder, more detail can see [tools.styledComponents](https://modernjs.dev/builder/en/api/config-tools.html#tools-styledcomponents)。
8
+ This config is provided by Modern.js Builder, more detail can see [tools.styledComponents](https://modernjs.dev/builder/en/api/config-tools.html#toolsstyledcomponents)。
9
9
  :::
10
10
 
11
11
  import Main from '@modern-js/builder-doc/docs/en/config/tools/styledComponents.md'
@@ -5,7 +5,7 @@ sidebar_label: terser
5
5
  # tools.terser
6
6
 
7
7
  :::tip
8
- This config is provided by Modern.js Builder, more detail can see [tools.terser](https://modernjs.dev/builder/en/api/config-tools.html#tools-terser)。
8
+ This config is provided by Modern.js Builder, more detail can see [tools.terser](https://modernjs.dev/builder/en/api/config-tools.html#toolsterser)。
9
9
  :::
10
10
 
11
11
  import Main from '@modern-js/builder-doc/docs/en/config/tools/terser.md'
@@ -5,7 +5,7 @@ sidebar_label: tsChecker
5
5
  # tools.tsChecker
6
6
 
7
7
  :::tip
8
- This config is provided by Modern.js Builder, more detail can see [tools.tsChecker](https://modernjs.dev/builder/en/api/config-tools.html#tools-tschecker)。
8
+ This config is provided by Modern.js Builder, more detail can see [tools.tsChecker](https://modernjs.dev/builder/en/api/config-tools.html#toolstschecker)。
9
9
  :::
10
10
 
11
11
  import Main from '@modern-js/builder-doc/docs/en/config/tools/tsChecker.md'
@@ -5,7 +5,7 @@ sidebar_label: tsLoader
5
5
  # tools.tsLoader
6
6
 
7
7
  :::tip
8
- This config is provided by Modern.js Builder, more detail can see [tools.tsLoader](https://modernjs.dev/builder/en/api/config-tools.html#tools-tsloader)。
8
+ This config is provided by Modern.js Builder, more detail can see [tools.tsLoader](https://modernjs.dev/builder/en/api/config-tools.html#toolstsloader)。
9
9
  :::
10
10
 
11
11
  import Main from '@modern-js/builder-doc/docs/en/config/tools/tsLoader.md'
@@ -5,7 +5,7 @@ sidebar_label: webpackChain
5
5
  # tools.webpackChain
6
6
 
7
7
  :::tip
8
- This config is provided by Modern.js Builder, more detail can see [tools.webpackChain](https://modernjs.dev/builder/en/api/config-tools.html#tools-webpackchain)。
8
+ This config is provided by Modern.js Builder, more detail can see [tools.webpackChain](https://modernjs.dev/builder/en/api/config-tools.html#toolswebpackchain)。
9
9
  :::
10
10
 
11
11
  import Main from '@modern-js/builder-doc/docs/en/config/tools/webpackChain.md'
@@ -5,7 +5,7 @@ sidebar_label: webpack
5
5
  # tools.webpack
6
6
 
7
7
  :::tip
8
- This config is provided by Modern.js Builder, more detail can see [tools.webpack](https://modernjs.dev/builder/en/api/config-tools.html#tools-webpack)。
8
+ This config is provided by Modern.js Builder, more detail can see [tools.webpack](https://modernjs.dev/builder/en/api/config-tools.html#toolswebpack)。
9
9
  :::
10
10
 
11
11
  import Main from '@modern-js/builder-doc/docs/en/config/tools/webpack.md'
@@ -69,6 +69,69 @@ export default defineConfig({
69
69
  });
70
70
  ```
71
71
 
72
+ ### Export Configuration Function
73
+
74
+ Modern.js supports exporting a function in the configuration file, and you can dynamically compute the configuration in the function and return it to Modern.js.
75
+
76
+ ```js title="modern.config.js"
77
+ import { defineConfig } from '@modern-js/app-tools';
78
+
79
+ export default defineConfig(({ env, command }) => ({
80
+ source: {
81
+ alias: {
82
+ '@foo': env === 'development' ? './src/foo.dev.ts' : './src/foo.prod.ts',
83
+ },
84
+ },
85
+ }));
86
+ ```
87
+
88
+ This function takes the following parameters:
89
+
90
+ - `env`: same as the value of `process.env.NODE_ENV`.
91
+ - When running `modern dev` or `modern start`, the value of `env` is `development`.
92
+ - When running `modern build` or `modern serve`, the value of `env` is `production`.
93
+ - When running `modern test`, the value of `env` is `test`.
94
+ - `command`: corresponds to the currently running command, such as `dev`, `start`, `build`, `serve`.
95
+
96
+ ### Export Async Function
97
+
98
+ Modern.js also supports exporting an asynchronous function in the configuration file, you can perform some asynchronous operations in the function:
99
+
100
+ ```js title="modern.config.js"
101
+ import { defineConfig } from '@modern-js/app-tools';
102
+
103
+ export default defineConfig(async ({ env, command }) => {
104
+ const result = await someAsyncFunction();
105
+
106
+ return {
107
+ html: {
108
+ title: result,
109
+ },
110
+ };
111
+ });
112
+ ```
113
+
114
+ ### Specify the Configuration File
115
+
116
+ You can specify the name of the configuration file using the `--config` option.
117
+
118
+ For example, if you need to use the `modern.prod.config.js` file when running build, you can add the following scripts to `package.json`:
119
+
120
+ ```json title="package.json"
121
+ {
122
+ "scripts": {
123
+ "dev": "modern dev",
124
+ "build": "modern build --config modern.prod.config.js"
125
+ }
126
+ }
127
+ ```
128
+
129
+ You can also abbreviate the `--config` option to `-c`:
130
+
131
+ ```bash
132
+ $ modern build -c modern.prod.config.js
133
+ ```
134
+
72
135
  ## Configure in package.json (not recommended)
73
136
 
74
137
  In addition to configuration files, configuration options can also be set the `modernConfig` field in the `package.json`, such as:
@@ -0,0 +1,5 @@
1
+ {
2
+ "label": "Advanced Features",
3
+ "position": 4,
4
+ "collapsed": true
5
+ }
@@ -254,11 +254,11 @@ In the second case, the Treeshaking method does not guarantee that the code is c
254
254
  For example, the import of `fs-extra` in the code, when it is directly referenced to the component, will cause the CSR to load an error. You can create `.ts` and `.node.ts` files of the same name as a layer of proxy:
255
255
 
256
256
  ```ts title="compat.ts"
257
- export { readFileSync } from 'fs-extra';
257
+ export const readFileSync: any = () => {};
258
258
  ```
259
259
 
260
260
  ```ts title="compat.node.ts"
261
- export const readFileSync: any = () => {};
261
+ export { readFileSync } from 'fs-extra';
262
262
  ```
263
263
 
264
264
  use `./compat` directly into the file. At this time, files with the `.node.ts` suffix will be used first in the SSR environment, and files with the `.ts` suffix will be used in the CSR environment.
@@ -0,0 +1,5 @@
1
+ {
2
+ "label": "Basic Features",
3
+ "position": 3,
4
+ "collapsed": false
5
+ }
@@ -6,7 +6,7 @@ sidebar_position: 2
6
6
 
7
7
  **Modern.js uses [Modern.js Builder](https://modernjs.dev/builder) to build your Web App.**
8
8
 
9
- Modern.js Builder is one of the core components of Modern.js. It is a build engine for Web development and can be used independently of Modern.js. Modern.js Builder supports multiple bundlers such as webpack and rspack, and it uses webpack by default.
9
+ Modern.js Builder is one of the core components of Modern.js. It is A Build Engine for web development. and can be used independently of Modern.js. Modern.js Builder supports multiple bundlers such as webpack and rspack, and it uses webpack by default.
10
10
 
11
11
  ## Build Architecture
12
12
 
@@ -134,6 +134,34 @@ The `routes/[id]/page.tsx` file is converted to the `/:id` route. Except for the
134
134
 
135
135
  In component, you can get the corresponding named parameters through [useParams](/apis/app/runtime/router/#useparams).
136
136
 
137
+ ### Catch all routing
138
+
139
+ If a `$.tsx` file is created in the routes directory, this file will act as a wildcard route component that will be rendered when there is no matching route.
140
+
141
+ :::note
142
+ `$.tsx` can be thought of as a special `page` routing component that renders `$.tsx` as a child of `layout` when there is a `layout` component in the current directory.
143
+ :::
144
+
145
+ For example, the following directory structure:
146
+
147
+ ```
148
+ └── routes
149
+ ├── $.tsx
150
+ ├── blog
151
+ │   └── page.tsx
152
+ └── page.tsx
153
+ ```
154
+
155
+ The `routes/$.tsx` component is rendered when accessing any path that does not match, and again, the remainder of the url can be captured in `$.tsx` using [useParams](/apis/app/runtime/router/#useparams).
156
+
157
+ ```ts title="$.tsx"
158
+ import { useParams } from '@modern-js/runtime/router';
159
+ // When the path is `/aaa/bbb`
160
+ const params = useParams();
161
+ params['*'] // => 'aaa/bbb'
162
+ ```
163
+
164
+
137
165
  ### Layout with No Path
138
166
 
139
167
  When a directory name begins with `__`, the corresponding directory name is not converted to the actual routing path, such as the following file directory:
@@ -0,0 +1,5 @@
1
+ {
2
+ "label": "Core Concept",
3
+ "position": 2,
4
+ "collapsed": false
5
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "label": "Start",
3
+ "position": 1,
4
+ "collapsed": false
5
+ }
@@ -2,7 +2,7 @@
2
2
  sidebar_position: 2
3
3
  ---
4
4
 
5
- # MWA
5
+ # Web App
6
6
 
7
7
  ## Project creation
8
8
 
@@ -30,4 +30,4 @@ Project element type, supports entry and server.
30
30
 
31
31
  ## params
32
32
 
33
- For other parameters of creating elements, please refer to[MWA New Command](/guides/topic-detail/generator/config/mwa).
33
+ For other parameters of creating elements, please refer to[App New Command](/guides/topic-detail/generator/config/app).
@@ -41,4 +41,4 @@ The function name is passed according to the functions supported by the differen
41
41
 
42
42
  ## params
43
43
 
44
- For other parameters when the function is enabled, please refer to[MWA New Command](/guides/topic-detail/generator/config/mwa)[Module New Command](/guides/topic-detail/generator/config/module).
44
+ For other parameters when the function is enabled, please refer to [App New Command](/guides/topic-detail/generator/config/app) and [Module New Command](/guides/topic-detail/generator/config/module).
@@ -8,7 +8,7 @@ The three engineering solutions provided by the Modern.js support executing the
8
8
 
9
9
  Different engineering solutions to support new operations:
10
10
 
11
- - [MWA](/guides/topic-detail/generator/config/mwa)
11
+ - [Web App](/guides/topic-detail/generator/config/app)
12
12
 
13
13
  - [Module](/guides/topic-detail/generator/config/module)
14
14
 
@@ -23,7 +23,7 @@ Different plugin types will ask different questions. You can choose the plugin t
23
23
  ? Development Language TS
24
24
  ? Package Management Tool pnpm
25
25
  ? Plugin Type extend
26
- ? Plugin Base Type MWA Solution
26
+ ? Plugin Base Type Web App Solution
27
27
  ```
28
28
 
29
29
  ### Customized type
@@ -35,7 +35,7 @@ Different plugin types will ask different questions. You can choose the plugin t
35
35
  ? Plugin Type custom
36
36
  ? Plugin Key mobile-app
37
37
  ? Plugin Show Name Mobile App
38
- ? Plugin Base Type MWA Solution
38
+ ? Plugin Base Type Web App Solution
39
39
  ```
40
40
 
41
41
  After the execution of the create project command is completed, a project for developing the generator plugin will be generated accordingly, and the `meta` information will also be generated according to your selection in the `package.json`.
package/package.json CHANGED
@@ -11,13 +11,13 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "2.3.0",
14
+ "version": "2.4.0",
15
15
  "publishConfig": {
16
16
  "registry": "https://registry.npmjs.org/",
17
17
  "access": "public"
18
18
  },
19
19
  "peerDependencies": {
20
- "@modern-js/builder-doc": "^2.3.0"
20
+ "@modern-js/builder-doc": "^2.4.0"
21
21
  },
22
22
  "devDependencies": {
23
23
  "ts-node": "^10",
@@ -25,7 +25,7 @@
25
25
  "fs-extra": "^10",
26
26
  "@types/node": "^16",
27
27
  "@types/fs-extra": "^9",
28
- "@modern-js/builder-doc": "2.3.0"
28
+ "@modern-js/builder-doc": "2.4.0"
29
29
  },
30
30
  "scripts": {
31
31
  "build": "npx ts-node ./scripts/sync.ts"
package/scripts/config.ts CHANGED
@@ -27,7 +27,7 @@ sidebar_label: ${name}
27
27
  :::tip
28
28
  ${
29
29
  tip[lng]
30
- } [${dirname}.${name}](https://modernjs.dev/builder${langPrefix}/api/config-${dirname}.html#${dirname}-${name.toLowerCase()})。
30
+ } [${dirname}.${name}](https://modernjs.dev/builder${langPrefix}/api/config-${dirname}.html#${dirname}${name.toLowerCase()})。
31
31
  :::
32
32
 
33
33
  import Main from '@modern-js/builder-doc/docs/${lng}/config/${dirname}/${name}.md'