init
This commit is contained in:
@@ -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'))
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user