templatizer
Advanced tools
Comparing version 0.0.1 to 0.0.2
{ | ||
"name": "templatizer", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"author": "Henrik Joreteg <henrik@andyet.net>", | ||
@@ -5,0 +5,0 @@ "description": "Simple solution for compiling jade templates into vanilla JS functions for blazin' fast client-side use.", |
@@ -16,4 +16,5 @@ # templatizer.js | ||
1. `npm install templatizer` | ||
1. Write all your templates as individual jade files in a folder in your project. | ||
2. Somewhere in your build process do this: | ||
1. Somewhere in your build process do this: | ||
@@ -20,0 +21,0 @@ ```js |
@@ -13,3 +13,11 @@ var jade = require('jade'), | ||
// we var scope it so it doesn't create a global | ||
var output = [ | ||
var jadeRuntime, output; | ||
try { | ||
jadeRuntime = fs.readFileSync(__dirname + '/../jade/runtime.min.js'); | ||
} catch (e) { | ||
jadeRuntime = fs.readFileSync(__dirname + '/node_modules/jade/runtime.min.js'); | ||
} | ||
output = [ | ||
'(function () {', | ||
@@ -19,3 +27,3 @@ 'var root = this, exports = {};', | ||
'// The jade runtime:', | ||
'var ' + fs.readFileSync(__dirname + '/node_modules/jade/runtime.min.js'), | ||
'var ' + jadeRuntime, | ||
'' | ||
@@ -22,0 +30,0 @@ ].join('\n'); |
26056
619
60