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

sparky tasks #1978

Open
ericlenio opened this issue Jan 27, 2021 · 2 comments
Open

sparky tasks #1978

ericlenio opened this issue Jan 27, 2021 · 2 comments

Comments

@ericlenio
Copy link

In 3.7, I was using sparky to run a series of tasks, like this:

const {src,task,context}=require("fuse-box/sparky");
...
task("default",["clean","static-resources","scripts-hashes","touch-config","compile"]);

It seems this approach is not suitable in 4.0. Is sparky task support deprecated? What's the best practice I should follow?

@patrickmichalina
Copy link
Member

This hasn't been impleented in 4.0 yet. But what I have done is just use Promise.all([ exec("clean"), ecec("static-resources") ])

etc...

If you need in sequence (not parallel), you need to chain the promises instead.

@Gouigouix
Copy link

@ericlenio or like this 😉

task("default", async (): Promise<void> => {
    await exec("clean");
    await exec("copy");
    await exec("build-styles");
    await exec("build-scripts");
});

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants