Skip to content

Commit c25fee5

Browse files
authored
docs: add a noticeable webpack only tag (#7191)
1 parent d3852cc commit c25fee5

File tree

12 files changed

+48
-14
lines changed

12 files changed

+48
-14
lines changed

packages/document/main-doc/docs/en/configure/app/performance/transform-lodash.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ title: transformLodash
44

55
# performance.transformLodash
66

7+
import { Badge } from '@theme';
8+
9+
<Badge type="danger" >Webpack Only</Badge>
10+
711
- **Type:** `boolean`
812
- **Default:** `true`
9-
- **Bundler:** `only support webpack`
1013

1114
Specifies whether to modularize the import of [lodash](https://www.npmjs.com/package/lodash) and remove unused lodash modules to reduce the code size of lodash.
1215

packages/document/main-doc/docs/en/configure/app/source/module-scopes.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ title: moduleScopes
44

55
# source.moduleScopes
66

7+
import { Badge } from '@theme';
8+
9+
<Badge type="danger" >Webpack Only</Badge>
10+
711
- **Type:** `Array<string | Regexp> | Function`
812
- **Default:** `undefined`
9-
- **Bundler:** `only support webpack`
1013

1114
Restrict importing paths. After configuring this option, all source files can only import code from the specific paths, and import code from other paths is not allowed.
1215

packages/document/main-doc/docs/en/configure/app/tools/terser.mdx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ title: terser
44

55
# tools.terser
66

7+
import { Badge } from '@theme';
8+
9+
<Badge type="danger" >Webpack Only</Badge>
10+
711
- **Type:** `Object | Function | undefined`
812
- **Default:**
913

@@ -17,8 +21,6 @@ const defaultTerserOptions = {
1721
};
1822
```
1923

20-
- **Bundler:** `only support webpack`
21-
2224
When building for production, Modern.js will minimize the JavaScript code through [terser-webpack-plugin](https://github.com/webpack-contrib/terser-webpack-plugin). The config of [terser-webpack-plugin](https://github.com/webpack-contrib/terser-webpack-plugin) can be modified via `tools.terser`.
2325

2426
### Object Type

packages/document/main-doc/docs/en/configure/app/tools/ts-loader.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ title: tsLoader
44

55
# tools.tsLoader
66

7+
import { Badge } from '@theme';
8+
9+
<Badge type="danger" >Webpack Only</Badge>
10+
711
- **Type:** `Object | Function | undefined`
812
- **Default:** `undefined`
9-
- **Bundler:** `only support webpack`
1013

1114
:::warning Deprecated
1215

packages/document/main-doc/docs/en/configure/app/tools/webpack-chain.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ title: webpackChain
44

55
# tools.webpackChain
66

7+
import { Badge } from '@theme';
8+
9+
<Badge type="danger" >Webpack Only</Badge>
10+
711
- **Type:** `Function | undefined`
812
- **Default:** `undefined`
9-
- **Bundler:** `only support webpack`
1013

1114
You can modify the webpack configuration by configuring `tools.webpackChain` which is type of `Function`. The function receives two parameters, the first is the original webpack chain object, and the second is an object containing some utils.
1215

packages/document/main-doc/docs/en/configure/app/tools/webpack.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ title: webpack
44

55
# tools.webpack
66

7+
import { Badge } from '@theme';
8+
9+
<Badge type="danger" >Webpack Only</Badge>
10+
711
- **Type:** `Object | Function | undefined`
812
- **Default:** `undefined`
9-
- **Bundler:** `only support webpack`
1013

1114
`tools.webpack` is used to configure [webpack](https://webpack.js.org/).
1215

packages/document/main-doc/docs/zh/configure/app/performance/transform-lodash.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ title: transformLodash
44

55
# performance.transformLodash
66

7+
import { Badge } from '@theme';
8+
9+
<Badge type="danger" ><div>仅支持 Webpack</div></Badge>
10+
711
- **类型:** `boolean`
812
- **默认值:** `true`
9-
- **打包工具:** `仅支持 webpack`
1013

1114
是否模块化 [lodash](https://www.npmjs.com/package/lodash) 的导入,删除未使用的 lodash 模块,从而减少 lodash 代码体积。
1215

packages/document/main-doc/docs/zh/configure/app/source/module-scopes.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ title: moduleScopes
44

55
# source.moduleScopes
66

7+
import { Badge } from '@theme';
8+
9+
<Badge type="danger" >仅支持 Webpack</Badge>
10+
711
- **类型:** `Array<string | Regexp> | Function`
812
- **默认值:** `undefined`
9-
- **打包工具:** `仅支持 webpack`
1013

1114
限制源代码的引用路径。配置该选项后,所有源文件只能从约定的目录下引用代码,从其他目录引用代码会产生对应的报错提示。
1215

packages/document/main-doc/docs/zh/configure/app/tools/terser.mdx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ title: terser
44

55
# tools.terser
66

7+
import { Badge } from '@theme';
8+
9+
<Badge type="danger" >仅支持 Webpack</Badge>
10+
711
- **类型:** `Object | Function | undefined`
812
- **默认值:**
913

@@ -17,8 +21,6 @@ const defaultTerserOptions = {
1721
};
1822
```
1923

20-
- **打包工具:** `仅支持 webpack`
21-
2224
在生产环境构建时,Modern.js 会通过 [terser-webpack-plugin](https://github.com/webpack-contrib/terser-webpack-plugin) 对 JavaScript 代码进行压缩优化。可以通过 `tools.terser` 修改 [terser-webpack-plugin](https://github.com/webpack-contrib/terser-webpack-plugin) 的配置。
2325

2426
### Object 类型

packages/document/main-doc/docs/zh/configure/app/tools/ts-loader.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ title: tsLoader
44

55
# tools.tsLoader
66

7+
import { Badge } from '@theme';
8+
9+
<Badge type="danger" >仅支持 Webpack</Badge>
10+
711
- **类型:** `Object | Function | undefined`
812
- **默认值:** `undefined`
9-
- **打包工具:** `仅支持 webpack`
1013

1114
:::warning 废弃提示
1215

packages/document/main-doc/docs/zh/configure/app/tools/webpack-chain.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ title: webpackChain
44

55
# tools.webpackChain
66

7+
import { Badge } from '@theme';
8+
9+
<Badge type="danger" >仅支持 Webpack</Badge>
10+
711
- **类型:** `Function | undefined`
812
- **默认值:** `undefined`
9-
- **打包工具:** `仅支持 webpack`
1013

1114
你可以通过 `tools.webpackChain` 来修改默认的 webpack 配置,它的值为 `Function` 类型,接收两个参数:
1215

packages/document/main-doc/docs/zh/configure/app/tools/webpack.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ title: webpack
44

55
# tools.webpack
66

7+
import { Badge } from '@theme';
8+
9+
<Badge type="danger" >仅支持 Webpack</Badge>
10+
711
- **类型:** `Object | Function | undefined`
812
- **默认值:** `undefined`
9-
- **打包工具:** `仅支持 webpack`
1013

1114
`tools.webpack` 选项用于配置原生的 [webpack](https://webpack.js.org/)
1215

0 commit comments

Comments
 (0)