Skip to content
This repository has been archived by the owner on Jun 26, 2024. It is now read-only.

Commit

Permalink
Run gulp tasks asynchronous
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-github committed Dec 27, 2020
1 parent 70bcef1 commit 612f676
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ if (!DRIVER_NAME) {
process.exit(1);
}

gulp.task('watch', function () {
gulp.task('watch', async function () {
gulp.watch(['./component/*.js', './component/*.hbs', './component/*.css'], gulp.parallel('build'));
});

gulp.task('clean', function () {
gulp.task('clean', async function () {
return gulp.src([`${DIST}*.js`, `${DIST}*.css`, `${DIST}*.hbs`, `${TMP}*.js`, `${TMP}*.css`, `${TMP}*.hbs`,], { read: false })
.pipe(clean());
});

gulp.task('styles', gulp.series('clean', function () {
gulp.task('styles', gulp.series('clean', async function () {
return gulp.src([
BASE + '**.css'
])
Expand All @@ -44,12 +44,12 @@ gulp.task('styles', gulp.series('clean', function () {
.pipe(gulp.dest(DIST));
}))

gulp.task('assets', gulp.series('styles', function () {
gulp.task('assets', gulp.series('styles', async function () {
return gulp.src(ASSETS + '*')
.pipe(gulp.dest(DIST));
}));

gulp.task('babel', gulp.series('assets', function () {
gulp.task('babel', gulp.series('assets', async function () {
const babelOpts = {
presets: [
[
Expand Down Expand Up @@ -87,7 +87,7 @@ gulp.task('babel', gulp.series('assets', function () {
.pipe(gulp.dest(TMP));
}));

gulp.task('rexport', gulp.series('babel', function () {
gulp.task('rexport', gulp.series('babel', async function () {
const babelOpts = {
presets: [
[
Expand Down Expand Up @@ -117,7 +117,7 @@ gulp.task('rexport', gulp.series('babel', function () {
.pipe(gulp.dest(TMP));
}));

gulp.task('compile', gulp.series('rexport', function () {
gulp.task('compile', gulp.series('rexport', async function () {
return gulp.src([
`${TMP}**.js`
])
Expand All @@ -127,7 +127,7 @@ gulp.task('compile', gulp.series('rexport', function () {

gulp.task('build', gulp.series('compile'));

gulp.task('server', gulp.parallel(['build', 'watch'], function () {
gulp.task('server', gulp.parallel(['build', 'watch'], async function () {
return gulpConnect.server({
root: [DIST],
port: process.env.PORT || 3000,
Expand All @@ -137,6 +137,6 @@ gulp.task('server', gulp.parallel(['build', 'watch'], function () {

gulp.task('default', gulp.series('build'));

gulp.task('watch', function () {
gulp.task('watch', async function () {
gulp.watch(['./component/*.js', './component/*.hbs', './component/*.css'], gulp.parallel('build'));
});
});

0 comments on commit 612f676

Please sign in to comment.