2つのビルドスクリプトがあると言っているように聞こえますか?string.jsの場合、私はCakefileを使用して、あなたが望むと思うことを実現します。基本的に、ソースファイルが変更されると、通常のJSファイルが生成され、次に醜いファイルが生成されます。
Cakefileの関連部分は次のとおりです。
task 'watch', 'Watch src/ for changes', ->
browserTestFile = path.join(process.cwd(), 'test_browser', 'string.test.js')
coffee = spawn 'coffee', ['-w', '-c', '-o', 'lib', 'src']
coffee.stderr.on 'data', (data) -> 'ERR: ' + process.stderr.write data.toString()
coffee.stdout.on 'data', (data) ->
d = data.toString()
if d.indexOf('compiled') > 0
#invoke 'test'
fsw = fs.createWriteStream(browserTestFile, flags: 'w', encoding: 'utf8', mode: 0666)
coffee_test = spawn 'coffee', ['-c', '-p', 'test/string.test.coffee']
coffee_test.stdout.pipe(fsw, end: false)
uglify = spawn 'uglifyjs', ['lib/string.js']
uglify.stdout.pipe(fs.createWriteStream('lib/string.min.js'))
else
growl(d, title: 'Error', image: './resources/error.png')
process.stdout.write data.toString()