Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
move task configs to separate properties.
Browse files Browse the repository at this point in the history
remove watch on gulpfile.js
  • Loading branch information
rhutchison committed Jul 21, 2015
1 parent 00a4c06 commit 0f7cf54
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 3 additions & 1 deletion config/assets/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ module.exports = {
views: ['modules/*/client/views/**/*.html']
},
server: {
allJS: ['gruntfile.js', 'server.js', 'config/**/*.js', 'modules/*/server/**/*.js'],
gruntConfig: 'gruntfile.js',
gulpConfig: 'gulpfile.js',
allJS: ['server.js', 'config/**/*.js', 'modules/*/server/**/*.js'],
models: 'modules/*/server/models/**/*.js',
routes: ['modules/!(core)/server/routes/**/*.js', 'modules/core/server/routes/**/*.js'],
sockets: 'modules/*/server/sockets/**/*.js',
Expand Down
6 changes: 3 additions & 3 deletions gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module.exports = function (grunt) {
}
},
serverJS: {
files: defaultAssets.server.allJS,
files: _.union(defaultAssets.server.gruntConfig, defaultAssets.server.allJS),
tasks: ['jshint'],
options: {
livereload: true
Expand Down Expand Up @@ -78,7 +78,7 @@ module.exports = function (grunt) {
options: {
nodeArgs: ['--debug'],
ext: 'js,html',
watch: _.union(defaultAssets.server.views, defaultAssets.server.allJS, defaultAssets.server.config)
watch: _.union(defaultAssets.server.gruntConfig, defaultAssets.server.views, defaultAssets.server.allJS, defaultAssets.server.config)
}
}
},
Expand All @@ -91,7 +91,7 @@ module.exports = function (grunt) {
},
jshint: {
all: {
src: _.union(defaultAssets.server.allJS, defaultAssets.client.js, testAssets.tests.server, testAssets.tests.client, testAssets.tests.e2e),
src: _.union(defaultAssets.server.gruntConfig, defaultAssets.server.allJS, defaultAssets.client.js, testAssets.tests.server, testAssets.tests.client, testAssets.tests.e2e),
options: {
jshintrc: true,
node: true,
Expand Down
3 changes: 2 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ gulp.task('watch', function() {
plugins.livereload.listen();

// Add watch rules
gulp.watch(defaultAssets.server.gulpConfig, ['jshint']);
gulp.watch(defaultAssets.server.views).on('change', plugins.livereload.changed);
gulp.watch(defaultAssets.server.allJS, ['jshint']).on('change', plugins.livereload.changed);
gulp.watch(defaultAssets.client.views).on('change', plugins.livereload.changed);
Expand All @@ -65,7 +66,7 @@ gulp.task('csslint', function (done) {

// JS linting task
gulp.task('jshint', function () {
return gulp.src(_.union(defaultAssets.server.allJS, defaultAssets.client.js, testAssets.tests.server, testAssets.tests.client, testAssets.tests.e2e))
return gulp.src(_.union(defaultAssets.server.gulpConfig, defaultAssets.server.allJS, defaultAssets.client.js, testAssets.tests.server, testAssets.tests.client, testAssets.tests.e2e))
.pipe(plugins.jshint())
.pipe(plugins.jshint.reporter('default'))
.pipe(plugins.jshint.reporter('fail'));
Expand Down

0 comments on commit 0f7cf54

Please sign in to comment.