haml-coffee-brunch
Advanced tools
Comparing version 0.1.2 to 0.2.0
16
index.js
'use strict'; | ||
const hamlc = require('haml-coffee'); | ||
const sysPath = require('path'); | ||
@@ -10,3 +11,6 @@ class HamlCoffeeCompiler { | ||
const opts = Object.keys(options).reduce((obj, key) => { | ||
if ('ignore' !== key) { obj[key] = options[key]; } | ||
if ('ignore' !== key) { | ||
obj[key] = options[key]; | ||
} | ||
return obj; | ||
}, {}); | ||
@@ -23,11 +27,9 @@ | ||
this.options.filename = params.path; | ||
this.options.name = sysPath.basename(params.path); | ||
return new Promise((resolve, reject) => { | ||
// let compiled; | ||
let template; | ||
try { | ||
// compiled = hamlc.compile(params.data); | ||
// resolve(compiled); | ||
template = hamlc.template(params.data, params.path, 'window.JST'); | ||
template = hamlc.template(params.data, this.options.name, 'window.JST'); | ||
resolve(template); | ||
@@ -42,7 +44,5 @@ } catch (error) { | ||
HamlCoffeeCompiler.prototype.brunchPlugin = true; | ||
// HamlCoffeeCompiler.prototype.type = 'javascript'; | ||
HamlCoffeeCompiler.prototype.type = 'template'; | ||
HamlCoffeeCompiler.prototype.extension = 'hamlc'; | ||
HamlCoffeeCompiler.prototype.pattern = /^.(?:hamlc|hamlcoffee)$/; | ||
HamlCoffeeCompiler.prototype.pathReplace =/^.*templates\//; | ||
HamlCoffeeCompiler.prototype.staticExtension = 'hamlc'; | ||
HamlCoffeeCompiler.prototype.staticTargetExtension = 'jst'; | ||
@@ -49,0 +49,0 @@ |
{ | ||
"name": "haml-coffee-brunch", | ||
"version": "0.1.2", | ||
"version": "0.2.0", | ||
"description": "Brunch.io plugin for haml coffee files", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
3354