Skip to main content
Go to Latest
File
#!/usr/bin/env bashcd "$(dirname "$0")/.."set -e
echo "> Cleaning out dist/"rm -rf ./distmkdir dist
if ! test -d preact; then echo "> Cloning the latest preact" git clone https://github.com/preactjs/preact.gitfi
echo "> Stashing changes, pulling updates, checking out master"cd preactgit stashOLD_BRANCH="$(git branch --show-current)"git pull origin mastergit checkout mastercd ..
echo "> npm install"cd preactnpm install # build happens on installcd ..
echo "> Copying required files to dist/"cp ./preact/dist/preact.module.js ./distcp ./preact/dist/preact.module.js.map ./distcp ./preact/src/index.d.ts ./dist/preact.d.tscp ./preact/src/jsx.d.ts ./dist/jsx.d.tscp ./preact/hooks/dist/hooks.module.js ./distcp ./preact/hooks/dist/hooks.module.js.map ./distcp ./preact/hooks/src/index.d.ts ./dist/hooks.d.tscp ./preact/jsx-runtime/dist/jsxRuntime.module.js ./distcp ./preact/jsx-runtime/dist/jsxRuntime.module.js.map ./distcp ./preact/jsx-runtime/src/index.d.ts ./dist/jsxRuntime.d.tscp ./LICENSE ./dist/LICENSE
echo "> Switching to rewrite.ts"./bin/rewrite.ts
echo "> rm package-log.json, return to old branch, pop stashed changes"cd preactrm package-lock.jsongit checkout "$OLD_BRANCH"git stash pop || truecd ..
echo "> Done: build.sh"