0
鑑於此Gruntfile.coffee
,我想保留shell:server
任務運行並輸出到shell,而watch
檢查前端資產的更改並在運行我的:compile
任務時向shell報告。
全部從相同的grunt
命令到同一個shell。運行shell命令和監視任務的單個Grunt任務?
module.exports = (grunt) ->
grunt.initConfig
pkg: grunt.file.readJSON('package.json')
coffee:
compile:
files:
'public/js/app.js': 'assets/js/app.coffee'
stylus:
compile:
files:
'public/css/app.css': 'assets/css/app.styl'
watch:
css:
files: 'assets/**/*.styl'
tasks: 'stylus'
javascript:
files: 'assets/**/*.coffee'
tasks: 'coffee'
shell:
server:
command: 'supervisor index.coffee'
options:
stdout: true
grunt.loadNpmTasks('grunt-contrib-coffee')
grunt.loadNpmTasks('grunt-contrib-stylus')
grunt.loadNpmTasks('grunt-contrib-watch')
grunt.loadNpmTasks('grunt-shell')
grunt.registerTask('work', ['default', 'shell:server', 'watch'])
grunt.registerTask('default', ['coffee', 'stylus'])
獎金將消除supervisor
贊成使用咕嚕聲來監視服務器的更改並重新啓動Web服務器。