gulpTasks-localRun.js 571 B

1234567891011121314151617181920212223242526
  1. // Import Dependencies.
  2. var gulp = require("gulp");
  3. var webserver = require("gulp-webserver");
  4. var minimist = require("minimist");
  5. // Comand line parsing.
  6. var commandLineOptions = minimist(process.argv.slice(2), {
  7. boolean: ["public"]
  8. });
  9. /**
  10. * Embedded webserver for test convenience.
  11. */
  12. gulp.task("webserver", function() {
  13. var options = {
  14. port: 1338,
  15. livereload: false,
  16. };
  17. if (commandLineOptions.public) {
  18. options.host = "0.0.0.0";
  19. }
  20. return gulp.src("../../.").pipe(webserver(options));
  21. });