-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
87 lines (77 loc) · 2.75 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
'use strict';
var gulp = require('gulp');
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var sourcemaps = require('gulp-sourcemaps');
var pug = require('gulp-pug');
// Portfolio
gulp.task('potfolio_scss', () => {
return gulp.src('./src/scss/*.scss')
.pipe(sourcemaps.init())
.pipe(sass().on('error', sass.logError))
.pipe(concat('index.css'))
.pipe(sourcemaps.write())
.pipe(gulp.dest('./build/'));
});
gulp.task('portfolio_pug', () => {
return gulp.src('./src/pages/*.pug')
.pipe(pug({}))
.pipe(gulp.dest('./build/'));
});
gulp.task('portfolio_assets', () => {
return gulp.src('./src/assets/*')
.pipe(gulp.dest('./build/assets'));
});
// AXIT
gulp.task('axit_scss', () => {
return gulp.src('./projects/axit/scss/*.scss')
.pipe(sourcemaps.init())
.pipe(sass().on('error', sass.logError))
.pipe(concat('index.css'))
.pipe(sourcemaps.write())
.pipe(gulp.dest('./build/projects/axit'));
});
gulp.task('axit_pug', () => {
return gulp.src('./projects/axit/pages/*.pug')
.pipe(pug({}))
.pipe(gulp.dest('./build/projects/axit'));
});
gulp.task('axit_assets', () => {
return gulp.src('./projects/axit/assets/*')
.pipe(gulp.dest('./build/projects/axit/assets'));
});
// DECO
gulp.task('deco_scss', () => {
return gulp.src('./projects/deco/scss/*.scss')
.pipe(sourcemaps.init())
.pipe(sass().on('error', sass.logError))
.pipe(concat('index.css'))
.pipe(sourcemaps.write())
.pipe(gulp.dest('./build/projects/deco'));
});
gulp.task('deco_pug', () => {
return gulp.src('./projects/deco/pages/*.pug')
.pipe(pug({}))
.pipe(gulp.dest('./build/projects/deco'));
});
gulp.task('deco_assets', () => {
return gulp.src('./projects/deco/assets/*')
.pipe(gulp.dest('./build/projects/deco/assets'));
});
gulp.task('watch', function() {
gulp.watch('./src/scss/*.scss', gulp.series('potfolio_scss'));
gulp.watch('./src/pages/**/*.pug', gulp.series('portfolio_pug'));
gulp.watch('./src/assets/*', gulp.series('portfolio_assets'));
gulp.watch('./projects/axit/scss/*.scss', gulp.series('axit_scss'));
gulp.watch('./projects/axit/pages/**/*.pug', gulp.series('axit_pug'));
gulp.watch('./projects/axit/assets/*', gulp.series('axit_assets'));
gulp.watch('./projects/deco/scss/*.scss', gulp.series('deco_scss'));
gulp.watch('./projects/deco/pages/**/*.pug', gulp.series('deco_pug'));
gulp.watch('./projects/deco/assets/*', gulp.series('deco_assets'));
});
gulp.task('default', gulp.series(
'potfolio_scss', 'portfolio_pug', 'portfolio_assets',
'axit_scss', 'axit_pug', 'axit_assets',
'deco_scss', 'deco_pug', 'deco_assets',
'watch')
);