Skip to content

Instantly share code, notes, and snippets.

@jgcmarins
Last active September 5, 2019 18:30
Show Gist options
  • Save jgcmarins/89fc87a83f37dfad5bda66b1911ade6a to your computer and use it in GitHub Desktop.
Save jgcmarins/89fc87a83f37dfad5bda66b1911ade6a to your computer and use it in GitHub Desktop.
Keeps restarting Webpack when dying due memory leak
#!/usr/bin/env bash
# Example: sh ./scripts/restart-webpack.sh yarn start
# where `start` is defined as `webpack-dev-server --config webpack.config.js --progress`
# at package.json
# Related issue: https://github.com/webpack/webpack/issues/6929
until $1 $2; do
echo "Webpack crashed with exit code $?. Respawning..." >&2
sleep 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment