Skip to content

Instantly share code, notes, and snippets.

@mikezhuyuan
Created September 20, 2015 12:09
Show Gist options
  • Save mikezhuyuan/7a9fc9ca365caa4aed10 to your computer and use it in GitHub Desktop.
Save mikezhuyuan/7a9fc9ca365caa4aed10 to your computer and use it in GitHub Desktop.
var map = require('map-stream');
var gulp = require('gulp');
var htmlsrc = require('./htmlsrc.js');
gulp.task('default', function() {
//gulp.src('src/**/*.js')
// .pipe(map(function(file, next) {
// console.dir(file);
// next(null, file);
// }))
htmlsrc('index.html', function($) {
var files = [];
$('script').each(function() {
files.push($(this).attr('src'));
});
return files;
}, {read: true})
.pipe(gulp.dest('dist'));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment