Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gulp-debug causes data lost #17

Closed
zhekaus opened this issue Aug 10, 2015 · 2 comments
Closed

Gulp-debug causes data lost #17

zhekaus opened this issue Aug 10, 2015 · 2 comments

Comments

@zhekaus
Copy link

zhekaus commented Aug 10, 2015

If you run the following gulpfile with represented app.js (containing error) and any index.html, then index.html will be cleared.
If you remove “.pipe(debug())”, everything will be ok.

Doesn anybody knows why is that?

Gulpfile.js :

'use strict';

var
    gulp = require('gulp'),
    jshint = require('gulp-jshint'),
    inject = require('gulp-inject'),
    debug = require('gulp-debug');

gulp.task('jshint', function () {
    gulp.src(['Gulpfile.js', 'app/js/**/*.js'])
        .pipe(jshint({
            quotmark: true
        }))
        .pipe(jshint.reporter('jshint-stylish'))
        .pipe(jshint.reporter('fail'));
});

gulp.task('inject', function () {
    return gulp.src('app/index.html')
        .pipe(debug())
        .pipe(inject(
            gulp.src(['app/js/**/*.js'], {read: false}),
            {
                addRootSlash: false,
                ignorePath: 'app'
            }
        ))
        .pipe(gulp.dest('app'))
        ;
});

gulp.task('inject', ['jshint'], function () {
    return gulp.src('app/index.html')
        .pipe(debug())
        .pipe(inject(
            gulp.src(['app/js/**/*.js'], {read: false}),
            {
                addRootSlash: false,
                ignorePath: 'app'
            }
        ))
        .pipe(gulp.dest('app'))
        ;
});

app.js :

//'use strict';
(function (){
    x
})();
@sindresorhus
Copy link
Owner

I really doubt gulp-debug is at fault as it doesn't even touch the files, just passes them through. Happy to be proven wrong with a failing test though.

I've bumped dependencies and done a new release. Maybe that might fix something.

@zhekaus
Copy link
Author

zhekaus commented Aug 10, 2015

The problem is gone. Thanks so much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants