Advertisement
LHSP

gulpfile.js

Aug 3rd, 2016
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var gulp = require('gulp'),
  2.     less = require('gulp-less'),
  3.     watch = require('gulp-watch'),
  4.     connect = require('gulp-connect'),
  5.     open = require('gulp-open'),
  6.     path = require('path');
  7.  
  8. gulp.task('less', function () {
  9.     return gulp.src('./less/main.less')
  10.         .pipe(less({
  11.             paths: [path.join(__dirname, 'includes')]
  12.         }))
  13.         .pipe(gulp.dest('./css'))
  14.         .pipe(connect.reload());
  15. });
  16.  
  17. gulp.task('watch', function () {
  18.     gulp.watch('./less/**/*.less', ['less']);  
  19. });
  20.  
  21. gulp.task('webserver', function () {
  22.     connect.server({
  23.         livereload: true,
  24.         root: ['.', '.tmp']
  25.     });
  26. });
  27.  
  28. gulp.task('open', function() {
  29.     gulp.src('./index.html')
  30.         .pipe(open({
  31.             uri: 'http://localhost:8080'
  32.         }));
  33. });
  34.  
  35. gulp.task('default', ['webserver', 'watch', 'open']);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement