Skip to content

Commit

Permalink
添加grunt启动监控websocket服务以及依赖
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Jul 14, 2015
1 parent 60aa4a2 commit c52cb78
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
33 changes: 31 additions & 2 deletions Gruntfile.coffee
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
module.exports = (grunt) ->
grunt.loadNpmTasks 'grunt-concurrent'
grunt.loadNpmTasks 'grunt-nodemon'
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.loadNpmTasks 'grunt-contrib-uglify'
grunt.loadNpmTasks 'grunt-contrib-jshint'
Expand All @@ -14,6 +16,9 @@ module.exports = (grunt) ->
'build/websocket.min.js': [
'lib/websocket.js'
]
'test/websocket.min.js': [
'lib/websocket.js'
]
# app_task_test:
# options:
# beautify: true
Expand All @@ -34,6 +39,30 @@ module.exports = (grunt) ->
files: ['lib/*.js']
tasks: ['jshint','uglify']
options:
livereload: 1244
livereload: true
nodemon:
dev:
script: 'sever.js'
options:
args: ['dev']
nodeArgs: ['--debug']
callback: (nodemon) ->
nodemon.on 'log', (event) ->
console.log(event.colour)
env:
PORT: '8181'
cwd: __dirname
ignore: ['node_modules/**','bower_components/**']
debug:true
ext: 'js,coffee,html'
watch: ['*','test/*']
delay: 1
legacyWatch: true
concurrent:
target:
tasks: ['nodemon','watch']
options:
logConcurrentOutput: true
)
grunt.registerTask 'default', ['watch']
grunt.option('force',true)
grunt.registerTask 'default', ['concurrent:target']
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,10 @@
"grunt-contrib-jshint": "^0.11.2",
"grunt-contrib-uglify": "^0.9.1",
"grunt-contrib-watch": "^0.6.1"
},
"dependencies": {
"grunt-concurrent": "^2.0.0",
"grunt-nodemon": "^0.4.0",
"nodejs-websocket": "^1.2.1"
}
}

0 comments on commit c52cb78

Please sign in to comment.