forked from wechat-miniprogram/recycle-view
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
28 lines (24 loc) · 840 Bytes
/
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
const gulp = require('gulp');
const clean = require('gulp-clean');
const config = require('./tools/config');
const BuildTask = require('./tools/build');
const id = require('./package.json').name || 'miniprogram-custom-component';
// build task instance
new BuildTask(id, config.entry);
// clean the generated folders and files
gulp.task('clean', gulp.series(() => {
return gulp.src(config.distPath, { read: false, allowEmpty: true })
.pipe(clean())
}, done => {
if (config.isDev) {
return gulp.src(config.demoDist, { read: false, allowEmpty: true })
.pipe(clean());
}
done();
}));
// watch files and build
gulp.task('watch', gulp.series(`${id}-watch`));
// build for develop
gulp.task('dev', gulp.series(`${id}-dev`));
// build for publish
gulp.task('default', gulp.series(`${id}-default`));