Closed nachtfunke closed 5 years ago
Take a look at what the API documentation says that series
returns.
It's a composed function to be exported as a task. The returned function needs to be executed and passed a callback (your done
function above):
function buildLess(done) {
series(cleanCompiledLess, compileLess)(done);
}
However, none of the examples in the docs show that method because the convention is to export the composed functions as tasks or use them in another series. You can do something like this to make it cleaner:
const buildLess = series(cleanCompiledLess, compileLess);
const buildSass = series(cleanCompiledSass, compileSass);
export.buildCass = series(buildLess, buildSass);
You can export those individual build*
functions if you want to use them as tasks directly too.
"Unfortunately with the declining popularity of gulp" this is a really weird passive aggressive way to ask for help, please don't post like this here anymore. We get 1.2M installs a week, you don't need to worry about the popularity of our project.
"Unfortunately with the declining popularity of gulp" this is a really weird passive aggressive way to ask for help, please don't post like this here anymore. We get 1.2M installs a week, you don't need to worry about the popularity of our project.
I'm very sorry, it was not my intend to make it sound like that! I was trying to justify why I was actually posting here, as I know that this project is well groomed, when it comes to issues here.
@doowb that makes a lot of sense - thank you!
Unfortunately with the declining popularity of gulp, finding answers anywhere has become a real challenge. Sorry if you think this does not belong here, but I have run out of places to ask.
I have difficulties understanding how composing and reusing functions is supposed to work in gulp nowadays.
For example, I have separate functions for minifying and compiling Less and Sass, so 4 functions in total.
When I export any of those functions manually, with
exports.compileSass = compileSass;
, everything works as intended.What also works, is
exports.buildSass = series(cleanCompiledSass, compileSass);
. But now if I want to export a single function to do all of this, what do I do? I don't wanna copy and paste everything all the time. So I tried this:All of this is running through without any mistakes, but the tasks are not doing what they are supposed to be doing.
So how is this meant to be done?