Use require.resolve to get the manifest on generation
This commit is contained in:
parent
f1997fa4a8
commit
710083d9fc
1 changed files with 2 additions and 2 deletions
|
@ -10,8 +10,8 @@ const marked = require("marked")
|
||||||
* https://github.com/budibase/handlebars-helpers
|
* https://github.com/budibase/handlebars-helpers
|
||||||
*/
|
*/
|
||||||
const { join } = require("path")
|
const { join } = require("path")
|
||||||
|
const path = require("path")
|
||||||
|
|
||||||
const DIRECTORY = join(__dirname, "..", "..", "..")
|
|
||||||
const COLLECTIONS = [
|
const COLLECTIONS = [
|
||||||
"math",
|
"math",
|
||||||
"array",
|
"array",
|
||||||
|
@ -128,7 +128,7 @@ function run() {
|
||||||
const foundNames = []
|
const foundNames = []
|
||||||
for (let collection of COLLECTIONS) {
|
for (let collection of COLLECTIONS) {
|
||||||
const collectionFile = fs.readFileSync(
|
const collectionFile = fs.readFileSync(
|
||||||
`${DIRECTORY}/node_modules/${HELPER_LIBRARY}/lib/${collection}.js`,
|
`${path.dirname(require.resolve(HELPER_LIBRARY))}/lib/${collection}.js`,
|
||||||
"utf8"
|
"utf8"
|
||||||
)
|
)
|
||||||
const collectionInfo = {}
|
const collectionInfo = {}
|
||||||
|
|
Loading…
Reference in a new issue