So, I have a project with a layout of
src
--library
----a.coffee
----b.coffee
----c.coffee
--demo
----main.coffee
I have grunt set up currently to compile coffeescript in src/library to intermediate/library, concat the results to intermediate/library.js and put in dist
This works fine, but now I want to also watch src/demo and do the same thing, how would I go about this?
My grunt file is:
module.exports = (grunt) ->
grunt.loadNpmTasks("grunt-contrib-coffee")
grunt.loadNpmTasks("grunt-contrib-watch")
grunt.loadNpmTasks("grunt-contrib-concat")
grunt.initConfig
watch:
coffee:
files: "src/library/**/*.coffee"
tasks: ["coffee:compile", "concat"]
coffee:
compile:
expand: true,
flatten: true,
cwd: "src/library",
src: ["**/*.coffee"],
dest: "intermediate/library/",
ext: ".js"
concat:
options:
separator: ";"
dist:
src: ["intermediate/library.js", "intermediate/library/**/*.js"]
dest: "dist/library.js"
grunt.registerTask "default", ["watch"]