-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
73 lines (67 loc) · 1.74 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
var gulp = require("gulp"),
sass = require("gulp-sass"),
sourcemaps = require("gulp-sourcemaps"),
bulkSass = require('gulp-sass-bulk-import'),
pug = require("gulp-pug"),
concat = require("gulp-concat"),
babel = require('gulp-babel'),
uglify = require('gulp-uglify'),
minify = require('gulp-minify'),
pump = require('pump');
/**
* SASS
*/
gulp.task("sass", function() {
return gulp.src(["./styles/app.scss", "./styles/works.scss"])
.pipe(sourcemaps.init())
.pipe(bulkSass())
.pipe(sass().on("error", sass.logError))
.pipe(sourcemaps.write())
.pipe(gulp.dest("./styles"));
});
/**
* SASS Watcher
*/
gulp.task("sass:watch", function() {
gulp.watch("./styles/**/*.scss", ["sass"]);
});
/**
* PUG
*/
gulp.task("pug", function() {
return gulp.src(["./templates/*.pug", "./templates/pages/*.pug"])
.pipe(pug())
.pipe(gulp.dest("."));
});
/**
* UGLIFY
*/
gulp.task('uglify', function(){
gulp.src('./js/modules/database.js')
.pipe(babel({
presets: ['es2015-ie']
}))
.pipe(uglify().on('error', function(e){
console.log(e);
}))
.pipe(gulp.dest('./js'));
});
/**
* Scripts
*/
gulp.task("scripts", function() {
return gulp.src(["./js/modules/global.js",
"./js/modules/scroll.js",
"./js/modules/header.js",
"./js/modules/menu.js",
"./js/modules/skills.js",
"./js/modules/social.js",
"./js/modules/parallax.js",
"./js/modules/email.js",
"./js/modules/slider.js",
"./js/database.js"
])
.pipe(concat("app.js"))
.pipe(gulp.dest("./js"));
});
gulp.task("default", ["sass", "pug", "uglify", "scripts"]);