Gulpfile.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. var gulp = require("gulp"),
  2. del = require("del"),
  3. concat = require("gulp-concat"),
  4. uglify = require("gulp-uglify"),
  5. eventStream = require("event-stream");
  6. var config = {
  7. src_dir: "src",
  8. dist: {
  9. dir: "dist",
  10. css_dir: "dist/css"
  11. }
  12. };
  13. gulp.task("default", function() {
  14. console.log("Available tasks:");
  15. console.log([
  16. "------------------------------------------------------------------------",
  17. "build Build stage in the dist directory",
  18. "clean Clean the dest directory",
  19. "-------------------------------------------------------------------------"
  20. ].join("\n"));
  21. });
  22. gulp.task("clean", function(cb) {
  23. del([
  24. config.dist.dir
  25. ], cb);
  26. });
  27. gulp.task("build", [], function() {
  28. // do other build things
  29. // gulp.start("jshint");
  30. return eventStream.merge(
  31. gulp.src(["src/gauge.js"]/*, {debug: true}*/)
  32. .pipe(concat("gauge.js"))
  33. .pipe(gulp.dest(config.dist.dir))
  34. .pipe(concat("gauge.min.js"))
  35. .pipe(gulp.dest(config.dist.dir))
  36. .pipe(uglify({comments: /^\/\*\!*/}))
  37. .pipe(gulp.dest(config.dist.dir))
  38. );
  39. });