From 41215a9a1cbedd82e1db31cc116243910f5af4a4 Mon Sep 17 00:00:00 2001 From: huei90 Date: Wed, 14 May 2014 11:33:43 +0800 Subject: [PATCH] Replace connect as browserSync --- Gruntfile.js | 20 +++++++++++++++++++- package.json | 2 +- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index b451473..06a1915 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -52,6 +52,24 @@ module.exports = function (grunt) { } } }, + browserSync: { + dev: { + bsFiles: { + src: ['index.html', 'demo/**', 'dist/angular-validation.js'] + }, + options: { + host: "localhost", + ports: { + min: 8000, + max: 8100 + }, + server: { + baseDir: '.' + }, + watchTask: true + } + } + }, watch: { files: ['src/*.js'], tasks: ['build'], @@ -73,7 +91,7 @@ module.exports = function (grunt) { require( "load-grunt-tasks" )( grunt ); // Register Task - grunt.registerTask('dev', ['connect', 'watch']); + grunt.registerTask('dev', ['browserSync', 'watch']); grunt.registerTask('build', ['clean', 'concat', 'uglify']) }; \ No newline at end of file diff --git a/package.json b/package.json index 1b9978b..67bb1b2 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "devDependencies": { "grunt": "~0.4.4", "grunt-contrib-watch": "~0.6.1", - "grunt-contrib-connect": "~0.7.0", + "grunt-browser-sync": "~0.7.4", "grunt-contrib-concat": "~0.4.0", "grunt-contrib-uglify": "~0.4.0", "grunt-contrib-copy": "~0.5.0",