avoids trying to load middleware exluded by scriptExtensions

This commit is contained in:
Ryan Wieghard 2018-03-27 15:18:51 -07:00
parent 2746bf5bde
commit f7108a7255
1 changed files with 2 additions and 0 deletions

View File

@ -346,6 +346,8 @@ function setupMiddleware(app, instructions) {
app.defineMiddlewarePhases(phases);
middleware.forEach(function(data) {
var middlewareUnexcluded = _.find(instructions.files.boot, function(o) { return o === data.sourceFile });
if (!middlewareUnexcluded){ return; }
debug('Configuring middleware %j%s', data.sourceFile,
data.fragment ? ('#' + data.fragment) : '');
var factory = requireNodeOrEsModule(data.sourceFile);