Add a simple system for building with HTML

This commit is contained in:
Emi Simpson 2023-05-22 14:03:12 -04:00
parent a0a38a91bd
commit 524ba41ef5
Signed by: Emi
GPG Key ID: A12F2C2FFDC3D847
3 changed files with 33 additions and 0 deletions

10
Makefile Normal file
View File

@ -0,0 +1,10 @@
all: out/gender.min.js out/index.html
out/gender.max.js: src/
elm make src/Main.elm --optimize --output out/gender.max.js
out/gender.min.js: out/gender.max.js
npx uglify-js out/gender.max.js --compress 'pure_funcs=[F2,F3,F4,F5,F6,F7,F8,F9,A2,A3,A4,A5,A6,A7,A8,A9],pure_getters,keep_fargs=false,unsafe_comps,unsafe' | npx uglify-js --mangle --output out/gender.min.js
out/index.html: static/index.html
cp static/index.html out/index.html

9
README.md Normal file
View File

@ -0,0 +1,9 @@
# Gender Friends
A silly little meme sketch thingy idk
## Building
Install [`elm`][] and [`npx`][] (just used for minification).
Run `make` in the same directory as this README.

14
static/index.html Normal file
View File

@ -0,0 +1,14 @@
<!Doctype HTML>
<html>
<head>
<script src="gender.min.js"> </script>
</head>
<body>
<div id="elm-zone"></div>
<script>
Elm.Main.init({
node: document.getElementById('elm-zone')
});
</script>
</body>
</html>