aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLia Lenckowski <lialenck@protonmail.com>2023-08-14 18:22:31 +0200
committerLia Lenckowski <lialenck@protonmail.com>2023-08-14 18:22:31 +0200
commit9695158014c803c192f30dbd967d2200edce0250 (patch)
treef6272ed6bc554f8dcf8aac48f7b3502978df9e7d
parent12cdf9bd11da1573bbfde4a0736090ed2fc3efde (diff)
downloadfastbangs-9695158014c803c192f30dbd967d2200edce0250.tar
fastbangs-9695158014c803c192f30dbd967d2200edce0250.tar.bz2
fastbangs-9695158014c803c192f30dbd967d2200edce0250.tar.zst
bundle fuse.js
-rw-r--r--.gitignore1
-rw-r--r--frontend/start.ts2
-rw-r--r--makefile7
3 files changed, 7 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index bb0f949..9d043c8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
.stack-work
/deploy
+frontend/fuse.js
diff --git a/frontend/start.ts b/frontend/start.ts
index 89ec78e..71c1923 100644
--- a/frontend/start.ts
+++ b/frontend/start.ts
@@ -1,7 +1,7 @@
import { e } from "./helper.ts"
import { bangs } from "./query.ts"
import { status } from "./ui.ts"
-import Fuse from "https://cdn.jsdelivr.net/npm/fuse.js@6.6.2/dist/fuse.esm.js"
+import Fuse from "./fuse.js"
export function section_info_start() {
return e("section", { class: "info" },
diff --git a/makefile b/makefile
index 1061030..7bef75e 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:
+watch-script: frontend/fuse.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
@@ -23,7 +23,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')
+deploy/bundle.js: $(shell find frontend -name '*.ts') frontend/fuse.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 $@