-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
55 lines (45 loc) · 1.32 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
const { watch, src, series, dest } = require('gulp');
const postcss = require('gulp-postcss');
const browserSync = require('browser-sync')
function clean(cb) {
// body omitted, we'd add bits to clean the
// generated built directory here
cb();
}
function javascript(cb) {
// if we need to make packages of js,
// we can run rollup, webpack or plain
// gulp here
}
function fonts(cb) {
// take fonts and move prep for serving from build directory
return src('assets/fonts/*')
// output it here
.pipe(dest('assets/build/fonts'))
}
function css(cb) {
// look through the css provided by tailwind and run it through
// postcss to give us all the utility classes
return src('assets/css/*')
// run through postcss (see postcss.config.js)
.pipe(postcss())
// output it here
.pipe(dest('assets/build/css'))
}
function dev() {
// watch for any handlebars file being updated, and revisit the css needed
const bsync = browserSync.create();
bsync.init({
proxy: 'http://localhost:2368',
files: './'
});
watch('**/**.hbs', series(fonts, css));
watch('assets/css/**/**.css', series(fonts, css));
}
exports.dev = dev
exports.fonts = fonts
exports.css = css
exports.default = function (cb) {
console.log('default task. We might want to serve in dev, or make production builds.')
cb()
}