From 922af33a25a09e023ce094ac22476ea63dfda0a9 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Wed, 15 Oct 2025 23:33:51 +0100 Subject: [PATCH] webstead: use .mjs for JavaSript module This means that emcc automatically uses the correct mode, and seems slightly more correct to me. --- Makefile | 8 ++++---- webstead.xhtml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index e26e904..0e4bc39 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/webstead.xhtml b/webstead.xhtml index 0515640..9de99cf 100644 --- a/webstead.xhtml +++ b/webstead.xhtml @@ -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. -- 2.30.2