Skip to content

Commit b3a3ab4

Browse files
authored
Merge pull request #20 from alerque/codemirror
2 parents 1c68c2a + b4d9439 commit b3a3ab4

File tree

9 files changed

+2388
-732
lines changed

9 files changed

+2388
-732
lines changed

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
node_modules
2+
lua_modules
3+
data/*.avif
4+
data/*.pdf
5+
data/*.toml
6+
data/*.aux
7+
data/*/*-aux
8+
data/*.log
9+
.fonts
10+
static
11+
public
12+
*.rockslock

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,11 @@ static/%.css: sass/%.scss | node_modules
152152
%.avif: %.pdf
153153
$(MAGICK) -density 150 $< $@
154154

155+
static/codemirror.js: src/codemirror-bundle.js build.js | node_modules
156+
$(NPX) node build.js
157+
155158
.PHONY: static
156-
static: $(PDFS) $(PREVIEWS) static/main.css
159+
static: $(PDFS) $(PREVIEWS) static/main.css static/codemirror.js
157160
install -Dm0644 -t static $(filter-out static/%,$^)
158161
for m in $(MANIFESTS); do
159162
tomlq -r '[.src, .demosrc] | @tsv' $$m | read src demosrc

build.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { build } from "esbuild";
2+
import { wasmLoader } from 'esbuild-plugin-wasm'
3+
4+
await build({
5+
entryPoints: ["src/codemirror-bundle.js"],
6+
bundle: true,
7+
format: "esm",
8+
target: ["es2020"],
9+
sourcemap: false,
10+
loader: { ".wasm": "file" },
11+
outdir: "static",
12+
outbase: "src",
13+
assetNames: "[name]",
14+
entryNames: "codemirror",
15+
plugins: [wasmLoader()],
16+
publicPath: "/",
17+
supported: {
18+
'top-level-await': true,
19+
},
20+
});

0 commit comments

Comments
 (0)