-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.js
51 lines (43 loc) · 1.06 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
const { dest, src, parallel, series, watch } = require('gulp');
const browserSync = require('browser-sync').create()
const autoprefixer = require('autoprefixer')
const postcss = require('gulp-postcss')
const concat = require('gulp-concat')
const easyImport = require('postcss-easy-import')
const nested = require('postcss-nested')
function js(cb) {
src([
'node_modules/feather-icons/dist/feather.js',
'./script.js'
])
.pipe(concat('script.js'))
.pipe(dest('public'));
cb();
}
function css(cb) {
src('style.css')
.pipe(postcss([
easyImport,
nested,
autoprefixer(),
]))
.pipe(dest('public'))
.pipe(browserSync.stream());
cb();
}
exports.default = series(parallel(js, css), function serve(cb) {
browserSync.init({
port: 3001,
ui: false
});
watch('style.css', css);
watch('script.js', series(js, function reload(_cb) {
browserSync.reload();
_cb();
}));
cb();
})
exports.build = series(parallel(js, css), function success (cb) {
console.log('Run `yarn serve` to launch Ouistiti!');
cb();
});