Skip to content

Commit c168dbf

Browse files
authored
Update gulpfile.js
1 parent 1a3b3e8 commit c168dbf

File tree

1 file changed

+16
-20
lines changed

1 file changed

+16
-20
lines changed

gulpfile.js

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/*eslint strict: ["error", "global"]*/
21
'use strict';
32

43
//=======================================================
@@ -19,27 +18,28 @@ var rename = require('gulp-rename');
1918
var prefixPromise = import('gulp-autoprefixer');
2019

2120
//=======================================================
22-
// Dynamically Import .mjs Task Files
21+
// Include Our tasks (using dynamic import for .mjs files)
2322
//=======================================================
24-
var taskCompilePromise = import('./gulp-tasks/compile.mjs');
25-
var taskMove = require('./gulp-tasks/move.js');
26-
var taskLint = require('./gulp-tasks/lint.js');
27-
var taskCompress = require('./gulp-tasks/compress.js');
28-
var taskStyleGuide = require('./gulp-tasks/styleguide.js');
29-
var taskConcat = require('./gulp-tasks/concat.js');
23+
const taskCompilePromise = import('./gulp-tasks/compile.mjs');
24+
const taskCleanPromise = import('./gulp-tasks/clean.mjs');
25+
const taskMove = require('./gulp-tasks/move.js');
26+
const taskLint = require('./gulp-tasks/lint.js');
27+
const taskCompress = require('./gulp-tasks/compress.js');
28+
const taskStyleGuide = require('./gulp-tasks/styleguide.js');
29+
const taskConcat = require('./gulp-tasks/concat.js');
3030

3131
//=======================================================
3232
// Compile Our Sass and JS
3333
//=======================================================
3434

3535
gulp.task('compile:sass', async function() {
36-
const prefix = (await prefixPromise).default; // Await the prefix import
37-
const taskCompile = await taskCompilePromise; // Await the compile task import
38-
return taskCompile.sass(prefix); // Use autoprefixer
36+
const taskCompile = await taskCompilePromise;
37+
const prefix = (await prefixPromise).default;
38+
return taskCompile.sass(prefix);
3939
});
4040

4141
gulp.task('compile:js', async function() {
42-
const taskCompile = await taskCompilePromise; // Await the compile task import
42+
const taskCompile = await taskCompilePromise;
4343
return taskCompile.js();
4444
});
4545

@@ -91,27 +91,23 @@ gulp.task('concat', function() {
9191
//=======================================================
9292
// Clean all directories (dynamically load clean tasks)
9393
//=======================================================
94-
async function loadCleanTask() {
95-
return import('./gulp-tasks/clean.mjs');
96-
}
97-
9894
gulp.task('clean:styleguide', async function() {
99-
const taskClean = await loadCleanTask();
95+
const taskClean = await taskCleanPromise;
10096
return taskClean.styleguide();
10197
});
10298

10399
gulp.task('clean:css', async function() {
104-
const taskClean = await loadCleanTask();
100+
const taskClean = await taskCleanPromise;
105101
return taskClean.css();
106102
});
107103

108104
gulp.task('clean:js', async function() {
109-
const taskClean = await loadCleanTask();
105+
const taskClean = await taskCleanPromise;
110106
return taskClean.js();
111107
});
112108

113109
gulp.task('clean:docs', async function() {
114-
const taskClean = await loadCleanTask();
110+
const taskClean = await taskCleanPromise;
115111
return taskClean.docs();
116112
});
117113

0 commit comments

Comments
 (0)