Generate A Unique JS Bundle Name

If you’re using Parcel JS and you’re not happy with the outputted bundle file names, you can easily change it with this helpful bash script.

touch generate-bundle.sh && chmod +x generate-bundle.sh

Pop open generate-bundle.sh and add in the following contents:

Now in your package.json you can add a script like so:

scripts: {
  "predeploy": "./generate-bundle.sh"
}

That’s it. Hope you find this one useful.