Skip to content

Commit 69bacaa

Browse files
committed
add script to run integration bundling in parallel
1 parent 5a3a1bc commit 69bacaa

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

packages/integrations/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
},
2727
"scripts": {
2828
"build": "run-p build:cjs build:esm build:bundle",
29-
"build:bundle": "rollup --config",
29+
"build:bundle": "bash scripts/buildBundles.sh",
3030
"build:cjs": "tsc -p tsconfig.cjs.json",
3131
"build:dev": "run-s build:cjs build:esm",
3232
"build:es5": "yarn build:cjs # *** backwards compatibility - remove in v7 ***",
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
for filepath in ./src/*; do
2+
file=$(basename $filepath)
3+
4+
# the index file is only there for the purposes of npm builds - for the CDN we create a separate bundle for each
5+
# integration - so we can skip it here
6+
if [[ $file == "index.ts" ]]; then
7+
continue
8+
fi
9+
10+
# run the build for each integration, pushing each build process into the background once it starts (that's what the
11+
# trailing `&` does) so that we can start another one
12+
echo -e "\nBuilding bundles for \`$file\`..."
13+
INTEGRATION_FILE=$file yarn --silent rollup -c rollup.config.js 2>/dev/null && echo -e "\nFinished building bundles for \`$file\`." &
14+
15+
done
16+
17+
# keep the process running until all backgrounded tasks have finished
18+
wait
19+
20+
echo "Integration bundles built successfully"

0 commit comments

Comments
 (0)