-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
35 lines (25 loc) · 1.23 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
server:
npx http-server -g
ngrok:
ngrok http 8000
mincss:
cd css && cat normalize.css main.css | npx cleancss -o min.css
# node install -g html-minifier
# options based on config at http://kangax.github.io/html-minifier/ except remove-tag-whitespace isn't used
# since it makes invalid html
minhtml:
html-minifier --collapse-boolean-attributes --collapse-whitespace --decode-entities --html5 --minify-css --minify-js --process-conditional-comments --remove-attribute-quotes --remove-comments --remove-empty-attributes --remove-optional-tags --remove-redundant-attributes--remove-script-type-attributes --remove-style-link-type-attributes --sort-attributes --sort-class-name --use-short-doctype index.src.html -o index.html
# postcss -c options.json
build:
# uncss --ignore /slide/,/shadowSquiggle/ index.html > css/un.css
# uncsss doesn't work w/ animation lists - https://github.com/giakki/uncss/issues/188 animations
cp index.src.html index-uncss.html
sed -e 's/min/stage1/g' -i .bk index-uncss.html
cat css/normalize.css css/main.css > css/stage1.css
npx uncss index-uncss.html > css/stage2.css
cat css/stage2.css css/animation.css > css/stage3.css
npx postcss -c postcss.json
make minhtml
clean:
rm css/stage?.css
rm index-uncss*