57 lines
1.6 KiB
JavaScript
57 lines
1.6 KiB
JavaScript
var gulp = require('gulp');
|
|
var less = require('gulp-less');
|
|
var browserSync = require('browser-sync').create();
|
|
|
|
gulp.task('default', function() {
|
|
// default tasks here
|
|
});
|
|
|
|
gulp.task('less', function() {
|
|
return gulp.src('less/agency.less')
|
|
.pipe(less())
|
|
.pipe(gulp.dest('css'))
|
|
.pipe(browserSync.reload({
|
|
stream: true
|
|
}))
|
|
});
|
|
|
|
gulp.task('bootstrap', function() {
|
|
return gulp.src(['node_modules/bootstrap/dist/**/*', '!**/npm.js', '!**/bootstrap-theme.*', '!**/*.map'])
|
|
.pipe(gulp.dest(''))
|
|
})
|
|
|
|
gulp.task('jquery', function() {
|
|
return gulp.src(['node_modules/jquery/dist/jquery.js', 'node_modules/jquery/dist/jquery.min.js'])
|
|
.pipe(gulp.dest('js'))
|
|
})
|
|
|
|
gulp.task('fontawesome', function() {
|
|
return gulp.src([
|
|
'node_modules/font-awesome/**',
|
|
'!node_modules/font-awesome/**/*.map',
|
|
'!node_modules/font-awesome/.npmignore',
|
|
'!node_modules/font-awesome/*.txt',
|
|
'!node_modules/font-awesome/*.md',
|
|
'!node_modules/font-awesome/*.json'
|
|
])
|
|
.pipe(gulp.dest('font-awesome'))
|
|
})
|
|
|
|
gulp.task('update', ['bootstrap', 'jquery', 'fontawesome']);
|
|
|
|
gulp.task('browserSync', function() {
|
|
browserSync.init({
|
|
server: {
|
|
baseDir: ''
|
|
},
|
|
})
|
|
})
|
|
|
|
// Watch Task
|
|
gulp.task('watch', ['browserSync', 'less'], function() {
|
|
gulp.watch('less/*.less', ['less']);
|
|
// Reloads the browser whenever HTML or JS files change
|
|
gulp.watch('*.html', browserSync.reload);
|
|
gulp.watch('js/**/*.js', browserSync.reload);
|
|
});
|