From edf00565c4e2a1e90051fc4416b6bf727f0b5c56 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Tue, 21 May 2013 12:58:32 +0200 Subject: [PATCH] feat(build): Replace regard with contrib-watch --- templates/common/Gruntfile.js | 15 +++++++++------ templates/common/package.json | 4 ++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/templates/common/Gruntfile.js b/templates/common/Gruntfile.js index d7c8ca9e9..fa4f6f9bc 100644 --- a/templates/common/Gruntfile.js +++ b/templates/common/Gruntfile.js @@ -1,5 +1,6 @@ 'use strict'; -var lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet; +var LIVERELOAD_PORT = 35729; +var lrSnippet = require('connect-livereload')({ port: LIVERELOAD_PORT }); var mountFolder = function (connect, dir) { return connect.static(require('path').resolve(dir)); }; @@ -21,6 +22,9 @@ module.exports = function (grunt) { grunt.initConfig({ yeoman: yeomanConfig, watch: { + options: { + nospawn: true + }, coffee: { files: ['<%%= yeoman.app %>/scripts/{,*/}*.coffee'], tasks: ['coffee:dist'] @@ -34,13 +38,15 @@ module.exports = function (grunt) { tasks: ['compass'] }, livereload: { + options: { + livereload: LIVERELOAD_PORT + }, files: [ '<%%= yeoman.app %>/{,*/}*.html', '{.tmp,<%%= yeoman.app %>}/styles/{,*/}*.css', '{.tmp,<%%= yeoman.app %>}/scripts/{,*/}*.js', '<%%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}' - ], - tasks: ['livereload'] + ] } }, connect: { @@ -260,13 +266,10 @@ module.exports = function (grunt) { } }); - grunt.renameTask('regarde', 'watch'); - grunt.registerTask('server', [ 'clean:server', 'coffee:dist', 'compass:server', - 'livereload-start', 'connect:livereload', 'open', 'watch' diff --git a/templates/common/package.json b/templates/common/package.json index 412959400..4e7ac84db 100644 --- a/templates/common/package.json +++ b/templates/common/package.json @@ -15,14 +15,14 @@ "grunt-contrib-clean": "~0.4.1", "grunt-contrib-htmlmin": "~0.1.3", "grunt-contrib-imagemin": "~0.1.4", - "grunt-contrib-livereload": "~0.1.2", + "grunt-contrib-watch": "~0.4.0", "grunt-bower-requirejs": "~0.4.2", "grunt-usemin": "~0.1.11", - "grunt-regarde": "~0.1.1", "grunt-rev": "~0.1.0", "grunt-karma": "~0.4.3", "grunt-open": "~0.2.0", "matchdep": "~0.1.2", + "connect-livereload": "~0.1.0", "grunt-google-cdn": "~0.1.2", "grunt-ngmin": "~0.0.2" },