Skip to content

Commit 02a3912

Browse files
authored
Update gulpfile.js
1 parent d5a90d4 commit 02a3912

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

gulpfile.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ var rename = require('gulp-rename');
1919
var prefixPromise = import('gulp-autoprefixer');
2020

2121
//=======================================================
22-
// Include Our tasks (using dynamic import for .mjs files)
22+
// Dynamically Import .mjs Task Files
2323
//=======================================================
24-
const taskCompile = require('./gulp-tasks/compile.mjs');
24+
var taskCompilePromise = import('./gulp-tasks/compile.mjs');
2525
var taskMove = require('./gulp-tasks/move.js');
2626
var taskLint = require('./gulp-tasks/lint.js');
2727
var taskCompress = require('./gulp-tasks/compress.js');
@@ -34,10 +34,12 @@ var taskConcat = require('./gulp-tasks/concat.js');
3434

3535
gulp.task('compile:sass', async function() {
3636
const prefix = (await prefixPromise).default; // Await the prefix import
37+
const taskCompile = await taskCompilePromise; // Await the compile task import
3738
return taskCompile.sass(prefix); // Use autoprefixer
3839
});
3940

40-
gulp.task('compile:js', function() {
41+
gulp.task('compile:js', async function() {
42+
const taskCompile = await taskCompilePromise; // Await the compile task import
4143
return taskCompile.js();
4244
});
4345

0 commit comments

Comments
 (0)