Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
node_modules
lua_modules
data/*.avif
data/*.pdf
data/*.toml
data/*.aux
data/*/*-aux
data/*.log
.fonts
static
public
*.rockslock
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,11 @@ static/%.css: sass/%.scss | node_modules
%.avif: %.pdf
$(MAGICK) -density 150 $< $@

static/codemirror.js: src/codemirror-bundle.js build.js | node_modules
$(NPX) node build.js

.PHONY: static
static: $(PDFS) $(PREVIEWS) static/main.css
static: $(PDFS) $(PREVIEWS) static/main.css static/codemirror.js
install -Dm0644 -t static $(filter-out static/%,$^)
for m in $(MANIFESTS); do
tomlq -r '[.src, .demosrc] | @tsv' $$m | read src demosrc
Expand Down
20 changes: 20 additions & 0 deletions build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { build } from "esbuild";
import { wasmLoader } from 'esbuild-plugin-wasm'

await build({
entryPoints: ["src/codemirror-bundle.js"],
bundle: true,
format: "esm",
target: ["es2020"],
sourcemap: false,
loader: { ".wasm": "file" },
outdir: "static",
outbase: "src",
assetNames: "[name]",
entryNames: "codemirror",
plugins: [wasmLoader()],
publicPath: "/",
supported: {
'top-level-await': true,
},
});
Loading