 styl = require "stylus"
 nib = require "nib"
 jade = require "jade"
-ck = require "coffeekup"
 sqwish = require "sqwish"
 csso = require "csso"
 uglifyjs = require "uglify-js"

  An obj of default fileExtension: templateParserFunction pairs
  The templateParserFunction function takes contents, [filename] and returns the parsed contents
###
#metamorph = 0
templateParsers =
  # Coffeekup
  ".coffee": (contents, filename) ->
    ck.compile contents, locals: no
  # Jade
  ".jade": (contents, filename) ->
    compiled = jade.compile contents, client: yes, compileDebug: no, filename: filename
    ###
    cmp = compiled.toString()

  An obj of default fileExtension: preprocessFunction pairs
  The preprocess function takes contents, [filename] and returns the preprocessed contents
###
module.exports.preprocessors = preprocessors = {}

# Coffee-script
try
  coffee = require "iced-coffee-script"
  preprocessors[".coffee"] = (contents) ->
    coffee.compile contents

# Stylus
try
  stylus = require "stylus"
  nib = require "nib"
  preprocessors[".styl"] = (contents, filename) ->
    styl(contents)
      .set("filename", filename)
      .use(nib())
