I would like to be able to include a file in a given order by compiling coffeescript files in js using the coffee bar.
I would like to have settings.coffee , constants.coffee files included first
-- |-- settings.coffee |-- constants.coffee |-- page1.coffee |-- page2.coffee
Code snippet
fs = require 'fs' {exec, spawn} = require 'child_process' util = require 'util' task 'watch', 'Coffee bar Combine and build', -> coffee = spawn 'coffeebar', ['-w','-o','./../js/main/kc.js', './'] coffee.stdout.on 'data', (data) -> console.log data.toString().trim() invoke 'minify' task 'minify', ' Minify JS File', -> file = "./../js/main/kc" util.log "Minifiying #{file}.js" exec "uglifyjs #{file}.js > #{file}.min.js", (err,stdout,stderr) -> if err util.log "Error minifiying file" util.log err else util.log "Minified to #{file}.min.js" util.log '----------------------------'
So far, the script has put everything together in accordance with its logic.
I would appreciate any help with this.
javascript coffeescript exec minify spawn
william.eyidi
source share