From a1a4e7dd32bf040b69e8c8bfbdcae3e483eee335 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?TZ=20=7C=20=E5=A4=A9=E7=8C=AA?= Date: Fri, 9 Feb 2018 11:15:30 +0800 Subject: [PATCH] docs(plugin): add description for plugin.local.js (#2104) --- docs/source/en/core/httpclient.md | 4 ++-- docs/source/zh-cn/basics/plugin.md | 6 ++++-- docs/source/zh-cn/core/httpclient.md | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/source/en/core/httpclient.md b/docs/source/en/core/httpclient.md index cc2d053d1..c8f41cd8c 100644 --- a/docs/source/en/core/httpclient.md +++ b/docs/source/en/core/httpclient.md @@ -656,11 +656,11 @@ Framework provides [egg-development-proxyagent] plugin to help developers to deb Install and enable pulgin: ```bash -$ npm i egg-development-proxyagent --save-dev +$ npm i egg-development-proxyagent --save ``` ```js -// config/plugin.local.js +// config/plugin.js exports.proxyagent = { enable: true, package: 'egg-development-proxyagent', diff --git a/docs/source/zh-cn/basics/plugin.md b/docs/source/zh-cn/basics/plugin.md index 7c15d4e74..7c14b7a38 100644 --- a/docs/source/zh-cn/basics/plugin.md +++ b/docs/source/zh-cn/basics/plugin.md @@ -87,7 +87,7 @@ exports.onerror = false; ### 根据环境配置 -虽然上述有 `env` 字段可以配置,但我们更推荐 `plugin.{env}.js` 这种模式,会根据[运行环境](../basics/env.md)加载插件配置。 +同时,我们还支持 `plugin.{env}.js` 这种模式,会根据[运行环境](../basics/env.md)加载插件配置。 比如定义了一个开发环境使用的插件 `egg-dev`,只希望在本地环境加载,可以安装到 `devDependencies`。 @@ -113,7 +113,9 @@ exports.dev = { 这样在生产环境可以 `npm i --production` 不需要下载 `egg-dev` 的包了。 -**注意: 不存在 `plugin.default.js`。** +**注意: ** +- 不存在 `plugin.default.js` +- **只能在应用层使用,在框架层请勿使用。** ### package 和 path diff --git a/docs/source/zh-cn/core/httpclient.md b/docs/source/zh-cn/core/httpclient.md index c333ac798..58e2b56fa 100644 --- a/docs/source/zh-cn/core/httpclient.md +++ b/docs/source/zh-cn/core/httpclient.md @@ -667,11 +667,11 @@ console.log(result.res.timing); 先安装和开启插件: ```bash -$ npm i egg-development-proxyagent --save-dev +$ npm i egg-development-proxyagent --save ``` ```js -// config/plugin.local.js +// config/plugin.js exports.proxyagent = { enable: true, package: 'egg-development-proxyagent',