2020-10-29 16:31:19 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -xeuo pipefail
|
|
|
|
|
|
|
|
# Netlify doesn't support building stuff via Haskell or
|
|
|
|
# Nix. Those things are vaguely on the horizon (check the issues at
|
|
|
|
# https://github.com/netlify/build-image) but for now it's way simpler to just
|
|
|
|
# accept that Netlify will need separate instructions.
|
|
|
|
|
2020-11-04 22:17:08 +03:00
|
|
|
# get our dependencies (--ignore-scripts=false is needed for puppeteer)
|
|
|
|
npm install --ignore-scripts=false
|
2020-10-29 16:31:19 +03:00
|
|
|
npm install elm
|
|
|
|
|
|
|
|
# make sure we're building into a clean folder
|
|
|
|
if test -d public; then rm -rf public; fi
|
|
|
|
mkdir public
|
|
|
|
|
|
|
|
# build the interactive parts
|
2022-04-12 23:28:58 +03:00
|
|
|
(cd styleguide && npx elm make Main.elm --output ../public/elm.js)
|
2022-04-12 21:46:36 +03:00
|
|
|
npx browserify --entry styleguide/manifest.js --outfile public/bundle.js
|
2020-10-29 16:31:19 +03:00
|
|
|
|
2020-11-10 19:10:04 +03:00
|
|
|
# copy static files
|
2022-04-12 21:46:36 +03:00
|
|
|
cp styleguide/index.html public/index.html
|
|
|
|
cp styleguide/elm.json public/application.json
|
2022-03-29 00:34:52 +03:00
|
|
|
cp elm.json public/package.json
|