After reading this article: https://css-tricks.com/combine-webpack-gulp-4/
And exploring this repository: https://github.com/PascalAOMS/gulp4-webpack
I'm currently facing a challenge where I am attempting to import gulp tasks from one file into another. My initial approach was to define the tasks as functions and then export them in a standard way, but this led to an error stating "Did you forget to signal async completion?". Alternatively, I tried enclosing the tasks within a function and exporting that, only to encounter the same error.
To provide more context, my main goal is to understand how to incorporate tasks into the build gulp.series featured in this particular file https://github.com/PascalAOMS/gulp4-webpack/blob/master/tasks/index.js
Does anyone have any insights or suggestions on how to tackle this issue?
Below is a snippet of the index.js file:
import gulp from 'gulp';
import { scripts } from './webpack';
import { server } from './server';
import { assets } from './tasks/assets';
export const dev = gulp.series( server )
export const build = gulp.series( scripts, assets )
export default dev
Here is an example of the asset task for reference:
import gulp from 'gulp';
const assets = () => {
return gulp.src(fonts.src)
.pipe(gulp.dest(fonts.dist));
}
export { assets };