Fix set load middleware function

This commit is contained in:
Jim Laurie 2017-12-06 15:21:26 +01:00
parent 29e25686d1
commit dce9c3f232

View File

@ -165,7 +165,7 @@ const mountMiddlewares = function (files, cwd) {
loaded: false
};
if (endsWith(p, 'index.js')) {
if (endsWith(p, 'index.js') && !this.middleware[name].load) {
// Lazy loading.
Object.defineProperty(this.middleware[name], 'load', {
configurable: false,