egg-development
Version:
development tool for egg
81 lines (54 loc) • 3.04 kB
Markdown
[![NPM version][npm-image]][npm-url]
[](https://github.com/eggjs/egg-development/actions/workflows/nodejs.yml)
[![Test coverage][codecov-image]][codecov-url]
[![Known Vulnerabilities][snyk-image]][snyk-url]
[![npm download][download-image]][download-url]
[](https://nodejs.org/en/download/)
[]: https://img.shields.io/npm/v/egg-development.svg?style=flat-square
[]: https://npmjs.org/package/egg-development
[]: https://img.shields.io/codecov/c/github/eggjs/egg-development.svg?style=flat-square
[]: https://codecov.io/github/eggjs/egg-development?branch=master
[]: https://snyk.io/test/npm/egg-development/badge.svg?style=flat-square
[]: https://snyk.io/test/npm/egg-development
[]: https://img.shields.io/npm/dm/egg-development.svg?style=flat-square
[]: https://npmjs.org/package/egg-development
This is an egg plugin for local development, under development environment enabled by default, and closed under other environment.
`egg-development` has been built-in for egg. It is enabled by default.
see [config/config.default.js](https://github.com/eggjs/egg-development/blob/master/config/config.default.js) for more detail.
- Under development environment, Output request log in STDOUT, statistic and output all key parts time-consuming;
- Watch file changes, and reload application;
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.
Developer can use `config.reloadPattern`([multimatch](https://github.com/sindresorhus/multimatch)) to control whether to reload.
```js
// config/config.default.js
exports.development = {
// don't reload when ts fileChanged
// https://github.com/sindresorhus/multimatch
reloadPattern: ['**', '!**/*.ts'],
};
```
You can view loader trace for performance issue from `http://127.0.0.1:7001/__loader_trace__`
Please open an issue [here](https://github.com/eggjs/egg/issues).
[](LICENSE)
[](https://github.com/eggjs/egg-development/graphs/contributors)
Made with [contributors-img](https://contrib.rocks).