Skip to content

Commit eae04e4

Browse files
committed
Merge pull request #1777 from angular-fullstack/feat/gulp-debug
feat(gulp): add serve:debug, add gulp-node-inspector
2 parents 1e1c7ed + f6eb26d commit eae04e4

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
lines changed

Diff for: app/templates/_package.json

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
"gulp-mocha": "^2.1.3",
6969
"gulp-ng-annotate": "^2.0.0",
7070
"gulp-ng-constant": "^1.1.0",
71+
"gulp-node-inspector": "^0.1.0",
7172
"gulp-plumber": "^1.0.1",
7273
"gulp-protractor": "^2.1.0",
7374
"gulp-rename": "^1.2.2",

Diff for: app/templates/gulpfile.babel(gulp).js

+26-3
Original file line numberDiff line numberDiff line change
@@ -375,17 +375,29 @@ gulp.task('start:client', cb => {
375375
});
376376
});
377377

378+
gulp.task('start:server', () => {
379+
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
380+
config = require(`./${serverPath}/config/environment`);
381+
nodemon(`-w ${serverPath} ${serverPath}`)
382+
.on('log', onServerLog);
383+
});
384+
378385
gulp.task('start:server:prod', () => {
379386
process.env.NODE_ENV = process.env.NODE_ENV || 'production';
380387
config = require(`./${paths.dist}/${serverPath}/config/environment`);
381388
nodemon(`-w ${paths.dist}/${serverPath} ${paths.dist}/${serverPath}`)
382389
.on('log', onServerLog);
383390
});
384391

385-
gulp.task('start:server', () => {
392+
gulp.task('start:inspector', () => {
393+
gulp.src([])
394+
.pipe(plugins.nodeInspector());
395+
});
396+
397+
gulp.task('start:server:debug', () => {
386398
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
387-
config = require(`./${serverPath}/config/environment`);
388-
nodemon(`-w ${serverPath} ${serverPath}`)
399+
config = require(`./${serverPath}/config/environment`);
400+
nodemon(`-w ${serverPath} --debug-brk ${serverPath}`)
389401
.on('log', onServerLog);
390402
});
391403

@@ -443,6 +455,17 @@ gulp.task('serve:dist', cb => {
443455
cb);
444456
});
445457

458+
gulp.task('serve:debug', cb => {
459+
runSequence(['clean:tmp', 'constant'<% if(filters.ts) { %>, 'tsd'<% } %>],
460+
['lint:scripts', 'inject'<% if(filters.jade) { %>, 'jade'<% } %>],
461+
['wiredep:client'],
462+
['transpile:client', 'styles'],
463+
'start:inspector',
464+
['start:server:debug', 'start:client'],
465+
'watch',
466+
cb);
467+
});
468+
446469
gulp.task('test', cb => {
447470
return runSequence('test:server', 'test:client', cb);
448471
});

0 commit comments

Comments
 (0)