templatify
templatify copied to clipboard
Update for use with browserify v2
This is the EXACT middleware I was looking for use with browserify. Only problem is it is not compatible with browserify v2. Any chance of making this change?
Thanks, Andy
Been waiting on this to switch to 2 as well. If no one else is on it already, I'll send a PR in a few days.
Also just came across this https://github.com/epeli/node-hbsfy Compiles HBS, but doesn't do any of the helper detection / declaration like templatify
One other option is something I did before I found hbsfy. First I created knights-templar which compiles external template files for node. Then I made ktbr, which is a transform that scans for calls to the knights-templar function then inlines the template as a standalone function. I haven't tackled declaration of helpers yet though...
The only advantage to my modules that I can see over hbsfy
is that it works on both the server and the browser... Also, as substack pointed out to me, using a require()
call to include a template file isn't semantically correct since it isn't an actual js module that is being required.
Hi,
I'm open to PR if you still wish to use templatify with browserify v2. I'm not using browserify at the moment so I'm afraid I won't be able to help for the moment.
I created templatify 2 years ago, and admit I don't really remember the codebase now, or the amount of work needed to make it work with browserify v2.