fastify / fastify-autoload

Require all plugins in a directory
MIT License
333 stars 67 forks source link

fix: check require.cache to find preloaded modules #406

Open jean-michelet opened 3 months ago

jean-michelet commented 3 months ago

Fixes #404

I tested on the reproduction repo and it does work well: https://github.com/zetaraku/fastify-app

mcollina commented 3 months ago

Thanks for opening a PR! Can you please add a unit test?

jean-michelet commented 3 months ago

@zetaraku seems to prefer this to be fixed in fastify-cli. Maybe we should investigate, plus I am not sure how to write relevant unit tests for this.

Are you willing to push a PR on cli @zetaraku? As a POC?

zetaraku commented 3 months ago

Will try to make one later.