       document.body.appendChild(element)
     })
     """
-
     FS.writeFileSync("#{__dirname}/tmp.js", code, 'utf-8' )
 
     console.log "Creating browser bundle..."

      result = UglifyJS.minify(src, {fromString: true})
      FS.unlink "#{__dirname}/tmp.js"

      console.log "Creating css..."
      Components.css tagname, (code)->
        css = Autoprefixer.compile(code)
        css = new CleanCSS().minify(code)
        callback {js: result.code, css: css}
        console.log "Done!"

    FS.unlink './tmp.js'
    callback result.code

module.exports.buildCSS = (store,tagname,callback)->

  Autoprefixer = require 'autoprefixer'
  CleanCSS     = require 'clean-css'
  Components = require './components'
  Components.store = store

  Components.css tagname, (code)->
    css = Autoprefixer.compile(code)
    css = new CleanCSS().minify(code)
    callback css

module.exports.buildJS = (store,tagname,callback)->

  Components = require './components'
  Components.store = store

  browserify   = require 'browserify'
  coffeeify    = require 'coffeeify'
  UglifyJS     = require 'uglify-js'
