From a5d2df99dd5c2f76adfb3a35580ad561e1235042 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dirk=20L=C3=BCth?= Date: Mon, 30 Jan 2017 19:37:19 +0100 Subject: [PATCH] make legacy module dependencies load earlier --- extras/handler/legacy.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/extras/handler/legacy.js b/extras/handler/legacy.js index c0b1679..c67ab14 100644 --- a/extras/handler/legacy.js +++ b/extras/handler/legacy.js @@ -27,13 +27,26 @@ function HandlerLegacy() {} HandlerLegacy.prototype = { - onPreProcess: function(dependency) { + onPreRequest: function(dependency) { var dependencies = settings[dependency.path] && settings[dependency.path].dependencies; + handlerModule.onPreRequest(dependency); + if(dependencies) { dependency.enqueue = demand.apply(null, dependencies); } }, + onPreProcess: function(dependency) { + var dependencies; + + if(!dependency.enqueue) { + dependencies = settings[dependency.path] && settings[dependency.path].dependencies; + + if(dependencies) { + dependency.enqueue = demand.apply(null, dependencies); + } + } + }, process: function(dependency) { var boundResolve = resolve.bind(dependency);