@modern-js/main-doc 2.58.0 → 2.58.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (467) hide show
  1. package/docs/en/_meta.json +27 -0
  2. package/docs/en/apis/_meta.json +13 -0
  3. package/docs/en/apis/app/hooks/_meta.json +28 -0
  4. package/docs/en/apis/app/hooks/config/icon.mdx +1 -1
  5. package/docs/en/apis/app/runtime/_meta.json +50 -0
  6. package/docs/en/apis/app/runtime/web-server/unstable_middleware.mdx +2 -2
  7. package/docs/en/community/_meta.json +11 -0
  8. package/docs/en/community/blog/2022-0708-updates.md +95 -0
  9. package/docs/en/community/blog/2022-0910-updates.md +80 -0
  10. package/docs/en/community/blog/_meta.json +6 -0
  11. package/docs/en/community/blog/v2-release-note.mdx +246 -0
  12. package/docs/en/components/debug-app.mdx +1 -1
  13. package/docs/en/configure/_meta.json +78 -0
  14. package/docs/en/configure/app/bff/prefix.mdx +1 -1
  15. package/docs/en/configure/app/deploy/microFrontend.mdx +1 -1
  16. package/docs/en/configure/app/dev/asset-prefix.mdx +1 -1
  17. package/docs/en/configure/app/dev/before-start-url.mdx +1 -1
  18. package/docs/en/configure/app/dev/client.mdx +1 -1
  19. package/docs/en/configure/app/dev/hmr.mdx +1 -1
  20. package/docs/en/configure/app/dev/host.mdx +1 -1
  21. package/docs/en/configure/app/dev/https.mdx +1 -1
  22. package/docs/en/configure/app/dev/live-reload.mdx +1 -1
  23. package/docs/en/configure/app/dev/port.mdx +1 -1
  24. package/docs/en/configure/app/dev/progress-bar.mdx +1 -1
  25. package/docs/en/configure/app/dev/proxy.mdx +1 -1
  26. package/docs/en/configure/app/dev/setup-middlewares.mdx +1 -1
  27. package/docs/en/configure/app/dev/start-url.mdx +1 -1
  28. package/docs/en/configure/app/dev/watch-files.mdx +1 -1
  29. package/docs/en/configure/app/dev/write-to-disk.mdx +1 -1
  30. package/docs/en/configure/app/experiments/lazy-compilation.mdx +1 -1
  31. package/docs/en/configure/app/experiments/source-build.mdx +1 -1
  32. package/docs/en/configure/app/html/app-icon.mdx +1 -1
  33. package/docs/en/configure/app/html/crossorigin.mdx +1 -1
  34. package/docs/en/configure/app/html/disable-html-folder.mdx +1 -1
  35. package/docs/en/configure/app/html/favicon-by-entries.mdx +1 -1
  36. package/docs/en/configure/app/html/favicon.mdx +1 -1
  37. package/docs/en/configure/app/html/inject-by-entries.mdx +1 -1
  38. package/docs/en/configure/app/html/inject.mdx +1 -1
  39. package/docs/en/configure/app/html/meta-by-entries.mdx +1 -1
  40. package/docs/en/configure/app/html/meta.mdx +1 -1
  41. package/docs/en/configure/app/html/mount-id.mdx +1 -1
  42. package/docs/en/configure/app/html/script-loading.mdx +1 -1
  43. package/docs/en/configure/app/html/tags-by-entries.mdx +1 -1
  44. package/docs/en/configure/app/html/tags.mdx +1 -1
  45. package/docs/en/configure/app/html/template-by-entries.mdx +1 -1
  46. package/docs/en/configure/app/html/template-parameters-by-entries.mdx +1 -1
  47. package/docs/en/configure/app/html/template-parameters.mdx +1 -1
  48. package/docs/en/configure/app/html/template.mdx +1 -1
  49. package/docs/en/configure/app/html/title-by-entries.mdx +1 -1
  50. package/docs/en/configure/app/html/title.mdx +1 -1
  51. package/docs/en/configure/app/output/asset-prefix.mdx +1 -1
  52. package/docs/en/configure/app/output/assets-retry.mdx +1 -1
  53. package/docs/en/configure/app/output/charset.mdx +1 -1
  54. package/docs/en/configure/app/output/clean-dist-path.mdx +1 -1
  55. package/docs/en/configure/app/output/convert-to-rem.mdx +1 -1
  56. package/docs/en/configure/app/output/copy.mdx +1 -1
  57. package/docs/en/configure/app/output/css-module-local-ident-name.mdx +1 -1
  58. package/docs/en/configure/app/output/css-modules.mdx +1 -1
  59. package/docs/en/configure/app/output/data-uri-limit.mdx +1 -1
  60. package/docs/en/configure/app/output/disable-css-extract.mdx +1 -1
  61. package/docs/en/configure/app/output/disable-css-module-extension.mdx +1 -1
  62. package/docs/en/configure/app/output/disable-filename-hash.mdx +1 -1
  63. package/docs/en/configure/app/output/disable-inline-runtime-chunk.mdx +1 -1
  64. package/docs/en/configure/app/output/disable-minimize.mdx +1 -1
  65. package/docs/en/configure/app/output/disable-node-polyfill.mdx +1 -1
  66. package/docs/en/configure/app/output/disable-source-map.mdx +1 -1
  67. package/docs/en/configure/app/output/disable-svgr.mdx +1 -1
  68. package/docs/en/configure/app/output/disable-ts-checker.mdx +1 -1
  69. package/docs/en/configure/app/output/dist-path.mdx +1 -1
  70. package/docs/en/configure/app/output/enable-asset-fallback.mdx +1 -1
  71. package/docs/en/configure/app/output/enable-asset-manifest.mdx +1 -1
  72. package/docs/en/configure/app/output/enable-css-module-tsdeclaration.mdx +1 -1
  73. package/docs/en/configure/app/output/enable-inline-route-manifests.mdx +1 -1
  74. package/docs/en/configure/app/output/enable-inline-scripts.mdx +1 -1
  75. package/docs/en/configure/app/output/enable-inline-styles.mdx +1 -1
  76. package/docs/en/configure/app/output/enable-latest-decorators.mdx +1 -1
  77. package/docs/en/configure/app/output/externals.mdx +1 -1
  78. package/docs/en/configure/app/output/filename-hash.mdx +1 -1
  79. package/docs/en/configure/app/output/filename.mdx +1 -1
  80. package/docs/en/configure/app/output/legal-comments.mdx +1 -1
  81. package/docs/en/configure/app/output/override-browserslist.mdx +1 -1
  82. package/docs/en/configure/app/output/polyfill.mdx +1 -1
  83. package/docs/en/configure/app/output/splitRouteChunks.mdx +1 -1
  84. package/docs/en/configure/app/output/ssg.mdx +1 -1
  85. package/docs/en/configure/app/output/svg-default-export.mdx +1 -1
  86. package/docs/en/configure/app/output/temp-dir.mdx +1 -1
  87. package/docs/en/configure/app/performance/build-cache.mdx +1 -1
  88. package/docs/en/configure/app/performance/bundle-analyze.mdx +1 -1
  89. package/docs/en/configure/app/performance/chunk-split.mdx +1 -1
  90. package/docs/en/configure/app/performance/dns-prefetch.mdx +1 -1
  91. package/docs/en/configure/app/performance/preconnect.mdx +1 -1
  92. package/docs/en/configure/app/performance/prefetch.mdx +1 -1
  93. package/docs/en/configure/app/performance/preload.mdx +1 -1
  94. package/docs/en/configure/app/performance/print-file-size.mdx +1 -1
  95. package/docs/en/configure/app/performance/profile.mdx +1 -1
  96. package/docs/en/configure/app/performance/remove-console.mdx +1 -1
  97. package/docs/en/configure/app/performance/remove-moment-locale.mdx +1 -1
  98. package/docs/en/configure/app/performance/transform-lodash.mdx +1 -1
  99. package/docs/en/configure/app/runtime/{intro.mdx → 0-intro.mdx} +1 -1
  100. package/docs/en/configure/app/runtime/master-app.mdx +1 -1
  101. package/docs/en/configure/app/runtime/router.mdx +3 -1
  102. package/docs/en/configure/app/runtime/state.mdx +1 -1
  103. package/docs/en/configure/app/security/check-syntax.mdx +1 -1
  104. package/docs/en/configure/app/security/nonce.mdx +1 -1
  105. package/docs/en/configure/app/security/sri.mdx +1 -1
  106. package/docs/en/configure/app/server/base-url.mdx +1 -1
  107. package/docs/en/configure/app/server/enable-framework-ext.mdx +1 -1
  108. package/docs/en/configure/app/server/port.mdx +1 -1
  109. package/docs/en/configure/app/server/public-routes.mdx +1 -1
  110. package/docs/en/configure/app/server/routes.mdx +1 -1
  111. package/docs/en/configure/app/server/ssr-by-entries.mdx +1 -1
  112. package/docs/en/configure/app/server/ssr.mdx +1 -1
  113. package/docs/en/configure/app/source/alias-strategy.mdx +1 -1
  114. package/docs/en/configure/app/source/alias.mdx +1 -1
  115. package/docs/en/configure/app/source/config-dir.mdx +1 -1
  116. package/docs/en/configure/app/source/decorators.mdx +1 -1
  117. package/docs/en/configure/app/source/define.mdx +1 -1
  118. package/docs/en/configure/app/source/disable-default-entries.mdx +1 -1
  119. package/docs/en/configure/app/source/disable-entry-dirs.mdx +1 -1
  120. package/docs/en/configure/app/source/enable-async-entry.mdx +1 -1
  121. package/docs/en/configure/app/source/enable-custom-entry.mdx +1 -1
  122. package/docs/en/configure/app/source/entries-dir.mdx +1 -1
  123. package/docs/en/configure/app/source/entries.mdx +1 -1
  124. package/docs/en/configure/app/source/exclude.mdx +1 -1
  125. package/docs/en/configure/app/source/global-vars.mdx +1 -1
  126. package/docs/en/configure/app/source/include.mdx +1 -1
  127. package/docs/en/configure/app/source/mainEntryName.mdx +1 -1
  128. package/docs/en/configure/app/source/module-scopes.mdx +1 -1
  129. package/docs/en/configure/app/source/pre-entry.mdx +1 -1
  130. package/docs/en/configure/app/source/resolve-extension-prefix.mdx +1 -1
  131. package/docs/en/configure/app/source/resolve-main-fields.mdx +1 -1
  132. package/docs/en/configure/app/source/transform-import.mdx +1 -1
  133. package/docs/en/configure/app/tools/autoprefixer.mdx +1 -1
  134. package/docs/en/configure/app/tools/babel.mdx +1 -1
  135. package/docs/en/configure/app/tools/bundler-chain.mdx +1 -1
  136. package/docs/en/configure/app/tools/css-extract.mdx +1 -1
  137. package/docs/en/configure/app/tools/css-loader.mdx +1 -1
  138. package/docs/en/configure/app/tools/dev-server.mdx +1 -1
  139. package/docs/en/configure/app/tools/esbuild.mdx +2 -2
  140. package/docs/en/configure/app/tools/html-plugin.mdx +1 -1
  141. package/docs/en/configure/app/tools/less.mdx +1 -1
  142. package/docs/en/configure/app/tools/minify-css.mdx +1 -1
  143. package/docs/en/configure/app/tools/postcss.mdx +1 -1
  144. package/docs/en/configure/app/tools/pug.mdx +1 -1
  145. package/docs/en/configure/app/tools/rspack.mdx +1 -1
  146. package/docs/en/configure/app/tools/sass.mdx +1 -1
  147. package/docs/en/configure/app/tools/style-loader.mdx +1 -1
  148. package/docs/en/configure/app/tools/styled-components.mdx +1 -1
  149. package/docs/en/configure/app/tools/swc.mdx +2 -2
  150. package/docs/en/configure/app/tools/tailwindcss.mdx +1 -1
  151. package/docs/en/configure/app/tools/terser.mdx +1 -1
  152. package/docs/en/configure/app/tools/ts-checker.mdx +1 -1
  153. package/docs/en/configure/app/tools/ts-loader.mdx +1 -1
  154. package/docs/en/configure/app/tools/webpack-chain.mdx +1 -1
  155. package/docs/en/configure/app/tools/webpack.mdx +1 -1
  156. package/docs/en/guides/_meta.json +38 -0
  157. package/docs/en/guides/advanced-features/_meta.json +26 -0
  158. package/docs/en/guides/advanced-features/bff/_meta.json +6 -0
  159. package/docs/en/guides/advanced-features/rsbuild-plugin.mdx +9 -9
  160. package/docs/en/guides/advanced-features/ssr/_meta.json +5 -0
  161. package/docs/en/guides/basic-features/_meta.json +22 -0
  162. package/docs/en/guides/basic-features/data/_meta.json +4 -0
  163. package/docs/en/guides/concept/_meta.json +4 -0
  164. package/docs/en/guides/{deprecat.md → deprecated.md} +1 -1
  165. package/docs/en/guides/get-started/_meta.json +7 -0
  166. package/docs/en/guides/get-started/quick-start.mdx +2 -2
  167. package/docs/en/guides/get-started/upgrade.mdx +1 -1
  168. package/docs/en/guides/rsbuild-plugins/plugin-esbuild.mdx +205 -0
  169. package/docs/en/guides/rsbuild-plugins/plugin-swc.mdx +356 -0
  170. package/docs/en/guides/topic-detail/_meta.json +26 -0
  171. package/docs/en/guides/topic-detail/framework-plugin/_meta.json +10 -0
  172. package/docs/en/guides/topic-detail/generator/_meta.json +17 -0
  173. package/docs/en/guides/topic-detail/generator/create/_meta.json +5 -0
  174. package/docs/en/guides/topic-detail/generator/new/_meta.json +5 -0
  175. package/docs/en/guides/topic-detail/generator/plugin/_meta.json +11 -0
  176. package/docs/en/guides/topic-detail/model/_meta.json +14 -0
  177. package/docs/en/guides/troubleshooting/_meta.json +6 -0
  178. package/docs/en/guides/troubleshooting/dependencies.mdx +4 -4
  179. package/docs/en/tutorials/_meta.json +17 -0
  180. package/docs/zh/_meta.json +27 -0
  181. package/docs/zh/apis/_meta.json +13 -0
  182. package/docs/zh/apis/app/hooks/_meta.json +28 -0
  183. package/docs/zh/apis/app/hooks/config/icon.mdx +1 -1
  184. package/docs/zh/apis/app/runtime/_meta.json +50 -0
  185. package/docs/zh/apis/app/runtime/web-server/unstable_middleware.mdx +2 -2
  186. package/docs/zh/community/_meta.json +11 -0
  187. package/docs/zh/community/blog/_meta.json +6 -0
  188. package/docs/zh/community/blog/v2-release-note.mdx +1 -2
  189. package/docs/zh/components/debug-app.mdx +1 -1
  190. package/docs/zh/configure/_meta.json +78 -0
  191. package/docs/zh/configure/app/auto-load-plugin.mdx +1 -1
  192. package/docs/zh/configure/app/bff/prefix.mdx +1 -1
  193. package/docs/zh/configure/app/builder-plugins.mdx +1 -1
  194. package/docs/zh/configure/app/deploy/microFrontend.mdx +1 -1
  195. package/docs/zh/configure/app/dev/asset-prefix.mdx +1 -1
  196. package/docs/zh/configure/app/dev/before-start-url.mdx +1 -1
  197. package/docs/zh/configure/app/dev/client.mdx +1 -1
  198. package/docs/zh/configure/app/dev/hmr.mdx +1 -1
  199. package/docs/zh/configure/app/dev/host.mdx +1 -1
  200. package/docs/zh/configure/app/dev/https.mdx +1 -1
  201. package/docs/zh/configure/app/dev/live-reload.mdx +1 -1
  202. package/docs/zh/configure/app/dev/port.mdx +1 -1
  203. package/docs/zh/configure/app/dev/progress-bar.mdx +1 -1
  204. package/docs/zh/configure/app/dev/proxy.mdx +1 -1
  205. package/docs/zh/configure/app/dev/setup-middlewares.mdx +1 -1
  206. package/docs/zh/configure/app/dev/start-url.mdx +1 -1
  207. package/docs/zh/configure/app/dev/watch-files.mdx +1 -1
  208. package/docs/zh/configure/app/dev/write-to-disk.mdx +1 -1
  209. package/docs/zh/configure/app/experiments/lazy-compilation.mdx +1 -1
  210. package/docs/zh/configure/app/experiments/source-build.mdx +1 -1
  211. package/docs/zh/configure/app/html/app-icon.mdx +1 -1
  212. package/docs/zh/configure/app/html/crossorigin.mdx +1 -1
  213. package/docs/zh/configure/app/html/disable-html-folder.mdx +1 -1
  214. package/docs/zh/configure/app/html/favicon-by-entries.mdx +1 -1
  215. package/docs/zh/configure/app/html/favicon.mdx +1 -1
  216. package/docs/zh/configure/app/html/inject-by-entries.mdx +1 -1
  217. package/docs/zh/configure/app/html/inject.mdx +1 -1
  218. package/docs/zh/configure/app/html/meta-by-entries.mdx +1 -1
  219. package/docs/zh/configure/app/html/meta.mdx +1 -1
  220. package/docs/zh/configure/app/html/mount-id.mdx +1 -1
  221. package/docs/zh/configure/app/html/script-loading.mdx +1 -1
  222. package/docs/zh/configure/app/html/tags-by-entries.mdx +1 -1
  223. package/docs/zh/configure/app/html/tags.mdx +1 -1
  224. package/docs/zh/configure/app/html/template-by-entries.mdx +1 -1
  225. package/docs/zh/configure/app/html/template-parameters-by-entries.mdx +1 -1
  226. package/docs/zh/configure/app/html/template-parameters.mdx +1 -1
  227. package/docs/zh/configure/app/html/template.mdx +1 -1
  228. package/docs/zh/configure/app/html/title-by-entries.mdx +1 -1
  229. package/docs/zh/configure/app/html/title.mdx +1 -1
  230. package/docs/zh/configure/app/output/asset-prefix.mdx +1 -1
  231. package/docs/zh/configure/app/output/assets-retry.mdx +1 -1
  232. package/docs/zh/configure/app/output/charset.mdx +1 -1
  233. package/docs/zh/configure/app/output/clean-dist-path.mdx +1 -1
  234. package/docs/zh/configure/app/output/convert-to-rem.mdx +1 -1
  235. package/docs/zh/configure/app/output/copy.mdx +1 -1
  236. package/docs/zh/configure/app/output/css-module-local-ident-name.mdx +1 -1
  237. package/docs/zh/configure/app/output/css-modules.mdx +1 -1
  238. package/docs/zh/configure/app/output/data-uri-limit.mdx +1 -1
  239. package/docs/zh/configure/app/output/disable-css-extract.mdx +1 -1
  240. package/docs/zh/configure/app/output/disable-css-module-extension.mdx +1 -1
  241. package/docs/zh/configure/app/output/disable-filename-hash.mdx +1 -1
  242. package/docs/zh/configure/app/output/disable-inline-runtime-chunk.mdx +1 -1
  243. package/docs/zh/configure/app/output/disable-minimize.mdx +1 -1
  244. package/docs/zh/configure/app/output/disable-node-polyfill.mdx +1 -1
  245. package/docs/zh/configure/app/output/disable-source-map.mdx +1 -1
  246. package/docs/zh/configure/app/output/disable-svgr.mdx +1 -1
  247. package/docs/zh/configure/app/output/disable-ts-checker.mdx +1 -1
  248. package/docs/zh/configure/app/output/dist-path.mdx +1 -1
  249. package/docs/zh/configure/app/output/enable-asset-fallback.mdx +1 -1
  250. package/docs/zh/configure/app/output/enable-asset-manifest.mdx +1 -1
  251. package/docs/zh/configure/app/output/enable-css-module-tsdeclaration.mdx +1 -1
  252. package/docs/zh/configure/app/output/enable-inline-route-manifests.mdx +1 -1
  253. package/docs/zh/configure/app/output/enable-inline-scripts.mdx +1 -1
  254. package/docs/zh/configure/app/output/enable-inline-styles.mdx +1 -1
  255. package/docs/zh/configure/app/output/enable-latest-decorators.mdx +1 -1
  256. package/docs/zh/configure/app/output/externals.mdx +1 -1
  257. package/docs/zh/configure/app/output/filename-hash.mdx +1 -1
  258. package/docs/zh/configure/app/output/filename.mdx +1 -1
  259. package/docs/zh/configure/app/output/legal-comments.mdx +1 -1
  260. package/docs/zh/configure/app/output/override-browserslist.mdx +1 -1
  261. package/docs/zh/configure/app/output/polyfill.mdx +1 -1
  262. package/docs/zh/configure/app/output/splitRouteChunks.mdx +1 -1
  263. package/docs/zh/configure/app/output/ssg.mdx +1 -1
  264. package/docs/zh/configure/app/output/svg-default-export.mdx +1 -1
  265. package/docs/zh/configure/app/output/temp-dir.mdx +1 -1
  266. package/docs/zh/configure/app/performance/build-cache.mdx +1 -1
  267. package/docs/zh/configure/app/performance/bundle-analyze.mdx +1 -1
  268. package/docs/zh/configure/app/performance/chunk-split.mdx +1 -1
  269. package/docs/zh/configure/app/performance/dns-prefetch.mdx +1 -1
  270. package/docs/zh/configure/app/performance/preconnect.mdx +1 -1
  271. package/docs/zh/configure/app/performance/prefetch.mdx +1 -1
  272. package/docs/zh/configure/app/performance/preload.mdx +1 -1
  273. package/docs/zh/configure/app/performance/print-file-size.mdx +1 -1
  274. package/docs/zh/configure/app/performance/profile.mdx +1 -1
  275. package/docs/zh/configure/app/performance/remove-console.mdx +1 -1
  276. package/docs/zh/configure/app/performance/remove-moment-locale.mdx +1 -1
  277. package/docs/zh/configure/app/performance/transform-lodash.mdx +1 -1
  278. package/docs/zh/configure/app/plugins.mdx +1 -1
  279. package/docs/zh/configure/app/runtime/{intro.mdx → 0-intro.mdx} +1 -1
  280. package/docs/zh/configure/app/runtime/master-app.mdx +1 -1
  281. package/docs/zh/configure/app/runtime/router.mdx +3 -1
  282. package/docs/zh/configure/app/runtime/state.mdx +1 -1
  283. package/docs/zh/configure/app/security/check-syntax.mdx +1 -1
  284. package/docs/zh/configure/app/security/nonce.mdx +1 -1
  285. package/docs/zh/configure/app/security/sri.mdx +1 -1
  286. package/docs/zh/configure/app/server/base-url.mdx +1 -1
  287. package/docs/zh/configure/app/server/enable-framework-ext.mdx +1 -1
  288. package/docs/zh/configure/app/server/port.mdx +1 -1
  289. package/docs/zh/configure/app/server/public-routes.mdx +1 -1
  290. package/docs/zh/configure/app/server/routes.mdx +1 -1
  291. package/docs/zh/configure/app/server/ssr-by-entries.mdx +1 -1
  292. package/docs/zh/configure/app/server/ssr.mdx +1 -1
  293. package/docs/zh/configure/app/source/alias-strategy.mdx +1 -1
  294. package/docs/zh/configure/app/source/alias.mdx +1 -1
  295. package/docs/zh/configure/app/source/config-dir.mdx +1 -1
  296. package/docs/zh/configure/app/source/decorators.mdx +1 -1
  297. package/docs/zh/configure/app/source/define.mdx +1 -1
  298. package/docs/zh/configure/app/source/disable-default-entries.mdx +1 -1
  299. package/docs/zh/configure/app/source/disable-entry-dirs.mdx +1 -1
  300. package/docs/zh/configure/app/source/enable-async-entry.mdx +1 -1
  301. package/docs/zh/configure/app/source/enable-custom-entry.mdx +1 -1
  302. package/docs/zh/configure/app/source/entries-dir.mdx +1 -1
  303. package/docs/zh/configure/app/source/entries.mdx +1 -1
  304. package/docs/zh/configure/app/source/exclude.mdx +1 -1
  305. package/docs/zh/configure/app/source/global-vars.mdx +1 -1
  306. package/docs/zh/configure/app/source/include.mdx +1 -1
  307. package/docs/zh/configure/app/source/mainEntryName.mdx +1 -1
  308. package/docs/zh/configure/app/source/module-scopes.mdx +1 -1
  309. package/docs/zh/configure/app/source/pre-entry.mdx +1 -1
  310. package/docs/zh/configure/app/source/resolve-extension-prefix.mdx +1 -1
  311. package/docs/zh/configure/app/source/resolve-main-fields.mdx +1 -1
  312. package/docs/zh/configure/app/source/transform-import.mdx +1 -1
  313. package/docs/zh/configure/app/tools/autoprefixer.mdx +1 -1
  314. package/docs/zh/configure/app/tools/babel.mdx +1 -1
  315. package/docs/zh/configure/app/tools/bundler-chain.mdx +1 -1
  316. package/docs/zh/configure/app/tools/css-extract.mdx +1 -1
  317. package/docs/zh/configure/app/tools/css-loader.mdx +1 -1
  318. package/docs/zh/configure/app/tools/dev-server.mdx +1 -1
  319. package/docs/zh/configure/app/tools/esbuild.mdx +2 -2
  320. package/docs/zh/configure/app/tools/html-plugin.mdx +1 -1
  321. package/docs/zh/configure/app/tools/less.mdx +1 -1
  322. package/docs/zh/configure/app/tools/minify-css.mdx +1 -1
  323. package/docs/zh/configure/app/tools/postcss.mdx +1 -1
  324. package/docs/zh/configure/app/tools/pug.mdx +1 -1
  325. package/docs/zh/configure/app/tools/rspack.mdx +1 -1
  326. package/docs/zh/configure/app/tools/sass.mdx +1 -1
  327. package/docs/zh/configure/app/tools/style-loader.mdx +1 -1
  328. package/docs/zh/configure/app/tools/styled-components.mdx +1 -1
  329. package/docs/zh/configure/app/tools/swc.mdx +2 -2
  330. package/docs/zh/configure/app/tools/tailwindcss.mdx +1 -1
  331. package/docs/zh/configure/app/tools/terser.mdx +1 -1
  332. package/docs/zh/configure/app/tools/ts-checker.mdx +1 -1
  333. package/docs/zh/configure/app/tools/ts-loader.mdx +1 -1
  334. package/docs/zh/configure/app/tools/webpack-chain.mdx +1 -1
  335. package/docs/zh/configure/app/tools/webpack.mdx +1 -1
  336. package/docs/zh/guides/_meta.json +38 -0
  337. package/docs/zh/guides/advanced-features/_meta.json +26 -0
  338. package/docs/zh/guides/advanced-features/bff/_meta.json +6 -0
  339. package/docs/zh/guides/advanced-features/rsbuild-plugin.mdx +9 -9
  340. package/docs/zh/guides/advanced-features/ssr/_meta.json +5 -0
  341. package/docs/zh/guides/basic-features/_meta.json +22 -0
  342. package/docs/zh/guides/basic-features/data/_meta.json +4 -0
  343. package/docs/zh/guides/basic-features/mock.mdx +1 -1
  344. package/docs/zh/guides/concept/_meta.json +4 -0
  345. package/docs/zh/guides/get-started/_meta.json +7 -0
  346. package/docs/zh/guides/get-started/quick-start.mdx +2 -2
  347. package/docs/zh/guides/get-started/upgrade.mdx +1 -1
  348. package/docs/zh/guides/rsbuild-plugins/plugin-esbuild.mdx +201 -0
  349. package/docs/zh/guides/rsbuild-plugins/plugin-swc.mdx +344 -0
  350. package/docs/zh/guides/topic-detail/_meta.json +26 -0
  351. package/docs/zh/guides/topic-detail/framework-plugin/_meta.json +10 -0
  352. package/docs/zh/guides/topic-detail/generator/_meta.json +17 -0
  353. package/docs/zh/guides/topic-detail/generator/create/_meta.json +5 -0
  354. package/docs/zh/guides/topic-detail/generator/new/_meta.json +5 -0
  355. package/docs/zh/guides/topic-detail/generator/plugin/_meta.json +11 -0
  356. package/docs/zh/guides/topic-detail/model/_meta.json +14 -0
  357. package/docs/zh/guides/troubleshooting/_meta.json +6 -0
  358. package/docs/zh/guides/troubleshooting/dependencies.mdx +4 -4
  359. package/docs/zh/tutorials/_meta.json +17 -0
  360. package/i18n.json +110 -0
  361. package/package.json +9 -10
  362. package/rspress.config.ts +3 -20
  363. package/src/components/ContentCard/index.tsx +1 -1
  364. package/src/components/FeatureLayout/index.tsx +1 -1
  365. package/src/components/Footer/index.tsx +2 -2
  366. package/src/components/ListCard/index.tsx +1 -1
  367. package/src/components/Sandpack/index.tsx +4 -2
  368. package/src/components/SecondaryTitle/index.tsx +1 -1
  369. package/src/i18n/zhCN.ts +1 -1
  370. package/src/index.ts +0 -1
  371. package/src/pages/index.tsx +13 -5
  372. package/docs/en/apis/app/hooks/_category_.json +0 -5
  373. package/docs/en/apis/app/hooks/api/_category_.json +0 -4
  374. package/docs/en/apis/app/hooks/config/_category_.json +0 -4
  375. package/docs/en/apis/app/hooks/server/_category_.json +0 -4
  376. package/docs/en/apis/app/hooks/src/_category_.json +0 -4
  377. package/docs/en/apis/app/runtime/_category_.json +0 -5
  378. package/docs/en/apis/app/runtime/app/_category_.json +0 -4
  379. package/docs/en/apis/app/runtime/bff/_category_.json +0 -4
  380. package/docs/en/apis/app/runtime/core/_category_.json +0 -5
  381. package/docs/en/apis/app/runtime/model/_category_.json +0 -4
  382. package/docs/en/apis/app/runtime/router/_category_.json +0 -4
  383. package/docs/en/apis/app/runtime/ssr/_category_.json +0 -4
  384. package/docs/en/apis/app/runtime/utility/_category_.json +0 -4
  385. package/docs/en/apis/app/runtime/web-server/_category_.json +0 -4
  386. package/docs/en/community/blog/_category_.json +0 -6
  387. package/docs/en/configure/app/bff/_category_.json +0 -4
  388. package/docs/en/configure/app/deploy/_category_.json +0 -4
  389. package/docs/en/configure/app/dev/_category_.json +0 -4
  390. package/docs/en/configure/app/experiments/_category_.json +0 -4
  391. package/docs/en/configure/app/html/_category_.json +0 -4
  392. package/docs/en/configure/app/output/_category_.json +0 -4
  393. package/docs/en/configure/app/performance/_category_.json +0 -4
  394. package/docs/en/configure/app/runtime/_category_.json +0 -4
  395. package/docs/en/configure/app/security/_category_.json +0 -4
  396. package/docs/en/configure/app/server/_category_.json +0 -4
  397. package/docs/en/configure/app/source/_category_.json +0 -4
  398. package/docs/en/configure/app/tools/_category_.json +0 -4
  399. package/docs/en/guides/advanced-features/_category_.json +0 -5
  400. package/docs/en/guides/advanced-features/bff/_category_.json +0 -8
  401. package/docs/en/guides/advanced-features/ssr/_category_.json +0 -8
  402. package/docs/en/guides/basic-features/_category_.json +0 -5
  403. package/docs/en/guides/basic-features/data/_category_.json +0 -4
  404. package/docs/en/guides/concept/_category_.json +0 -5
  405. package/docs/en/guides/get-started/_category_.json +0 -5
  406. package/docs/en/guides/topic-detail/_category_.json +0 -5
  407. package/docs/en/guides/topic-detail/framework-plugin/_category_.json +0 -4
  408. package/docs/en/guides/topic-detail/generator/_category_.json +0 -4
  409. package/docs/en/guides/topic-detail/generator/create/_category_.json +0 -4
  410. package/docs/en/guides/topic-detail/generator/new/_category_.json +0 -4
  411. package/docs/en/guides/topic-detail/generator/plugin/_category_.json +0 -4
  412. package/docs/en/guides/topic-detail/generator/plugin/api/_category_.json +0 -4
  413. package/docs/en/guides/topic-detail/micro-frontend/_category_.json +0 -4
  414. package/docs/en/guides/topic-detail/model/_category_.json +0 -4
  415. package/docs/en/guides/troubleshooting/_category_.json +0 -5
  416. package/docs/en/tutorials/examples/_category_.json +0 -5
  417. package/docs/en/tutorials/first-app/_category_.json +0 -5
  418. package/docs/en/tutorials/foundations/_category_.json +0 -5
  419. package/docs/zh/apis/app/hooks/_category_.json +0 -5
  420. package/docs/zh/apis/app/hooks/api/_category_.json +0 -4
  421. package/docs/zh/apis/app/hooks/config/_category_.json +0 -4
  422. package/docs/zh/apis/app/hooks/server/_category_.json +0 -4
  423. package/docs/zh/apis/app/hooks/src/_category_.json +0 -4
  424. package/docs/zh/apis/app/runtime/_category_.json +0 -5
  425. package/docs/zh/apis/app/runtime/app/_category_.json +0 -4
  426. package/docs/zh/apis/app/runtime/bff/_category_.json +0 -4
  427. package/docs/zh/apis/app/runtime/core/_category_.json +0 -4
  428. package/docs/zh/apis/app/runtime/model/_category_.json +0 -4
  429. package/docs/zh/apis/app/runtime/router/_category_.json +0 -4
  430. package/docs/zh/apis/app/runtime/ssr/_category_.json +0 -4
  431. package/docs/zh/apis/app/runtime/utility/_category_.json +0 -4
  432. package/docs/zh/apis/app/runtime/web-server/_category_.json +0 -4
  433. package/docs/zh/community/blog/_category_.json +0 -6
  434. package/docs/zh/configure/app/bff/_category_.json +0 -4
  435. package/docs/zh/configure/app/deploy/_category_.json +0 -4
  436. package/docs/zh/configure/app/dev/_category_.json +0 -4
  437. package/docs/zh/configure/app/experiments/_category_.json +0 -4
  438. package/docs/zh/configure/app/html/_category_.json +0 -4
  439. package/docs/zh/configure/app/output/_category_.json +0 -4
  440. package/docs/zh/configure/app/performance/_category_.json +0 -4
  441. package/docs/zh/configure/app/runtime/_category_.json +0 -4
  442. package/docs/zh/configure/app/security/_category_.json +0 -4
  443. package/docs/zh/configure/app/server/_category_.json +0 -4
  444. package/docs/zh/configure/app/source/_category_.json +0 -4
  445. package/docs/zh/configure/app/tools/_category_.json +0 -4
  446. package/docs/zh/guides/advanced-features/_category_.json +0 -5
  447. package/docs/zh/guides/advanced-features/bff/_category_.json +0 -8
  448. package/docs/zh/guides/advanced-features/ssr/_category_.json +0 -8
  449. package/docs/zh/guides/basic-features/_category_.json +0 -5
  450. package/docs/zh/guides/basic-features/data/_category_.json +0 -4
  451. package/docs/zh/guides/concept/_category_.json +0 -5
  452. package/docs/zh/guides/get-started/_category_.json +0 -5
  453. package/docs/zh/guides/topic-detail/_category_.json +0 -5
  454. package/docs/zh/guides/topic-detail/framework-plugin/_category_.json +0 -4
  455. package/docs/zh/guides/topic-detail/generator/_category_.json +0 -4
  456. package/docs/zh/guides/topic-detail/generator/create/_category_.json +0 -4
  457. package/docs/zh/guides/topic-detail/generator/new/_category_.json +0 -4
  458. package/docs/zh/guides/topic-detail/generator/plugin/_category_.json +0 -4
  459. package/docs/zh/guides/topic-detail/generator/plugin/api/_category_.json +0 -4
  460. package/docs/zh/guides/topic-detail/micro-frontend/_category_.json +0 -4
  461. package/docs/zh/guides/topic-detail/model/_category_.json +0 -4
  462. package/docs/zh/guides/troubleshooting/_category_.json +0 -5
  463. package/docs/zh/tutorials/examples/_category_.json +0 -5
  464. package/docs/zh/tutorials/first-app/_category_.json +0 -5
  465. package/docs/zh/tutorials/foundations/_category_.json +0 -5
  466. package/src/.eslintrc.json +0 -3
  467. /package/docs/zh/guides/{deprecat.md → deprecated.md} +0 -0
