node.js - Gulp Nodemon - how do I make Nodemon exit on file change -
currently have simple gulp build script:
const gulp = require('gulp'); const ts = require('gulp-typescript'); const tsproject = ts.createproject('tsconfig.json'); const del = require('del'); const nodemon = require('gulp-nodemon'); gulp.task('build-clean', function() { return del('dist'); }); gulp.task('build', ['build-clean'], function () { return gulp.src('src/**/*.ts') .pipe(tsproject()) .pipe(gulp.dest('dist')); }); gulp.task('start', ['build'], function () { nodemon({ script: 'dist/app.js' , ext: 'js html' }) })
this reloads page on changes js
or html
files.
this useful developing, on production want exact opposite. if files change, that's because of git push server. means jenkins run, after that's finished jenkins push code webfolder.
i want stop nodemon server if jenkins pushes code, because fresh gulp-build executed, including nodemon server.
so - how can make nodemon exit after files change instead of restarting?
maybe should use node
in production instead of nodemon
gulp.task('start', ['build'], function () { node({ script: 'dist/app.js' , ext: 'js html' }) })
Comments
Post a Comment