Skip to content
This repository was archived by the owner on Mar 26, 2018. It is now read-only.

Commit edf0056

Browse files
committed
feat(build): Replace regard with contrib-watch
1 parent da89e70 commit edf0056

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

templates/common/Gruntfile.js

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use strict';
2-
var lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet;
2+
var LIVERELOAD_PORT = 35729;
3+
var lrSnippet = require('connect-livereload')({ port: LIVERELOAD_PORT });
34
var mountFolder = function (connect, dir) {
45
return connect.static(require('path').resolve(dir));
56
};
@@ -21,6 +22,9 @@ module.exports = function (grunt) {
2122
grunt.initConfig({
2223
yeoman: yeomanConfig,
2324
watch: {
25+
options: {
26+
nospawn: true
27+
},
2428
coffee: {
2529
files: ['<%%= yeoman.app %>/scripts/{,*/}*.coffee'],
2630
tasks: ['coffee:dist']
@@ -34,13 +38,15 @@ module.exports = function (grunt) {
3438
tasks: ['compass']
3539
},
3640
livereload: {
41+
options: {
42+
livereload: LIVERELOAD_PORT
43+
},
3744
files: [
3845
'<%%= yeoman.app %>/{,*/}*.html',
3946
'{.tmp,<%%= yeoman.app %>}/styles/{,*/}*.css',
4047
'{.tmp,<%%= yeoman.app %>}/scripts/{,*/}*.js',
4148
'<%%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
42-
],
43-
tasks: ['livereload']
49+
]
4450
}
4551
},
4652
connect: {
@@ -260,13 +266,10 @@ module.exports = function (grunt) {
260266
}
261267
});
262268

263-
grunt.renameTask('regarde', 'watch');
264-
265269
grunt.registerTask('server', [
266270
'clean:server',
267271
'coffee:dist',
268272
'compass:server',
269-
'livereload-start',
270273
'connect:livereload',
271274
'open',
272275
'watch'

templates/common/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
"grunt-contrib-clean": "~0.4.1",
1616
"grunt-contrib-htmlmin": "~0.1.3",
1717
"grunt-contrib-imagemin": "~0.1.4",
18-
"grunt-contrib-livereload": "~0.1.2",
18+
"grunt-contrib-watch": "~0.4.0",
1919
"grunt-bower-requirejs": "~0.4.2",
2020
"grunt-usemin": "~0.1.11",
21-
"grunt-regarde": "~0.1.1",
2221
"grunt-rev": "~0.1.0",
2322
"grunt-karma": "~0.4.3",
2423
"grunt-open": "~0.2.0",
2524
"matchdep": "~0.1.2",
25+
"connect-livereload": "~0.1.0",
2626
"grunt-google-cdn": "~0.1.2",
2727
"grunt-ngmin": "~0.0.2"
2828
},

0 commit comments

Comments
 (0)