Tag: gulp nodemon

Gulp-nodemon和监视任务

我正在尝试使用gulp和nodemon来创build我的构buildstream。 目标是观察sass文件并将其编译为css,并在服务器文件更改时重新启动节点应用程序。 我的gulpfile.js: gulp.task('sass', function(){ return gulp.src(sassFilesTobeProcessed). pipe(sass()). pipe(concat('ready_stylesheet.css')). pipe(gulp.dest('express/public/stylesheets')) }) gulp.task('watch', function(){ return gulp.watch(allSassFiles, ['sass']); }) gulp.task('serve', function(){ return nodemon({ script: 'express/app.js', }).on('start', ['watch']) .on('change', ['watch']) .on('restart', function(){ console.log('restarted'); }) }) 手表任务工作正常,更改后编译文件。 但我的app.js服务器文件中的更改不会触发服务器重新启动。 当我评论.on语句时,它开始正常工作(服务器重新加载),但是当然,sass文件不再被观察到。 因此,我认为这两者之间有一些冲突,这是我无法发现的。 感谢任何帮助! 我的操作系统 – Windows 7,节点4.2.6,nodemon 1.9.1

在未处理的exception之后安全地重新启动nodemon

我正在使用gulp并从任务运行nodemon。 每次它检测到它的变化 重新启动服务器 运行“构build”任务 是这样的顺序。 在nodemon重新启动之前,无法知道如何踢“构build”任务(设置delay参数无效)。 nodemon = require "gulp-nodemon" runSequence = require 'run-sequence' # couldn't figure out how to run gulp task # from another task, so ended up using this nodemon( script:'server.js' watch: 'src/**/*.*' ).on "restart" (files)-> runSequence "build" 现在,我的问题是 – 当构build过程中发生某些事情时,我显然无法控制(比如说Jade文件无法编译),进程会抛出uncaughtExceptionexception并崩溃。 我需要什么,重新启动nodemon,并不断尝试build设,直到失败的玉文件修复。 我尝试过运行“build”,在process.on 'uncaughtException'使用nodemon,它有点用,但是nodemon停止监视文件,不能再识别变化。 你们可以build议吗?

浏览器重新加载吞咽不起作用

nodemon + gulp +手表+服务器 目前我正在使用gulp-nodemon来启动hapijs服务器并观察跟踪文件的变化。 一切正常,唯一的问题是,我已经尝试了gulp-livereload / browser-sync / gulp-connect所有这些包,但是当在任何js / css文件中更改时,我的手表运行完美。 但浏览器不重装。 下面是我的gulp文件代码,我只想在下面的代码中集成浏览器重载function。 我不想使用Chrome扩展。 我只是想实现使用livereload端口35729。 /** * Gulp Task js for internal Javascript and CSS (Less) files * Include dependencies */ 'use strict'; var gulp = require('gulp-param')(require('gulp'), process.argv), concat = require('gulp-concat'), uglify = require('gulp-uglify'), minifyCss = require('gulp-minify-css'), runSequence = require('run-sequence'), nodemon = require('gulp-nodemon'), livereload […]

Nodemon手表选项损坏

我正在使用gulp-nodemon config目录只包含一个文件server.js。 $.nodemon({ script: 'config/server.js', watch: ['config/**/*.js'] }) .on('restart', function () { setTimeout(function () { $.livereload.changed(); }, 1000); }); 输出: [gulp] [nodemon] v1.2.1 [gulp] [nodemon] to restart at any time, enter `rs` [gulp] [nodemon] watching: config/**/*.js [gulp] [nodemon] starting `node config/server.js` [gulp] [nodemon] watching 34,325 files – this might cause high cpu usage. To reduce […]