mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-03-06 12:11:02 +01:00
move task configs to separate properties.
remove watch on gulpfile.js
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
@@ -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'));
|
||||
|
||||
Reference in New Issue
Block a user