This repository has been archived by the owner on Sep 30, 2024. It is now read-only.
forked from rampatra/wedding-website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
50 lines (44 loc) · 1.38 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
'use strict';
var gulp = require('gulp');
var webserver = require('gulp-webserver');
var sass = require('gulp-sass')(require('sass'));
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
// compile scss to css
gulp.task('sass', function () {
return gulp.src('./sass/styles.scss')
.pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError))
.pipe(rename({basename: 'styles.min'}))
.pipe(gulp.dest('./css'));
});
// watch changes in scss files and run sass task
gulp.task('sass:watch', function () {
gulp.watch('./sass/**/*.scss', ['sass']);
});
// minify js
gulp.task('minify-js', function () {
return gulp.src('./js/scripts.js')
.pipe(uglify())
.pipe(rename({basename: 'scripts.min'}))
.pipe(gulp.dest('./js'));
});
// gulp.task('webserver', function() {
// gulp.src('/Users/psurukuc/Applications/RussiaMeetsIndia/')
// .pipe(webserver({
// livereload: true,
// directoryListing: true,
// open: false,
// fallback: 'index.html'
// }));
// });
// gulp.task('default', gulp.series('sass', 'minify-js', 'webserver'));
gulp.task('webserver', function() {
gulp.src('')
.pipe(webserver({
livereload: true,
directoryListing: true,
open: true,
fallback: 'index.html'
}));
});
gulp.task('default', gulp.series('sass', 'minify-js'));