jedireza / hapi-react-views

:package: A hapi view engine for React components
MIT License
231 stars 33 forks source link

new option to remove require cache via regexp #64

Closed jedireza closed 7 years ago

jedireza commented 7 years ago

When requiring shared components between views/layouts, updates to those shared components are still cached. In my case I know all .jsx files should be removed from cache.

I've added a new option removeCacheRegExp. A RegExp pattern string that matches modules in the require cache and removes them.

So in my case I'd use a pattern like: \\.jsx$. Since not everyone uses .jsx extensions, this allows you to match a pattern that exists in your app.