2021-05-08 10:00:52 +00:00
|
|
|
#! /bin/sh
|
|
|
|
|
|
|
|
cd $(dirname $0)
|
2021-06-22 13:32:20 +00:00
|
|
|
if ! which wasm-pack > /dev/null 2>&1
|
|
|
|
then
|
|
|
|
>&2 echo '`wasm-pack` not found. Try running `cargo install wasm-pack`'
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2021-05-08 10:00:52 +00:00
|
|
|
wasm-pack build --target web
|
2021-06-22 13:32:20 +00:00
|
|
|
|
|
|
|
ROLLUP_BIN=$(which rollup 2>/dev/null)
|
|
|
|
if [ -f ../node_modules/rollup/dist/bin/rollup ]
|
|
|
|
then
|
|
|
|
ROLLUP_BIN=../node_modules/rollup/dist/bin/rollup
|
|
|
|
elif [ -f node_modules/rollup/dist/bin/rollup ]
|
|
|
|
then
|
|
|
|
ROLLUP_BIN=node_modules/rollup/dist/bin/rollup
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$ROLLUP_BIN" ]
|
|
|
|
then
|
|
|
|
>&2 echo '`rollup` not found. Try running `npm install rollup`'
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2021-11-29 00:02:22 +00:00
|
|
|
$ROLLUP_BIN ./main.js --format iife --file ./pkg/bundle.js --globals bootstrap:bootstrap
|