require-j: Client-side Jade with template inheritance
require-j attempts to fill the gap left by porting jade over to the client, namely the ability to use template inheritance constructs such as extends and include.
To load templates, jade depends on certain node modules (such as path
and fs
) to exist during runtime and uses require
to access them. The problem is that node's require
is replaced by RequireJS's require
which has no notion of node modules.
To address this issue, require-j overrides jade's default parseInclude and parseExtends functions with a variant that utilizes RequireJS APIs, such as toUrl and fetchText
. This is achieved without any modifications to the jade library.
Written by Mark Fayngersh
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Plugin
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#