From ddeed7e24673b3e05e40b9aae3e272587aeba995 Mon Sep 17 00:00:00 2001 From: ULIVZ <472590061@qq.com> Date: Tue, 26 Jun 2018 20:27:42 +0800 Subject: [PATCH] docs: wip commit --- docs/plugin/README.md | 45 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 4 deletions(-) diff --git a/docs/plugin/README.md b/docs/plugin/README.md index 2c7b5234..44586fe5 100644 --- a/docs/plugin/README.md +++ b/docs/plugin/README.md @@ -62,7 +62,7 @@ module.exports = { ### Use plugins from npm -A plugin can be published on npm in `CommonJS` format as `vuepress-plugin-xxx` . Then you can use it like this: +A plugin can be published on npm in `CommonJS` format as `vuepress-plugin-xxx`. Then you can use it like this: ``` js module.exports = { @@ -271,12 +271,49 @@ module.exports = { ``` module.exports = (options, context) => { - return { - enable: !context.isProd - } + // ... } ``` +### context.isProd + +- Type: `boolean` + +Whether vuepress run in production environment mode. + +### context.sourceDir + +- Type: `string` + +Root path of the docs. + +### context.outDir + +- Type: `string` + +Output path. + +### context.themePath + +- Type: `string` + +The path of the currently active theme. + +### context.publicPath + +- Type: `string` + +See: [base](../config/README.md#base). + +### context.resolve + +- Type: `Function` + +### context.writeTemp + +- Type: `Function` + + ## Lifecycle -- GitLab