Open ishfx opened 1 year ago
Please create a repro repo.
I have similar problem.
Time if ignore /dist disabled: ✔ ServiceBroker with 43 service(s) started successfully in 6s Time if ignore /dist enabled: ✔ ServiceBroker with 43 service(s) started successfully in 3s
We need option like that: https://webpack.js.org/configuration/watch/#watchoptionsignored
Prerequisites
Please answer the following questions for yourself before submitting an issue.
Current Behavior
In a monorepo, with 2 projects: a moleculer project and a helper project. The moleculer project imports the helper project. When the hot reload middleware is enabled, any file changes in the moleculer project causes high cpu usage because the hot relaod is stuck in circular dependency.
Expected Behavior
No circular dependency and normal hot reload.
Failure Information
Steps to Reproduce
Please provide detailed steps for reproducing the issue.
Reproduce code snippet
Context
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
Solution
Add option to hot reload middleware to ignore build directory of other monorepo projects (
dist
,build
,out
, etc)Here is the line : https://github.com/moleculerjs/moleculer/blob/v0.14.29/src/middlewares/hot-reload.js#L241
Example with hardcoded value :