wiledal / gulp-include

Enables functionality similar to that of snockets / sprockets or other file insertion compilation tools.
158 stars 68 forks source link

Errors don't appear on console when file is not found #59

Closed raniesantos closed 8 years ago

raniesantos commented 8 years ago

I was testing your plugin when I found this weird behavior. My gulp task looks like this. (uglify commented-out on purpose)

// gulpfile.js

gulp.task("scripts", function() {
    return gulp
        .src("./_source/scripts/site.js")
        .pipe(sourcemaps.init())
        .pipe(include()).on("error", console.log)
        // .pipe(uglify())
        .pipe(sourcemaps.write())
        .pipe(gulp.dest("./assets/js"));
});

the src file looks like this

// site.js input/gulp.src

//=include functions.js
//=include ../../vendor/package/js/doesntexist.js

It DOES NOT LOG ERRORS, it simply continues and the output file ends up looking like this The include/require statement ends up in the output file.

// site.js output/gulp.dest

console.log("functions.js was included");

//=include ../../vendor/package/js/doesntexist.js
raniesantos commented 8 years ago

Pull request.