broccoli-coffee
Advanced tools
Comparing version 0.0.2 to 0.0.3
# master | ||
## 0.0.2 | ||
# 0.0.3 | ||
* Expose new functional syntax | ||
# 0.0.2 | ||
* Use new `Filter` architecture | ||
## 0.0.1 | ||
# 0.0.1 | ||
* Initial release |
module.exports = function (broccoli) { | ||
CoffeeScriptFilter.prototype = Object.create(broccoli.Filter.prototype) | ||
CoffeeScriptFilter.prototype.constructor = CoffeeScriptFilter | ||
function CoffeeScriptFilter (options) { | ||
function CoffeeScriptFilter (inputTree, options) { | ||
this.inputTree = inputTree | ||
this.options = options || {} | ||
@@ -11,3 +12,3 @@ } | ||
CoffeeScriptFilter.prototype.processString = function (string, info) { | ||
CoffeeScriptFilter.prototype.processString = function (string) { | ||
// We must be careful to create a fresh options hash every time. | ||
@@ -27,3 +28,5 @@ // https://github.com/jashkenas/coffee-script/issues/1924#issuecomment-28157026 | ||
return CoffeeScriptFilter | ||
return function filterCoffeeScript (inputTree, options) { | ||
return new CoffeeScriptFilter(inputTree, options) | ||
} | ||
} |
{ | ||
"name": "broccoli-coffee", | ||
"description": "CoffeeScript preprocessor for Broccoli", | ||
"version": "0.0.2", | ||
"description": "CoffeeScript filter for Broccoli", | ||
"version": "0.0.3", | ||
"author": "Jo Liss <joliss42@gmail.com>", | ||
@@ -6,0 +6,0 @@ "main": "index.js", |
# broccoli-coffee | ||
A CoffeeScript preprocessor for Broccoli. | ||
A CoffeeScript filter for Broccoli. | ||
@@ -8,4 +8,4 @@ ## Usage | ||
```js | ||
var CoffeeScriptFilter = require('broccoli-coffee')(broccoli); | ||
tree.addTransformer(new CoffeeScriptFilter); | ||
var filterCoffeeScript = require('broccoli-coffee')(broccoli); | ||
tree = filterCoffeeScript(tree, options); | ||
``` | ||
@@ -21,5 +21,9 @@ | ||
```js | ||
new CoffeeScriptFilter({ | ||
filterCoffeeScript(tree, { | ||
bare: true | ||
}) | ||
``` | ||
## Source Maps | ||
Source maps are not yet supported. |
Sorry, the diff of this file is not supported yet
3274
27
28