This commit is contained in:
2020-03-07 19:50:28 +03:00
commit feaa706ab9
6 changed files with 278 additions and 0 deletions
@@ -0,0 +1,15 @@
const fs = require('fs');
const path = require('path');
const glob = require(path.resolve('node_modules', 'glob'));
module.exports = (hbs, rootDir) => {
glob
.sync(`${rootDir}/**/*`, {
nodir: true
})
.forEach((m) => {
const partialName = path.relative(rootDir, m).split(path.sep).join('/')
hbs.registerPartial(partialName, fs.readFileSync(m, 'utf8'))
})
}