aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2015-12-01 22:48:55 -0800
committerAdam Soltys <[email protected]>2015-12-01 23:43:24 -0800
commit62ca80f726b5af28b9f6de7f2b3ff32de732b566 (patch)
tree5e89e9871862fb0a93bfe151cc1914fda905cae9
parent41f8c6831bb91c0b0be1219b1566e59e48673465 (diff)
downloadcoinos-server-62ca80f726b5af28b9f6de7f2b3ff32de732b566.tar.gz
coinos-server-62ca80f726b5af28b9f6de7f2b3ff32de732b566.zip
Use browser sync
-rw-r--r--Gruntfile.coffee16
-rw-r--r--package.json6
2 files changed, 17 insertions, 5 deletions
diff --git a/Gruntfile.coffee b/Gruntfile.coffee
index 66f35542..cbdd8b48 100644
--- a/Gruntfile.coffee
+++ b/Gruntfile.coffee
@@ -24,17 +24,27 @@ module.exports = (grunt) ->
src: "*.less"
dest: 'public/css'
ext: ".css"
+ browserSync:
+ dev:
+ bsFiles:
+ src: ['views/**/*.html', 'public/js/*.js', 'public/css/*.css']
+ options:
+ open: 'local'
+ proxy: 'http://localhost:3000/'
+ watchTask: true
watch:
less:
files: ['public/css/*.less']
- tasks: ['less']
+ tasks: ['newer:less']
coffee:
files: ['**/*.coffee']
- tasks: ['coffee', 'coffeeify']
+ tasks: ['newer:coffee', 'newer:coffeeify']
)
+ grunt.loadNpmTasks('grunt-browser-sync')
grunt.loadNpmTasks('grunt-coffeeify')
grunt.loadNpmTasks('grunt-contrib-less')
grunt.loadNpmTasks('grunt-contrib-coffee')
grunt.loadNpmTasks('grunt-contrib-watch')
- grunt.registerTask('default', 'watch')
+ grunt.loadNpmTasks('grunt-newer')
+ grunt.registerTask('default', ['browserSync', 'watch'])
diff --git a/package.json b/package.json
index 683ea9af..b2574ed1 100644
--- a/package.json
+++ b/package.json
@@ -3,7 +3,7 @@
"version": "0.0.1",
"private": true,
"scripts": {
- "start": "node app.js",
+ "start": "node app.js & grunt",
"postinstall": "cp config.js.sample config.js"
},
"dependencies": {
@@ -32,10 +32,12 @@
"devDependencies": {
"coffeeify": "^1.2.0",
"grunt": "^0.4.5",
+ "grunt-browser-sync": "^2.2.0",
"grunt-browserify": "^4.0.1",
"grunt-coffeeify": "^0.1.3",
"grunt-contrib-coffee": "^0.10.1",
"grunt-contrib-less": "^1.1.0",
- "grunt-contrib-watch": "^0.6.1"
+ "grunt-contrib-watch": "^0.6.1",
+ "grunt-newer": "^1.1.1"
}
}