-
Notifications
You must be signed in to change notification settings - Fork 5
/
gulpfile.js
49 lines (42 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
'use strict';
const gulp = require('gulp');
// docs: https://github.com/theme-tools/theme-tools/tree/master/packages/plugin-sass
const cssTasks = require('@theme-tools/plugin-sass')({
src: [
'scss/**/*.scss',
'pattern-lab/source/**/*.scss'
],
dest: 'dist',
lint: {
enabled: false,
},
});
// docs: https://github.com/theme-tools/theme-tools/tree/master/packages/plugin-browser-sync
const browserSyncTasks = require('@theme-tools/plugin-browser-sync')({
startPath: 'pattern-lab/public',
});
// docs: https://github.com/theme-tools/theme-tools/tree/master/packages/plugin-pattern-lab-php
const patternLabTasks = require('@theme-tools/plugin-pattern-lab-php')({
configFile: './pattern-lab/config/config.yml',
});
gulp.task('css', cssTasks.compile);
gulp.task('serve', browserSyncTasks.serve);
gulp.task('pl', patternLabTasks.compile);
gulp.task('clean', gulp.parallel([
cssTasks.clean,
]));
gulp.task('compile', gulp.series([
'clean',
gulp.parallel([
cssTasks.compile,
patternLabTasks.compile,
]),
]));
gulp.task('default', gulp.series([
'compile',
gulp.parallel([
cssTasks.watch,
patternLabTasks.watch,
browserSyncTasks.serve,
]),
]));