diff --git a/index.js b/index.js index a00d88b..9fa53f1 100644 --- a/index.js +++ b/index.js @@ -11,7 +11,7 @@ var createCoffeePreprocessor = function(args, config, logger, helper) { var options = helper.merge(defaultOptions, args.options || {}, config.options || {}); var transformPath = args.transformPath || config.transformPath || function(filepath) { - return filepath.replace(/\.coffee$/, '.js'); + return filepath.replace(/\.coffee$/, '.js').replace(/\.litcoffee$/, '.js'); }; return function(content, file, done) { @@ -25,6 +25,9 @@ var createCoffeePreprocessor = function(args, config, logger, helper) { // Clone the options because coffee.compile mutates them var opts = helper._.clone(options) + // Set literate option based on file extension + opts.literate = /\.litcoffee$/.test(file.originalPath); + try { result = coffee.compile(content, opts); } catch (e) {