我正在尋找能夠幫助我找到文件路徑有效的解決方案。如果文件路徑無效,則顯示一些錯誤。文件路徑在gulp src中有效
gulp.task("scripts-libraries", ["googlecharts"], function() {
var scrlibpaths = [
"./node_modules/jquery/dist/jquery.min.js",
"./node_modules/bootstrap/dist/js/bootstrap.min.js",
"./libs/AdminLTE-2.3.0/plugins/slimScroll/jquery.slimscroll.min.js",
"./libs/AdminLTE-2.3.0/plugins/fastclick/fastclick.min.js",
"./libs/adminLTE-app.js",
"./node_modules/moment/min/moment.min.js",
"./node_modules/jquery.inputmask/dist/jquery.inputmask.bundle.js",
"./node_modules/bootstrap-timepicker/js/bootstrap-timepicker.min.js",
"./node_modules/bootstrap-checkbox/dist/js/bootstrap-checkbox.min.js",
"./node_modules/bootstrap-daterangepicker/daterangepicker.js",
"./node_modules/select2/dist/js/select2.full.min.js",
"./node_modules/toastr/build/toastr.min.js",
"./node_modules/knockout/build/output/knockout-latest.js",
"./node_modules/selectize/dist/js/standalone/selectize.min.js",
//"./src/jquery.multiselect.js"
];
for (var i = 0; i < scrlibpaths.length; i++) {
if (scrlibpaths[i].pipe(size()) === 0) {
console.log("There is no" + scrlibpaths[i] + " file on your machine");
return;
}
}
return gulp.src(scrlibpaths)
.pipe(plumber())
.pipe(concat("bundle.libraries.js"))
.pipe(gulp.dest(config.path.dist + "/js"));
});
那麼我該如何讓這個工作?
這就是我需要的。這是我的問題的正確解決方案。 – hongchen