webstead: use .mjs for JavaSript module

This means that emcc automatically uses the correct mode, and seems
slightly more correct to me.
This commit is contained in:
Ben Harris 2025-10-15 23:33:51 +01:00
parent 277091df19
commit 922af33a25
2 changed files with 5 additions and 5 deletions

View File

@ -21,7 +21,7 @@ all: $(DISTFILES)
.PHONY: all-web
all-web: all sample.png extended.png icon-16.png icon-32.png icon-64.png \
bedstead.js
bedstead.mjs
.PHONY: experimental
experimental: bedstead-chiseltip.otf bedstead-plotter-thin.otf \
@ -112,15 +112,15 @@ bedstead-complement.ps: bedstead
bedstead-complement.pdf: bedstead-complement.ps bedstead.otf Fontmap
ps2pdf -P $< $@
EMCCFLAGS = -O2 -sEXPORT_ES6 -sEXIT_RUNTIME -sSTRICT \
EMCCFLAGS = -O2 -sEXIT_RUNTIME -sSTRICT \
-sINCOMING_MODULE_JS_API='["arguments","print"]'
EMCCFLAGS += $(CWARNFLAGS)
%.js: %.c
%.mjs: %.c
emcc $(EMCCFLAGS) -o $@ $<
.PHONY: clean
clean:
rm -f bedstead *.ttx *.otf *.bdf *.bdf.ps *.png *.pdf *.js *.wasm \
rm -f bedstead *.ttx *.otf *.bdf *.bdf.ps *.png *.pdf *.mjs *.wasm \
bedstead-complement.ps
.PHONY: install-user

View File

@ -147,7 +147,7 @@
document.querySelector('#drawing').onclick = drawing_click;
update_glyph(true);
}
import("./bedstead.js").then((module) => {
import("./bedstead.mjs").then((module) => {
Bedstead = module.default;
// This script is loaded asynchronously, so make sure the DOM is
// loaded before touching it.