From df33483b46fb9880126ba51124667f2559a3b8d4 Mon Sep 17 00:00:00 2001 From: Maxwell Huang-Hobbs Date: Sun, 15 Jan 2017 14:11:54 -0500 Subject: [PATCH] switch to global $require in structured documents --- server/document-types/structured-document.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/server/document-types/structured-document.js b/server/document-types/structured-document.js index 2e2d887..886213f 100644 --- a/server/document-types/structured-document.js +++ b/server/document-types/structured-document.js @@ -67,16 +67,15 @@ function parseMeta(file, meta) { try { for(const key in meta.helpers) { + const fullPath = path.join(path.dirname(file), meta.helpers[key]) try { /* eslint-disable no-undef */ - handlebars.registerHelper(key, nodeRequire( - path.join(path.dirname(file), meta.helpers[key]) - )); + handlebars.registerHelper(key, $require(fullPath)); /* eslint-enable no-undef */ } catch (e) { - throw makeClientError('could not register helper \'' + - meta.helpers[key] + '\''); + console.dir(e); + throw makeClientError('could not register helper \'' + fullPath + '\''); } }