所以,我有一个布局为的项目
src
--library
----a.coffee
----b.coffee
----c.coffee
--demo
----main.coffee
我目前已经 grunt 设置将 src/library 中的 coffeescript 编译到 middle/library,将结果连接到 middle/library.js 并放入 dist
这很好用,但现在我也想看 src/demo 并做同样的事情,我该怎么做呢?
我的咕噜声文件是:
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"]