aboutsummaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
authorLia Lenckowski <lialenck@protonmail.com>2023-08-17 12:17:50 +0200
committerLia Lenckowski <lialenck@protonmail.com>2023-08-17 12:17:50 +0200
commitd5ef112748f6b3c7999a6335da2026e4d60f3eb9 (patch)
tree824c0260f1d8a5a25d4ecaf144dd1cd056097f8e /makefile
parent6ba3442ac42da3a72c0781fe5263052ff7cec820 (diff)
downloadfastbangs-d5ef112748f6b3c7999a6335da2026e4d60f3eb9.tar
fastbangs-d5ef112748f6b3c7999a6335da2026e4d60f3eb9.tar.bz2
fastbangs-d5ef112748f6b3c7999a6335da2026e4d60f3eb9.tar.zst
swap fuse for a faster fuzzy search backend
Diffstat (limited to 'makefile')
-rw-r--r--makefile9
1 files changed, 5 insertions, 4 deletions
diff --git a/makefile b/makefile
index 7bef75e..510c397 100644
--- a/makefile
+++ b/makefile
@@ -3,7 +3,7 @@ ESFLAGS = --target=esnext --format=esm
deploy-dir: deploy deploy/bundle.js deploy/style.css deploy/index.html deploy/fastbangs
.PHONY: watch clean deploy-dir
-watch-script: frontend/fuse.js
+watch-script: frontend/fuzzysort.js
esbuild frontend/main.ts --bundle --outfile=deploy/bundle.js $(ESFLAGS) --watch
watch-style:
while true; do inotifywait -e modify -e move frontend/style.sass; make deploy/style.css; done
@@ -12,6 +12,7 @@ clean:
stack clean --full
rm -f deploy/{bundle.js,index.html,fastbangs,style.css}
rm -f deploy.zip
+ rm -f frontend/fuzzysort.js
# This leaves the deploy directory, which is intentional, as it may contain
# user data
@@ -23,10 +24,10 @@ deploy/index.html: frontend/index.html
cp $< $@
deploy/fastbangs: $(shell find src -name '*.hs')
stack install --local-bin-path deploy
-deploy/bundle.js: $(shell find frontend -name '*.ts') frontend/fuse.js
+deploy/bundle.js: $(shell find frontend -name '*.ts') frontend/fuzzysort.js
esbuild frontend/main.ts --bundle --outfile=deploy/bundle.js $(ESFLAGS)
deploy/style.css: frontend/style.sass
sassc $< $@
-frontend/fuse.js:
- curl 'https://cdn.jsdelivr.net/npm/fuse.js@6.6.2/dist/fuse.esm.js' -o $@
+frontend/fuzzysort.js:
+ curl 'https://cdn.jsdelivr.net/npm/fuzzysort@2.0.4/fuzzysort.min.js' -o $@