-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
66 lines (51 loc) · 1.17 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
/*
* Jack Sutherland
* https://www.jacksutherland.com
*
* Website Gulp File
*/
// Gulp Tasks
const { src, dest, parallel, watch } = require('gulp');
// Gulp Plugins
const rename = require('gulp-rename'),
sass = require('gulp-sass'),
terser = require('gulp-terser'),
concat = require('gulp-concat');
// CSS Commands
var css = {
site: function(callback)
{
return src(['./src/sass/main.scss'])
.pipe(sass())
//.pipe(concat('site.css'))
.pipe(dest('./web/assets/css/'))
.pipe(sass({outputStyle: 'compressed'}))
.pipe(rename({ suffix: '.min' }))
.pipe(dest('./web/assets/css/'));
}
};
// JavaScript Commands
var js = {
site: function(callback)
{
return src([
'./src/js/site.js'
])
//.pipe(concat('site.js'))
.pipe(dest('./web/assets/js/'))
.pipe(terser())
.pipe(rename({ suffix: '.min' }))
.pipe(dest('./web/assets/js/'));
}
};
// Execute Default Tasks
exports.default = parallel(css.site, js.site);
// Execute Watch Tasks
exports.watch = function()
{
exports.default();
// watch js files
watch('./src/sass/main.scss', css.site);
// watch scss files
watch('./src/js/*.js', js.site);
}