Open smohadjer opened 6 years ago
var gulp = require('gulp');
var npmDist = require('gulp-npm-dist');
// Copy dependencies to ./public/libs/
gulp.task('copy:libs', function() {
return gulp.src(npmDist(), {base:'./node_modules'})
.pipe(gulp.dest('./public/libs'));
});
I had a problem in my build that after some hours of debugging I realised was due to gulp-npm-dist not returning a stream. Gulp guidelines recommend that every plugin should return a stream (see item 6 in guidelines).
Gulp plugin guidelines: https://github.com/gulpjs/gulp/blob/master/docs/writing-a-plugin/guidelines.md
Dealing with streams: https://github.com/gulpjs/gulp/blob/master/docs/writing-a-plugin/dealing-with-streams.md
Meanwhile usage examples in README.md should be updated to store the current stream in a variable and return it after plugin is invoked to avoid problems due to lack of support for streams.