Last active
April 3, 2019 23:57
-
-
Save leoramos086/929520b0d270acb1ee2591de612ad083 to your computer and use it in GitHub Desktop.
Gulp multiple files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var gulp = require('gulp'); | |
| var connect = require('gulp-connect'); | |
| gulp.task('connect', function() { | |
| connect.server({ | |
| root: 'app', | |
| livereload: true | |
| }); | |
| }); | |
| gulp.task('html', function () { | |
| gulp.src('./app/*.html') | |
| .pipe(gulp.dest('./app')) | |
| .pipe(connect.reload()); | |
| }); | |
| gulp.task('watch', function () { | |
| gulp.watch(['./app/*.html'], ['html']); | |
| }); | |
| gulp.task('default', ['connect', 'watch']); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| var gulp = require('gulp'); | |
| var taskPath = './gulptasks/'; | |
| var taskList = require('fs').readdirSync(taskPath); | |
| taskList.forEach(function(taskFile){ | |
| require(taskPath + taskFile)(gulp); | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment