Skip to content

Commit

Permalink
Start improving build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
jassmith committed Nov 25, 2023
1 parent 48024e8 commit 8510c78
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions packages/core/build.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
#!/bin/bash

set -e
set -m

## Delete the dist folder
rm -rf dist

## Get our basic build in place
tsc -p tsconfig.esm.json &
tsc -p tsconfig.cjs.json &
wait
run_in_parallel() {
local commands=("$@")
local pids=()

# Start the processes in the background and store their PIDs
for cmd in "${commands[@]}"; do
$cmd &
pids+=($!)
done

# Wait for all processes and exit if any of them fail
for pid in "${pids[@]}"; do
wait $pid || exit $?
done
}

run_in_parallel "tsc -p tsconfig.esm.json" "tsc -p tsconfig.cjs.json"

## Now we need to run linaria on the esm build
linaria -r dist/esm/ -m es2015 -o dist/esm/ dist/esm/**/*.js
Expand Down

0 comments on commit 8510c78

Please sign in to comment.