forked from pattern-lab/edition-node-gulp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
70 lines (57 loc) · 1.78 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
/******************************************************
* PATTERN LAB NODE
* EDITION-NODE-GULP
* The gulp wrapper around patternlab-node core, providing tasks to interact with the core library.
******************************************************/
const gulp = require('gulp');
const argv = require('minimist')(process.argv.slice(2));
/******************************************************
* PATTERN LAB NODE WRAPPER TASKS with core library
******************************************************/
const config = require('./patternlab-config.json');
const patternlab = require('@pattern-lab/patternlab-node')(config);
function build() {
return patternlab.build({
watch: argv.watch,
cleanPublic: config.cleanPublic
}).then(() =>{
// do something else when this promise resolves
});
}
function serve() {
return patternlab.serve({
cleanPublic: config.cleanPublic
}
).then(() => {
// do something else when this promise resolves
});
}
gulp.task('patternlab:version', function () {
patternlab.version();
});
gulp.task('patternlab:help', function () {
patternlab.help();
});
gulp.task('patternlab:patternsonly', function () {
patternlab.patternsonly(config.cleanPublic);
});
gulp.task('patternlab:liststarterkits', function () {
patternlab.liststarterkits();
});
gulp.task('patternlab:loadstarterkit', function () {
patternlab.loadstarterkit(argv.kit, argv.clean);
});
gulp.task('patternlab:build', function () {
build().then(() => {
// do something else when this promise resolves
});
});
gulp.task('patternlab:serve', function () {
serve().then(() => {
// do something else when this promise resolves
});
});
gulp.task('patternlab:installplugin', function () {
patternlab.installplugin(argv.plugin);
});
gulp.task('default', ['patternlab:help']);