Skip to content

Commit

Permalink
feat(gulp): add serve:debug, add gulp-node-inspector
Browse files Browse the repository at this point in the history
  • Loading branch information
Awk34 committed Apr 17, 2016
1 parent 1e1c7ed commit f6eb26d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
1 change: 1 addition & 0 deletions app/templates/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"gulp-mocha": "^2.1.3",
"gulp-ng-annotate": "^2.0.0",
"gulp-ng-constant": "^1.1.0",
"gulp-node-inspector": "^0.1.0",
"gulp-plumber": "^1.0.1",
"gulp-protractor": "^2.1.0",
"gulp-rename": "^1.2.2",
Expand Down
29 changes: 26 additions & 3 deletions app/templates/gulpfile.babel(gulp).js
Original file line number Diff line number Diff line change
Expand Up @@ -375,17 +375,29 @@ gulp.task('start:client', cb => {
});
});

gulp.task('start:server', () => {
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
config = require(`./${serverPath}/config/environment`);
nodemon(`-w ${serverPath} ${serverPath}`)
.on('log', onServerLog);
});

gulp.task('start:server:prod', () => {
process.env.NODE_ENV = process.env.NODE_ENV || 'production';
config = require(`./${paths.dist}/${serverPath}/config/environment`);
nodemon(`-w ${paths.dist}/${serverPath} ${paths.dist}/${serverPath}`)
.on('log', onServerLog);
});

gulp.task('start:server', () => {
gulp.task('start:inspector', () => {
gulp.src([])
.pipe(plugins.nodeInspector());
});

gulp.task('start:server:debug', () => {
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
config = require(`./${serverPath}/config/environment`);
nodemon(`-w ${serverPath} ${serverPath}`)
config = require(`./${serverPath}/config/environment`);
nodemon(`-w ${serverPath} --debug-brk ${serverPath}`)
.on('log', onServerLog);
});

Expand Down Expand Up @@ -443,6 +455,17 @@ gulp.task('serve:dist', cb => {
cb);
});

gulp.task('serve:debug', cb => {
runSequence(['clean:tmp', 'constant'<% if(filters.ts) { %>, 'tsd'<% } %>],
['lint:scripts', 'inject'<% if(filters.jade) { %>, 'jade'<% } %>],
['wiredep:client'],
['transpile:client', 'styles'],
'start:inspector',
['start:server:debug', 'start:client'],
'watch',
cb);
});

gulp.task('test', cb => {
return runSequence('test:server', 'test:client', cb);
});
Expand Down

0 comments on commit f6eb26d

Please sign in to comment.