@modern-js/main-doc 0.0.0-nightly-20241026170639 → 0.0.0-nightly-20241028170700

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.
@@ -52,5 +52,5 @@ export default {
52
52
  ```
53
53
 
54
54
  :::tip Disable code minification
55
- If you need to disable code minification, you can use the [output.disableMinimize](https://modernjs.dev/builder/en/api/config-output.html#outputdisableminimize) configuration.
55
+ If you need to disable code minification, you can use the [output.minify](/configure/app/output/minify) configuration.
56
56
  :::
@@ -8,10 +8,13 @@ title: tsLoader
8
8
  - **Default:** `undefined`
9
9
  - **Bundler:** `only support webpack`
10
10
 
11
- :::warning Alternatives for ts-loader
12
- Using [babel-loader](https://modernjs.dev/builder/en/guide/basic/typescript.html#why-babel-is-the-default-option) or [Rspack](https://modernjs.dev/en/guide/advanced/rspack-start.html) instead of ts-loader can significantly improve compilation speed and provide better extendability.
11
+ :::warning Deprecated
12
+
13
+ ts-loader is not recommended for use in the project, because:
14
+
15
+ - ts-loader cannot be used with certain features such as [source.transformImport](/configure/app/source/transform-import) and [tools.styledComponents](/configure/app/tools/styled-components) provided by Babel & SWC.
16
+ - Rspack does not support ts-loader.
13
17
 
14
- ts-loader cannot be used with certain features such as [source.transformImport](https://modernjs.dev/en/configure/app/source/transform-import.html) and [tools.styledComponents](https://modernjs.dev/en/configure/app/tools/styled-components.html) provided by Babel & SWC.
15
18
  :::
16
19
 
17
20
  `ts-loader` is not enabled by default in the project. When `tools.tsLoader` is not undefined, builder will use ts-loader instead of babel-loader to compile TypeScript code.
@@ -227,8 +227,8 @@ For example, the `RULE.STYLUS` rule exists only when the Stylus plugin is regist
227
227
  | `PLUGIN.REACT_FAST_REFRESH` | correspond to `ReactFastRefreshPlugin` |
228
228
  | `PLUGIN.NODE_POLYFILL_PROVIDE` | correspond to `ProvidePlugin` for node polyfills |
229
229
  | `PLUGIN.SUBRESOURCE_INTEGRITY` | correspond to `webpack-subresource-integrity` |
230
- | `PLUGIN.ASSETS_RETRY` | correspond to webpack static asset retry plugin |
231
- | `PLUGIN.AUTO_SET_ROOT_SIZE` | correspond to automatically set root font size plugin |
230
+ | `PLUGIN.ASSETS_RETRY` | correspond to webpack static asset retry plugin |
231
+ | `PLUGIN.AUTO_SET_ROOT_SIZE` | correspond to automatically set root font size plugin |
232
232
 
233
233
  #### CHAIN_ID.MINIMIZER
234
234
 
@@ -243,4 +243,4 @@ For example, the `RULE.STYLUS` rule exists only when the Stylus plugin is regist
243
243
 
244
244
  ### Examples
245
245
 
246
- For usage examples, please refer to: [WebpackChain usage examples](https://modernjs.dev/builder/en/guide/advanced/custom-webpack-config.html#webpack-chain-basics).
246
+ For usage examples, please refer to: [Rsbuild - bundlerChain examples](https://rsbuild.dev/guide/basic/configure-rspack#examples).
@@ -52,5 +52,5 @@ export default {
52
52
  ```
53
53
 
54
54
  :::tip 禁用代码压缩
55
- 如果你需要禁用代码压缩,可以使用 [output.disableMinimize](https://modernjs.dev/builder/api/config-output.html#outputdisableminimize) 配置项。
55
+ 如果你需要禁用代码压缩,可以使用 [output.minify](/configure/app/output/minify) 配置项。
56
56
  :::
@@ -8,10 +8,13 @@ title: tsLoader
8
8
  - **默认值:** `undefined`
9
9
  - **打包工具:** `仅支持 webpack`
10
10
 
11
- :::warning 不再推荐使用 ts-loader
12
- 使用 [babel-loader](https://modernjs.dev/builder/guide/basic/typescript.html#%E4%B8%BA%E4%BB%80%E4%B9%88%E9%BB%98%E8%AE%A4%E4%BD%BF%E7%94%A8-babel) 或 [Rspack](https://modernjs.dev/guide/advanced/rspack-start.html) 转译 TypeScript 代码的性能明显优于 ts-loader 且能够使用更多拓展能力。
11
+ :::warning 废弃提示
12
+
13
+ 不推荐在项目中使用 ts-loader,原因如下:
14
+
15
+ - 启用 ts-loader 时将无法使用 [source.transformImport](/configure/app/source/transform-import) 和 [tools.styledComponents](/configure/app/tools/styled-components) 等由 Babel 和 SWC 提供支持的能力。
16
+ - Rspack 不支持使用 ts-loader。
13
17
 
14
- 启用 ts-loader 时将无法使用 [source.transformImport](https://modernjs.dev/configure/app/source/transform-import.html) 和 [tools.styledComponents](https://modernjs.dev/configure/app/tools/styled-components.html) 等由 Babel 和 SWC 提供支持的能力。
15
18
  :::
16
19
 
17
20
  项目中默认不开启 ts-loader,当 `tools.tsLoader` 不为 undefined 则表示开启 ts-loader,同时禁用 babel-loader 对 TypeScript 的编译。
@@ -231,8 +231,8 @@ Modern.js 中预先定义了一些常用的 Chain ID,你可以通过这些 ID
231
231
  | `PLUGIN.REACT_FAST_REFRESH` | 对应 `ReactFastRefreshPlugin` |
232
232
  | `PLUGIN.NODE_POLYFILL_PROVIDE` | 对应处理 node polyfill 的 `ProvidePlugin` |
233
233
  | `PLUGIN.SUBRESOURCE_INTEGRITY` | 对应 `webpack-subresource-integrity` |
234
- | `PLUGIN.ASSETS_RETRY` | 对应 webpack 静态资源重试插件 `WebpackAssetsRetryPlugin` |
235
- | `PLUGIN.AUTO_SET_ROOT_SIZE` | 对应自动设置根字体大小插件 `AutoSetRootSizePlugin` |
234
+ | `PLUGIN.ASSETS_RETRY` | 对应 webpack 静态资源重试插件 `WebpackAssetsRetryPlugin` |
235
+ | `PLUGIN.AUTO_SET_ROOT_SIZE` | 对应自动设置根字体大小插件 `AutoSetRootSizePlugin` |
236
236
 
237
237
  #### CHAIN_ID.MINIMIZER
238
238
 
@@ -247,4 +247,4 @@ Modern.js 中预先定义了一些常用的 Chain ID,你可以通过这些 ID
247
247
 
248
248
  ### 使用示例
249
249
 
250
- 使用示例可参考:[WebpackChain 使用示例](https://modernjs.dev/builder/guide/advanced/custom-webpack-config.html#%E4%BD%BF%E7%94%A8-webpack-chain)。
250
+ 使用示例可参考:[Rsbuild - bundlerChain 使用示例](https://rsbuild.dev/zh/guide/basic/configure-rspack#%E7%A4%BA%E4%BE%8B)。
package/package.json CHANGED
@@ -15,17 +15,17 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "0.0.0-nightly-20241026170639",
18
+ "version": "0.0.0-nightly-20241028170700",
19
19
  "publishConfig": {
20
20
  "registry": "https://registry.npmjs.org/",
21
21
  "access": "public",
22
22
  "provenance": true
23
23
  },
24
24
  "dependencies": {
25
- "@modern-js/sandpack-react": "0.0.0-nightly-20241026170639"
25
+ "@modern-js/sandpack-react": "0.0.0-nightly-20241028170700"
26
26
  },
27
27
  "devDependencies": {
28
- "@rspress/shared": "1.31.1",
28
+ "@rspress/shared": "1.35.2",
29
29
  "@types/fs-extra": "9.0.13",
30
30
  "@types/node": "^16",
31
31
  "classnames": "^2",
@@ -33,7 +33,7 @@
33
33
  "fs-extra": "^10",
34
34
  "react": "^18.3.1",
35
35
  "react-dom": "^18.3.1",
36
- "rspress": "1.31.1",
36
+ "rspress": "1.35.2",
37
37
  "ts-node": "^10.9.1",
38
38
  "typescript": "^5"
39
39
  },