@@ -0,0 +1,26 @@
1
+ [
2
+ "rspack-start",
3
+ {
4
+ "type": "dir",
5
+ "name": "bff",
6
+ "label": "use-bff",
7
+ "collapsed": true
8
+ },
9
+ "code-split",
10
+ {
11
+ "type": "dir",
12
+ "name": "ssr",
13
+ "label": "use-ssr",
14
+ "collapsed": true
15
+ },
16
+ "ssg",
17
+ "compatibility",
18
+ "eslint",
19
+ "low-level",
20
+ "source-build",
21
+ "build-performance",
22
+ "inline-assets",
23
+ "optimize-bundle",
24
+ "using-storybook",
25
+ "web-server"
26
+ ]
@@ -0,0 +1,6 @@
1
+ [
2
+ "function",
3
+ "type",
4
+ "frameworks",
5
+ "sdk"
6
+ ]
@@ -28,19 +28,19 @@ If your current version is lower than MAJOR_VERSION.46.0, you can upgrade by exe
28
28
 
29
29
  Here are the official Rsbuild plugins built into Modern.js:
30
30
 
31
- | Plugin Name | Introduce | Modern.js Link |
32
- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------- |
33
- | [React Plugin](https://rsbuild.dev/plugins/list/plugin-react) | Provides support for React | - |
34
- | [SVGR Plugin](https://rsbuild.dev/plugins/list/plugin-svgr) | Support convert SVG to React components | [output.disableSvgr](/configure/app/output/disable-svgr)<br />[output.svgDefaultExport](/configure/app/output/svg-default-export) |
35
- | [Styled Components Plugin](https://rsbuild.dev/plugins/list/plugin-styled-components) | Provides compile-time support for styled-components | [tools.styledComponents](/configure/app/tools/styled-components.html) |
36
- | [Assets Retry Plugin](https://rsbuild.dev/plugins/list/plugin-assets-retry) | Used to automatically resend requests when static assets fail to load | [output.assetsRetry](/configure/app/output/assets-retry.html) |
37
- | [Type Check Plugin](https://rsbuild.dev/plugins/list/plugin-type-check) | Used to run TypeScript type checker on a separate process | [output.disableTsChecker](/configure/app/output/disable-ts-checker.html)<br />[tools.tsChecker](/configure/app/tools/ts-checker.html) |
31
+ | Plugin Name | Introduce | Modern.js Link |
32
+ | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------- |
33
+ | [React Plugin](https://rsbuild.dev/plugins/list/plugin-react) | Provides support for React | - |
34
+ | [SVGR Plugin](https://rsbuild.dev/plugins/list/plugin-svgr) | Support convert SVG to React components | [output.disableSvgr](/configure/app/output/disable-svgr)<br />[output.svgDefaultExport](/configure/app/output/svg-default-export) |
35
+ | [Styled Components Plugin](https://github.com/rspack-contrib/rsbuild-plugin-styled-components) | Provides compile-time support for styled-components | [tools.styledComponents](/configure/app/tools/styled-components.html) |
36
+ | [Assets Retry Plugin](https://rsbuild.dev/plugins/list/plugin-assets-retry) | Used to automatically resend requests when static assets fail to load | [output.assetsRetry](/configure/app/output/assets-retry.html) |
37
+ | [Type Check Plugin](https://rsbuild.dev/plugins/list/plugin-type-check) | Used to run TypeScript type checker on a separate process | [output.disableTsChecker](/configure/app/output/disable-ts-checker.html)<br />[tools.tsChecker](/configure/app/tools/ts-checker.html) |
38
38
  | [Node Polyfill Plugin](https://github.com/rspack-contrib/rsbuild-plugin-node-polyfill) | Used to inject polyfills of Node core modules in the browser side | [output.disableNodePolyfill](/configure/app/output/disable-node-polyfill.html) |
39
- | [Source Build Plugin](https://rsbuild.dev/plugins/list/plugin-source-build) | Supports referencing source code from other subdirectories | [experiments.sourceBuild](/configure/app/experiments/source-build.html) |
39
+ | [Source Build Plugin](https://github.com/rspack-contrib/rsbuild-plugin-source-build) | Supports referencing source code from other subdirectories | [experiments.sourceBuild](/configure/app/experiments/source-build.html) |
40
40
  | [Check Syntax Plugin](https://github.com/rspack-contrib/rsbuild-plugin-check-syntax) | Used to analyze the syntax compatibility of artifacts | [security.checkSyntax](/configure/app/security/check-syntax.html) |
41
41
  | [CSS Minimizer Plugin](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer) | Used to customize CSS minimizer, switch to [cssnano](https://cssnano.co/) or other tools for CSS compression | [tools.minifyCss](/configure/app/tools/minify-css.html) |
42
42
  | [Pug Plugin](https://github.com/rspack-contrib/rsbuild-plugin-pug) | Provides support for the Pug template engine | [tools.pug](/configure/app/tools/pug.html) |
43
- | [Rem Plugin](https://rsbuild.dev/plugins/list/plugin-rem) | Implements the rem adaptive layout for mobile pages | [output.convertToRem](/configure/app/output/convert-to-rem.html) |
43
+ | [Rem Plugin](https://github.com/rspack-contrib/rsbuild-plugin-rem) | Implements the rem adaptive layout for mobile pages | [output.convertToRem](/configure/app/output/convert-to-rem.html) |
44
44
  | [YAML Plugin](https://github.com/rspack-contrib/rsbuild-plugin-yaml) | Used to import YAML files and convert them into JavaScript objects | [TOML File](/guides/basic-features/json-files.html#toml-file) |
45
45
  | [TOML Plugin](https://github.com/rspack-contrib/rsbuild-plugin-toml) | Used to import TOML files and convert them into JavaScript objects | [YAML File](/guides/basic-features/json-files.html#yaml-file) |
46
46
 
@@ -0,0 +1,5 @@
1
+ [
2
+ "usage",
3
+ "stream",
4
+ "cache"
5
+ ]
@@ -0,0 +1,22 @@
1
+ [
2
+ "css",
3
+ "routes",
4
+ {
5
+ "type": "dir",
6
+ "name": "data",
7
+ "label": "data-solution",
8
+ "collapsed": true
9
+ },
10
+ "alias",
11
+ "mock",
12
+ "proxy",
13
+ "env-vars",
14
+ "html",
15
+ "output-files",
16
+ "static-assets",
17
+ "svg-assets",
18
+ "json-files",
19
+ "wasm-assets",
20
+ "css-modules",
21
+ "deploy"
22
+ ]
@@ -0,0 +1,4 @@
1
+ [
2
+ "data-fetch",
3
+ "data-write"
4
+ ]
@@ -0,0 +1,4 @@
1
+ [
2
+ "entries",
3
+ "builder"
4
+ ]
@@ -2,7 +2,7 @@
2
2
  sidebar_position: 10
3
3
  ---
4
4
 
5
- # Deprecated Functions
5
+ # Deprecated
6
6
 
7
7
  This article will introduce the functions that were previously supported by Modern.js, but have now been deprecated, along with the recommended alternatives.
8
8
 
@@ -0,0 +1,7 @@
1
+ [
2
+ "introduction",
3
+ "quick-start",
4
+ "upgrade",
5
+ "glossary",
6
+ "tech-stack"
7
+ ]
@@ -93,7 +93,7 @@ $ pnpm run build
93
93
 
94
94
  > modern build
95
95
 
96
- Modern.js Framework v2.55.0
96
+ Modern.js Framework
97
97
 
98
98
  info Starting production build...
99
99
  info Type checker is enabled. It may take some time.
@@ -141,7 +141,7 @@ $ pnpm run serve
141
141
 
142
142
  > modern serve
143
143
 
144
- Modern.js Framework v2.55.0
144
+ Modern.js Framework
145
145
 
146
146
  info Starting production server...
147
147
 
@@ -18,7 +18,7 @@ import { PackageManagerTabs } from '@theme';
18
18
  > modern upgrade
19
19
 
20
20
  [INFO] [Project Type]: Web App
21
- [INFO] [Modern.js Latest Version]: 2.0.0
21
+ [INFO] [Modern.js Latest Version]: x.y.z
22
22
  [INFO] Upgrade Modern.js package version success!
23
23
  ```
24
24
 
@@ -0,0 +1,205 @@
1
+ ---
2
+ sidebar_position: 3
3
+ ---
4
+
5
+ # Esbuild Plugin
6
+
7
+ :::warning
8
+ **The esbuild feature in the current document is no longer maintained**, we recommend using the Rspack + SWC solution, because Rspack + SWC provide better build performance, richer features, and better compatibility.
9
+
10
+ Please refer to [「Use Rspack」](guides/advanced-features/rspack-start) for more information.
11
+
12
+ :::
13
+
14
+ import Esbuild from '@modern-js/builder-doc/docs/en/shared/esbuild.md';
15
+
16
+ <Esbuild />
17
+
18
+ ## Quick Start
19
+
20
+ ### Used in Modern.js framework
21
+
22
+ The Modern.js framework integrates the Builder's esbuild plugin by default, so you don't need to manually install and register the plugin, just use the [tools.esbuild](https://modernjs.dev/en/configure/app/tools/esbuild.html) configuration:
23
+
24
+ ```js
25
+ export default defineConfig({
26
+ tools: {
27
+ esbuild: {
28
+ loader: {
29
+ target: 'chrome61',
30
+ },
31
+ minimize: {
32
+ target: 'chrome61',
33
+ },
34
+ },
35
+ },
36
+ });
37
+ ```
38
+
39
+ ## Config
40
+
41
+ The plugin will enable code transformation and minification by default. You can also customize the behavior of the plugin through configuration.
42
+
43
+ ### loader
44
+
45
+ - **Type:**
46
+
47
+ ```ts
48
+ type LoaderOptions = EsbuildLoaderOptions | false | undefined;
49
+ ```
50
+
51
+ - **Default:**
52
+
53
+ ```ts
54
+ const defaultOptions = {
55
+ target: 'es2015',
56
+ charset: builderConfig.output.charset,
57
+ };
58
+ ```
59
+
60
+ This config is used to enable JavaScript/TypeScript transformation, which will replace babel-loader and ts-loader with esbuild-loader.
61
+
62
+ If you want to modify the options, you can check the [esbuild-loader documentation](https://github.com/privatenumber/esbuild-loader#loader).
63
+
64
+ #### Set JSX Format
65
+
66
+ When using esbuild for transformation, esbuild will read the `compilerOptions.jsx` field in `tsconfig.json` to determine which JSX syntax to use.
67
+
68
+ Therefore, you need to set the correct JSX syntax in `tsconfig.json`.
69
+
70
+ For example, React projects need to set `compilerOptions.jsx` to `react-jsx`:
71
+
72
+ ```json
73
+ {
74
+ "compilerOptions": {
75
+ "jsx": "react-jsx"
76
+ }
77
+ }
78
+ ```
79
+
80
+ #### Set the target environment
81
+
82
+ Use the `target` option to set the target environment for transformation. `target` can be set directly to the JavaScript language version, such as `es6`, `es2020`; it can also be set to several target environments, each target environment is an environment name followed by a version number, such as `['chrome58', 'edge16' ,'firefox57']`. For a detailed introduction of the `target` option, please refer to [esbuild - target](https://esbuild.github.io/api/#target).
83
+
84
+ target supports setting to the following environments:
85
+
86
+ - chrome
87
+ - edge
88
+ - firefox
89
+ - ie
90
+ - ios
91
+ - node
92
+ - opera
93
+ - safari
94
+
95
+ ```ts
96
+ builderPluginEsbuild({
97
+ loader: {
98
+ target: 'chrome61',
99
+ },
100
+ });
101
+ ```
102
+
103
+ #### Disable transformation
104
+
105
+ Set `loader` to `false` to disable esbuild transformation, and Builder will continue to use Babel to transform the code.
106
+
107
+ ```ts
108
+ builderPluginEsbuild({
109
+ loader: false,
110
+ });
111
+ ```
112
+
113
+ ### minimize
114
+
115
+ - **Type:**
116
+
117
+ ```ts
118
+ type MinimizeOptions = EsbuildMinifyOptions | false | undefined;
119
+ ```
120
+
121
+ - **Default:**
122
+
123
+ ```ts
124
+ const defaultOptions = {
125
+ css: true,
126
+ target: 'es2015',
127
+ format: builderTarget === 'web' ? 'iife' : undefined,
128
+ };
129
+ ```
130
+
131
+ This option is used to enable minification for JavaScript and CSS.
132
+
133
+ If you want to modify the options, you can check the [esbuild-loader documentation](https://github.com/privatenumber/esbuild-loader#minifyplugin).
134
+
135
+ #### Set the target environment
136
+
137
+ Use the `target` option to set the target environment for minification.
138
+
139
+ ```ts
140
+ builderPluginEsbuild({
141
+ minimize: {
142
+ target: 'chrome61',
143
+ },
144
+ });
145
+ ```
146
+
147
+ #### Disable minification
148
+
149
+ Set `minimize` to `false` to disable esbuild minification, and Builder will continue to use Terser to minify the code.
150
+
151
+ ```ts
152
+ builderPluginEsbuild({
153
+ minimize: false,
154
+ });
155
+ ```
156
+
157
+ ## Limitations
158
+
159
+ Although esbuild can significantly improve the build performance of existing webpack projects, it still has certain limitations that require special attention.
160
+
161
+ ### Compatibility
162
+
163
+ As a compiler (i.e. `loader` capability), esbuild usually supports at least ES2015 (that is, ES6) syntax, and does not have the ability to automatically inject Polyfill.. If the production environment needs to downgrade to ES5 and below syntax, it is recommended to use SWC compilation.
164
+
165
+ You can specify the target syntax version by following config:
166
+
167
+ ```ts
168
+ builderPluginEsbuild({
169
+ loader: {
170
+ target: 'es2015',
171
+ },
172
+ });
173
+ ```
174
+
175
+ As a code minify tool (i.e. `minimize` capability), esbuild can minify the code in production environment, and usually supports ES2015 syntax at least.
176
+
177
+ If you set the compressed `target` to `es5`, you need to ensure that all codes have been compiled to ES5 codes, otherwise it will cause esbuild compilation error: `Transforming 'xxx' to the configured target environment ("es5") is not supported yet `.
178
+
179
+ Therefore, for projects that need to be compatible with ES5 and below syntax in the production environment, please be careful to enable the minimize capability, and it is recommended to use SWC compression.
180
+
181
+ You can specify the target syntax version by following config:
182
+
183
+ ```js
184
+ builderPluginEsbuild({
185
+ minimize: {
186
+ target: 'es2015',
187
+ },
188
+ });
189
+ ```
190
+
191
+ :::danger Caution
192
+ Projects that need to be compatible with ES5 and below syntax in the production environment need to be careful to turn on the minimize config.
193
+ :::
194
+
195
+ ### Not support Babel plugins
196
+
197
+ As a compiler, the syntax transformation function of the original Babel plugins such as `babel-plugin-import` is not available after esbuild is turned on. And since the bottom layer of the plugin uses esbuild's `Transform API`, it does not support esbuild plugins to customize the compilation process.
198
+
199
+ If you have requirements related to Babel plugins such as `babel-plugin-import`, you can use the SWC plugin.
200
+
201
+ ### Bundle Size
202
+
203
+ Although the compression speed of esbuild is faster, the compression ratio of esbuild is lower than that of terser, so the bundle size will increase, please use it according to the scenes. Generally speaking, esbuild is more suitable for scenes that are not sensitive to bundle size.
204
+
205
+ You can refer to [minification-benchmarks](https://github.com/privatenumber/minification-benchmarks) for a detailed comparison between minimizers.