From 3c51e2663e2c8ae59a77a9de09fcd532588e04c0 Mon Sep 17 00:00:00 2001 From: NtskwK Date: Tue, 10 Sep 2024 17:00:34 +0800 Subject: [PATCH] feat: Update configuring of compilation (#145) --- docs/advanced/tree-shake.md | 4 ++-- docs/config/configuring-farm.md | 2 +- docs/tutorials/3-build.md | 2 +- .../current/advanced/tree-shake.md | 4 ++-- .../current/config/configuring-farm.md | 2 +- .../current/tutorials/3-build.md | 2 +- .../version-0.x/features/tree-shake.md | 6 +++--- versioned_docs/version-0.x/features/tree-shake.md | 6 +++--- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/advanced/tree-shake.md b/docs/advanced/tree-shake.md index 0efbf6ddc..fb53d78bc 100644 --- a/docs/advanced/tree-shake.md +++ b/docs/advanced/tree-shake.md @@ -27,12 +27,12 @@ export b1 = "B1"; `b2` is not used and will be removed in both `a.js` and `b.js` ## Configuring Tree Shake -Tree Shake is enabled in production mode by default, to disable tree shake, use `compilation.treeShake`: +Tree Shake is enabled in production mode by default, to disable tree shake, use `compilation.treeShaking`: ```ts title="farm.config.ts" export default { compilation: { - treeShake: false, + treeShaking: false, }, }; ``` diff --git a/docs/config/configuring-farm.md b/docs/config/configuring-farm.md index b2568d9e5..06a6d65f3 100644 --- a/docs/config/configuring-farm.md +++ b/docs/config/configuring-farm.md @@ -89,7 +89,7 @@ export default defineConfig({ lazyCompilation: false, persistentCache: false, minify: false, - treeShake: false + treeShaking: false }, }); ``` diff --git a/docs/tutorials/3-build.md b/docs/tutorials/3-build.md index a344511cd..98dd2315f 100644 --- a/docs/tutorials/3-build.md +++ b/docs/tutorials/3-build.md @@ -112,7 +112,7 @@ pnpm add -D core-js@3 ::: ## Configure Tree Shake and Minify -Production optimization like `treeShake` and `minify` are **disabled** by default in `development` for performance reasons, and **enabled** by default in `production`. But if `treeShake` or `minify` are configured manually, the default value will be used regardless of `development` or `production`. +Production optimization like `treeShaking` and `minify` are **disabled** by default in `development` for performance reasons, and **enabled** by default in `production`. But if `treeShaking` or `minify` are configured manually, the default value will be used regardless of `development` or `production`. For details about tree shake and minify, see: * [Tree Shake](/docs/advanced/tree-shake) diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/advanced/tree-shake.md b/i18n/zh/docusaurus-plugin-content-docs/current/advanced/tree-shake.md index 757b1ef6e..35c30acea 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/advanced/tree-shake.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/advanced/tree-shake.md @@ -35,12 +35,12 @@ export b1 = "B1"; ## 配置 Tree Shake -Tree Shake 默认在生产模式下启用,要禁用 tree Shake,请使用 `compilation. treeShake`: +Tree Shake 默认在生产模式下启用,要禁用 tree Shake,请使用 `compilation. treeShaking`: ```ts title="farm.config.ts" export default { compilation: { - treeShake: false, + treeShaking: false, }, }; ``` diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/config/configuring-farm.md b/i18n/zh/docusaurus-plugin-content-docs/current/config/configuring-farm.md index 2300c0631..1fc55c619 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/config/configuring-farm.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/config/configuring-farm.md @@ -89,7 +89,7 @@ export default defineConfig({ lazyCompilation: false, persistentCache: false, minify: false, - treeShake: false + treeShaking: false }, }); ``` diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/tutorials/3-build.md b/i18n/zh/docusaurus-plugin-content-docs/current/tutorials/3-build.md index ef44ebccb..206cc1f45 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/tutorials/3-build.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/tutorials/3-build.md @@ -115,7 +115,7 @@ pnpm add -D core-js@3 ::: ## 配置 Tree Shake 和 Minify -出于性能原因,像`treeShake`和`minify`这样的生产优化在`development`中默认被`禁用`,而在`生产`中默认被`启用`。 但如果手动配置了`treeShake`或`minify`,则无论`development`或`productive`都将使用默认值。 +出于性能原因,像`treeShaking`和`minify`这样的生产优化在`development`中默认被`禁用`,而在`生产`中默认被`启用`。 但如果手动配置了`treeShaking`或`minify`,则无论`development`或`productive`都将使用默认值。 有关 Tree Shake 和 Minify 的详细信息,请参阅: * [Tree Shake](/docs/advanced/tree-shake) diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-0.x/features/tree-shake.md b/i18n/zh/docusaurus-plugin-content-docs/version-0.x/features/tree-shake.md index 310db52d8..151b38b7c 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/version-0.x/features/tree-shake.md +++ b/i18n/zh/docusaurus-plugin-content-docs/version-0.x/features/tree-shake.md @@ -1,5 +1,5 @@ # Tree Shake -Farm 支持 Tree Shake,在默认 Production 环境下自动开启。通过 `compilation.treeShake` 选项可控制开启或者关闭。 +Farm 支持 Tree Shake,在默认 Production 环境下自动开启。通过 `compilation.treeShaking` 选项可控制开启或者关闭。 Tree Shake 时,会自动读取 package.json 中的 sideEffects 字段,有 sideEffect 的模块将不会进行 Tree Shake。 @@ -27,12 +27,12 @@ export b1 = "B1"; `b2`未使用,将在`a.js`和`b.js`中删除 ## 配置 Tree Shake -默认情况下,在生产模式下启用 Tree Shake,要禁用 Tree Shake,请使用`compilation.treeShake`: +默认情况下,在生产模式下启用 Tree Shake,要禁用 Tree Shake,请使用`compilation.treeShaking`: ```ts title="farm.config.ts" export default { compilation: { - treeShake: false, + treeShaking: false, }, }; ``` diff --git a/versioned_docs/version-0.x/features/tree-shake.md b/versioned_docs/version-0.x/features/tree-shake.md index 5a09f9c2c..1859aa0cb 100644 --- a/versioned_docs/version-0.x/features/tree-shake.md +++ b/versioned_docs/version-0.x/features/tree-shake.md @@ -1,5 +1,5 @@ # Tree Shake -Farm supports Tree Shake, which is automatically enabled in the default Production environment. It can be turned on or off by the `compilation.treeShake` option. +Farm supports Tree Shake, which is automatically enabled in the default Production environment. It can be turned on or off by the `compilation.treeShaking` option. During Tree Shake, the sideEffects field in package.json will be automatically read, and modules with sideEffects will not perform Tree Shake. @@ -27,12 +27,12 @@ export b1 = "B1"; `b2` is not used and will be removed in both `a.js` and `b.js` ## Configuring Tree Shake -Tree Shake is enabled in production mode by default, to disable tree shake, use `compilation.treeShake`: +Tree Shake is enabled in production mode by default, to disable tree shake, use `compilation.treeShaking`: ```ts title="farm.config.ts" export default { compilation: { - treeShake: false, + treeShaking: false, }, }; ```