From e35aa613e1cb94dc6abfe0e7df8a090daf07bd8c Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Tue, 1 Feb 2022 14:29:06 +1300 Subject: [PATCH] Add req to pug renderer; load files in better order --- index.js | 2 +- util/watch_compiler.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index a4c5e96..868a2a0 100644 --- a/index.js +++ b/index.js @@ -441,7 +441,7 @@ class Pinski { new Promise((resolve, reject) => { if (handler.type === "pug") { if (this.pugCache.has(handler.local)) { - resolve(this.pugCache.get(handler.local).web(this.pugDefaultLocals)) + resolve(this.pugCache.get(handler.local).web(Object.assign({req, url}, this.pugDefaultLocals))) } else { reject(symbols.PUG_SOURCE_NOT_FOUND) } diff --git a/util/watch_compiler.js b/util/watch_compiler.js index 192a7cf..2249090 100644 --- a/util/watch_compiler.js +++ b/util/watch_compiler.js @@ -3,11 +3,11 @@ const path = require("path"); function pathIsUseful(fullPath) { return ( - !fs.statSync(fullPath).isDirectory() - && !fullPath.endsWith("~") + !fullPath.endsWith("~") && !fullPath.startsWith(".") && !fullPath.includes("/.") && !fullPath.endsWith("#") + && !fs.statSync(fullPath).isDirectory() ) } -- 2.45.2