Skip to content

Commit

Permalink
docs(core): Add the Reload configuration for the development environm…
Browse files Browse the repository at this point in the history
…ent (#5166)
  • Loading branch information
jiuhuan committed Mar 31, 2023
1 parent 3152bf5 commit 5ac2e54
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
23 changes: 23 additions & 0 deletions site/docs/core/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,29 @@ And then we may start app by `npm run dev`.

To start app in local, environment needs to be set as `env: local`. The configuration comes from the combination of both `config.local.js` and `config.default.js`.

> Note: The local development environment relies on 'egg-development' module, enabled by default, and closed other environment, Configuration reference [config/config.default.js](https://github.com/eggjs/egg-development/blob/master/config/config.default.js)
### About `Reload`

Under the following directory (including subdirectories) will watch file changes under development environment by default, trigger an Egg development environment server reload:

- ${app_root}/app
- ${app_root}/config
- ${app_root}/mocks
- ${app_root}/mocks_proxy
- ${app_root}/app.js

> set `config.development.overrideDefault` to `true` to skip defaults merge.
Under the following directory (including subdirectories) will ignore file changes under development environment by default:

- ${app_root}/app/view
- ${app_root}/app/assets
- ${app_root}/app/public
- ${app_root}/app/web

> set `config.development.overrideIgnore` to `true` to skip defaults merge.
### Port Assignment

Starting app in local will listen to port 7001 by default. You may assign other port to it like this:
Expand Down
23 changes: 23 additions & 0 deletions site/docs/core/development.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,29 @@ $ npm i egg-bin --save-dev

本地启动的应用是以 `env: local` 启动的,读取的配置也是 `config.default.js``config.local.js` 合并的结果。

> 注意:本地开发环境依赖 `egg-development` 插件,默认开启,其他环境下关闭,配置参考 [config/config.default.js](https://github.com/eggjs/egg-development/blob/master/config/config.default.js)
### 关于 `Reload` 功能

以下目录(含子目录)下默认会监听开发环境下的文件变化,触发一次Egg开发环境服务器重载:

- ${app_root}/app
- ${app_root}/config
- ${app_root}/mocks
- ${app_root}/mocks_proxy
- ${app_root}/app.js

> 设置 `config.development.overrideDefault``true` 将跳过默认合并.
以下目录下(包括子目录)默认忽略开发环境下的文件改动:

- ${app_root}/app/view
- ${app_root}/app/assets
- ${app_root}/app/public
- ${app_root}/app/web

> 设置 `config.development.overrideIgnore``true` 将跳过默认合并.
### 指定端口

本地启动应用默认监听 7001 端口,可指定其他端口,例如:
Expand Down

0 comments on commit 5ac2e54

Please sign in to comment.