Skip to content

Commit

Permalink
docs(plugin): add description for plugin.local.js (#2104)
Browse files Browse the repository at this point in the history
  • Loading branch information
atian25 authored and dead-horse committed Feb 9, 2018
1 parent 2cdfcc2 commit a1a4e7d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions docs/source/en/core/httpclient.md
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
6 changes: 4 additions & 2 deletions docs/source/zh-cn/basics/plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ exports.onerror = false;

### 根据环境配置

虽然上述有 `env` 字段可以配置,但我们更推荐 `plugin.{env}.js` 这种模式,会根据[运行环境](../basics/env.md)加载插件配置。
同时,我们还支持 `plugin.{env}.js` 这种模式,会根据[运行环境](../basics/env.md)加载插件配置。

比如定义了一个开发环境使用的插件 `egg-dev`,只希望在本地环境加载,可以安装到 `devDependencies`

Expand All @@ -113,7 +113,9 @@ exports.dev = {

这样在生产环境可以 `npm i --production` 不需要下载 `egg-dev` 的包了。

**注意: 不存在 `plugin.default.js`**
**注意: **
- 不存在 `plugin.default.js`
- **只能在应用层使用,在框架层请勿使用。**

### package 和 path

Expand Down
4 changes: 2 additions & 2 deletions docs/source/zh-cn/core/httpclient.md
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit a1a4e7d

Please sign in to comment.