diff --git a/packages/docs/docs/config/README.md b/packages/docs/docs/config/README.md index d7c7ad29c8f28b4b22ce86059747d3df0dfa1d13..d44882793034af907a645ea157ec68214261397d 100644 --- a/packages/docs/docs/config/README.md +++ b/packages/docs/docs/config/README.md @@ -104,6 +104,25 @@ A function to control what files should have `` resource hin Whether to enable placeholder loading for asynchronous loading content. if it's a stirng, it should be the name of your custom loading component. +### cache + +- Type: `boolean|string` +- Default: `true` + +VuePress uses [cache-loader](https://github.com/webpack-contrib/cache-loader) by default to greatly speed up the compilation of webpack. + +This option can be used to specify the path to the cache, and can also remove the cache before each build by setting it to `false`. + +::: tip +This option can also be used through the CLI: + +```bash +vuepress dev docs --cache .cache # set cache path +vuepress dev docs --no-cache # remove cache before each build. +``` +::: + + ## Styling ### palette.styl diff --git a/packages/docs/docs/zh/config/README.md b/packages/docs/docs/zh/config/README.md index 7c81bf515a3e675d2e63e0f18dfb94c16c8f0f92..b10c1068f10200e30d1c6de1558f010947751cc8 100644 --- a/packages/docs/docs/zh/config/README.md +++ b/packages/docs/docs/zh/config/README.md @@ -102,6 +102,23 @@ module.exports = { 是否对异步加载页面的内容开启占位符加载。如果它是一个字符串,那么它应该是自定义加载组件的名称。 +### cache + +- Type: `boolean|string` +- Default: `true` + +VuePress 默认使用了 [cache-loader](https://github.com/webpack-contrib/cache-loader) 来大大地加快 webpack 的编译速度。 + +此选项可以用于指定 cache 的路径,同时也可以通过设置为 `false` 来在每次构建之前删除 cache。 + +::: tip +这个选项也可以通过命令行来使用: +```bash +vuepress dev docs --cache .cache # 设置 cache 路径 +vuepress dev docs --no-cache # 在每次构建前删除 cache +``` +::: + ## Styling > To be translated.