Skip to content

Commit 198ca2f

Browse files
committed
feat: call custom block loaders with Component as argument
1 parent 8397d72 commit 198ca2f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/loader.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,8 +410,11 @@ module.exports = function (content) {
410410
output += '\n/* customBlocks */\n'
411411
addedPrefix = true
412412
}
413-
414-
output += requireString + '\n'
413+
output +=
414+
'var customBlock = ' + requireString + '\n' +
415+
'if (typeof customBlock === "function") {' +
416+
'customBlock(Component)' +
417+
'}\n'
415418
}
416419
})
417420

0 commit comments

Comments
 (0)