我有一个 CDN(或远程)脚本列表(带有完整的 URL)。我想将其转换为串联文件 ( all.js
)。我可以用 gulp 做到这一点吗?换句话说,它是正确的工具吗?
// Does not work (no error, but no file generated)
var gulp = require('gulp');
var concat = require('gulp-concat');
gulp.task('scripts', function() {
return gulp.src(['https://code.jquery.com/jquery-2.1.4.min.js'])
.pipe(concat('all.js'))
.pipe(gulp.dest('./dist/'));
});
我是 gulp 的新手,经过一番搜索后我没有找到答案,也许我不知道如何搜索或者我不了解 gulp 的目标。