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

Commit 0f7cf54

Browse files
committed
move task configs to separate properties.
remove watch on gulpfile.js
1 parent 00a4c06 commit 0f7cf54

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

config/assets/default.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ module.exports = {
3636
views: ['modules/*/client/views/**/*.html']
3737
},
3838
server: {
39-
allJS: ['gruntfile.js', 'server.js', 'config/**/*.js', 'modules/*/server/**/*.js'],
39+
gruntConfig: 'gruntfile.js',
40+
gulpConfig: 'gulpfile.js',
41+
allJS: ['server.js', 'config/**/*.js', 'modules/*/server/**/*.js'],
4042
models: 'modules/*/server/models/**/*.js',
4143
routes: ['modules/!(core)/server/routes/**/*.js', 'modules/core/server/routes/**/*.js'],
4244
sockets: 'modules/*/server/sockets/**/*.js',

gruntfile.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ module.exports = function (grunt) {
3131
}
3232
},
3333
serverJS: {
34-
files: defaultAssets.server.allJS,
34+
files: _.union(defaultAssets.server.gruntConfig, defaultAssets.server.allJS),
3535
tasks: ['jshint'],
3636
options: {
3737
livereload: true
@@ -78,7 +78,7 @@ module.exports = function (grunt) {
7878
options: {
7979
nodeArgs: ['--debug'],
8080
ext: 'js,html',
81-
watch: _.union(defaultAssets.server.views, defaultAssets.server.allJS, defaultAssets.server.config)
81+
watch: _.union(defaultAssets.server.gruntConfig, defaultAssets.server.views, defaultAssets.server.allJS, defaultAssets.server.config)
8282
}
8383
}
8484
},
@@ -91,7 +91,7 @@ module.exports = function (grunt) {
9191
},
9292
jshint: {
9393
all: {
94-
src: _.union(defaultAssets.server.allJS, defaultAssets.client.js, testAssets.tests.server, testAssets.tests.client, testAssets.tests.e2e),
94+
src: _.union(defaultAssets.server.gruntConfig, defaultAssets.server.allJS, defaultAssets.client.js, testAssets.tests.server, testAssets.tests.client, testAssets.tests.e2e),
9595
options: {
9696
jshintrc: true,
9797
node: true,

gulpfile.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ gulp.task('watch', function() {
4242
plugins.livereload.listen();
4343

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

6667
// JS linting task
6768
gulp.task('jshint', function () {
68-
return gulp.src(_.union(defaultAssets.server.allJS, defaultAssets.client.js, testAssets.tests.server, testAssets.tests.client, testAssets.tests.e2e))
69+
return gulp.src(_.union(defaultAssets.server.gulpConfig, defaultAssets.server.allJS, defaultAssets.client.js, testAssets.tests.server, testAssets.tests.client, testAssets.tests.e2e))
6970
.pipe(plugins.jshint())
7071
.pipe(plugins.jshint.reporter('default'))
7172
.pipe(plugins.jshint.reporter('fail'));

0 commit comments

Comments
 (0)