vtex / faststore

Digital commerce toolkit for frontend developers
https://faststore.dev
MIT License
189 stars 60 forks source link

Stop running commonjs build in the background #2361

Closed gvc closed 3 months ago

gvc commented 3 months ago

Bash's & operator runs what's to the left of it on the background. Usually it's used together with the wait command. This was not the case. I believe that this command running in the background was what was causing the intermitent issue we had. Whenever the esnext build finished before the commonjs one, the process would end and kill the background process.

The side effect of this changes is that we add a couple of seconds to the overall build time.

A simplified example of this behavior can be found by running the following script:

#!/bin/bash

backgroundChild() {
    sleep 10

    echo "Background Child function is done."
}

foregroundChild() {
    sleep 3
    echo "Foreground Child is done."
}

echo "Parent running"

backgroundChild &
foregroundChild

and notice that we never see "Background Child function is done."

vercel[bot] commented 3 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
faststore-site ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 26, 2024 4:12pm
codesandbox-ci[bot] commented 3 months ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.