mirror of
https://bjh21.me.uk/bedstead/.git
synced 2026-07-09 21:43:06 -04:00
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:
parent
277091df19
commit
922af33a25
8
Makefile
8
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
|
||||
|
||||
@ -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.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user