2016-04-05 14 views
0

Mein Schluck Skript funktionierte gut einen Tag, und jetzt dies.Schluck Abhängigkeit Brüche Schluck in der Mitte

gulp.task('minify:dashboard', ['inject:dashboard'], function() { 
    var assets; 

    return gulp.src(paths.django.templates.root + '/__dashboard.html') 
    .pipe($.replace('script src="{{ STATIC_URL }}dashboard', 'script src="compile')) 

    .pipe($.useref({ 
     searchPath: '.' 
    })) 

    // versioning assets 
    .pipe(indexHtmlFilter) 
     .pipe($.rev()) 
     .pipe($.debug()) 
     .pipe(indexHtmlFilter.restore) 

    // processing scripts 
    .pipe(jsFilter) 
     // .pipe($.uglify({ 
     // preserveComments: $.uglifySaveLicense, 
     // compress: uglifyCompressOptions 
     // })) 
     .pipe($.size()) 
     .pipe(gulp.dest(paths.django.assets.dashboard + '/builds')) 
     .pipe(jsFilter.restore) 

    // updating references 
    .pipe($.revReplace()) 
    // adding django static url reference 
    .pipe($.replace('src="scripts', 'src="{{ STATIC_URL }}dashboard/builds/scripts')) 
    .pipe(gulp.dest('compile/builds')); 
}); 

Diese Aufgaben funktionieren gut, z.

gulp minify:dashboard 

jedoch, wenn ich eine neue Aufgabe vorstellen

gulp.task('minify', ['minify:common', 'minify:dashboard']); 

die obige Aufgabe gulp minify gibt mir dieses

events.js:154 
     throw er; // Unhandled 'error' event 
    ^
Error: write after end 
    at writeAfterEnd (/magneto/dashboard/node_modules/readable-stream/lib/_stream_writable.js:203:12) 
    at StreamFilter.Writable.write (/magneto/dashboard/node_modules/readable-stream/lib/_stream_writable.js:239:20) 
    at write (/magneto/dashboard/node_modules/gulp-useref/node_modules/readable-stream/lib/_stream_readable.js:623:24) 
    at flow (/magneto/dashboard/node_modules/gulp-useref/node_modules/readable-stream/lib/_stream_readable.js:632:7) 
    at DestroyableTransform.pipeOnReadable (/magneto/dashboard/node_modules/gulp-useref/node_modules/readable-stream/lib/_stream_readable.js:664:5) 
    at emitNone (events.js:80:13) 
    at DestroyableTransform.emit (events.js:179:7) 
    at emitReadable_ (/magneto/dashboard/node_modules/gulp-useref/node_modules/readable-stream/lib/_stream_readable.js:448:10) 
    at emitReadable (/magneto/dashboard/node_modules/gulp-useref/node_modules/readable-stream/lib/_stream_readable.js:444:5) 
    at readableAddChunk (/magneto/dashboard/node_modules/gulp-useref/node_modules/readable-stream/lib/_stream_readable.js:187:9) 

das seltsame Ding, ich alle Filter zu entfernen, dh

`` `js

gulp.task('minify:dashboard', ['inject:dashboard'], function() { 
    var assets; 

    return gulp.src(paths.django.templates.root + '/__dashboard.html') 
    .pipe($.replace('script src="{{ STATIC_URL }}dashboard', 'script src="compile')) 

    .pipe($.useref({ 
     searchPath: '.' 
    })) 

    // versioning assets 
    //.pipe(indexHtmlFilter) 
     .pipe($.rev()) 
     .pipe($.debug()) 
     //.pipe(indexHtmlFilter.restore) 

    // processing scripts 
    //.pipe(jsFilter) 
     // .pipe($.uglify({ 
     // preserveComments: $.uglifySaveLicense, 
     // compress: uglifyCompressOptions 
     // })) 
     //.pipe($.size()) 
     //.pipe(gulp.dest(paths.django.assets.dashboard + '/builds')) 
     //.pipe(jsFilter.restore) 

    // updating references 
    .pipe($.revReplace()) 
    // adding django static url reference 
    .pipe($.replace('src="scripts', 'src="{{ STATIC_URL }}dashboard/builds/scripts')) 
    .pipe(gulp.dest('compile/builds')); 
}); 

`` `

dann die Aufgabe gulp minify perfekt funktioniert gut. Ist etwas falsch mit Schluck oder Schluckfilter-Paket, oder verwende ich es falsch?

Ich habe bereits die gleiche Frage auf gulp-Filter Git Repo gepostet, wie ich denke, das ist ein Bug mit Schluck Filter.

was soll hier gemacht werden?

Antwort

0

Für jeden, der die Antwort suchte, stellte sich heraus, dass ich aktualisiert zu schlucken 4, damit die Abhängigkeiten zu brechen. hoffe das hilft.