gulp-cortex-handlebars-compiler
Advanced tools
Comparing version 0.2.1 to 0.2.2
38
index.js
@@ -23,12 +23,4 @@ 'use strict'; | ||
this.cwd = options.cwd || process.cwd(); | ||
this.ext = options.ext || '.js'; | ||
// ``` | ||
// root/ | ||
// |-- <name> | ||
// |-- <version> | ||
// |-- template | ||
// |-- index.html | ||
// ``` | ||
this.root = options.root || '../../'; | ||
this.js_ext = options.js_ext || '.js'; | ||
this.href_root = options.href_root || ''; | ||
this.jsons = {}; | ||
@@ -68,16 +60,20 @@ } | ||
var dirname = node_path.dirname(path); | ||
var relative = node_path.relative(dirname, this.cwd); | ||
var root = node_path.join(this.root, relative); | ||
var compiled; | ||
try { | ||
compiled = compiler({ | ||
pkg: pkg, | ||
shrinkWrap: shrinkWrap, | ||
cwd: this.cwd, | ||
path: path, | ||
ext: this.js_ext, | ||
href_root: this.href_root | ||
}).compile(template); | ||
} catch(e) { | ||
return callback(e); | ||
} | ||
var c = compiler({ | ||
pkg: pkg, | ||
shrinkWrap: shrinkWrap, | ||
ext: this.ext, | ||
root: root | ||
}); | ||
var compiled = c.compile(template); | ||
var rendered = compiled(); | ||
callback(null, rendered); | ||
}.bind(this)); | ||
@@ -84,0 +80,0 @@ }; |
{ | ||
"name": "gulp-cortex-handlebars-compiler", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "Gulp task builder for cortex-handlebars-compiler", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6630
118