Skip to content

Instantly share code, notes, and snippets.

@PhoneDroid
Created December 15, 2023 09:50
Show Gist options
  • Select an option

  • Save PhoneDroid/d4490614a095497ff03d613eb3bd0159 to your computer and use it in GitHub Desktop.

Select an option

Save PhoneDroid/d4490614a095497ff03d613eb3bd0159 to your computer and use it in GitHub Desktop.
Simple setup for parallel bundling with bun, useful for feature based bundling -> Shopify Theme

Feature Bundling Script

#!/usr/bin/env bash

#
#   Bundle a given feature's TypeScript into a single JavaScript
#

if [ -z "$1" ] ; then
    echo "No feature was specified"
fi

echo "Bundling feature $1"

bun build                       \
    --watch                     \
    --outfile "Output/$1.js"    \
    "Source/$1/mod.ts"

Features Bundling Script

#!/usr/bin/env bash

clear

echo "Bundling all features in parallel"

npm run feature TestFeatureA &
npm run feature TestFeatureB &

wait

echo "All bundle processes have stopped"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment