mirror of
https://github.com/remko/waforth
synced 2025-01-19 22:26:17 +01:00
shell: display build date
This commit is contained in:
parent
ea97e51644
commit
e7cf4909fa
2 changed files with 10 additions and 2 deletions
|
@ -72,6 +72,11 @@ let buildConfig = {
|
||||||
".wasm": "binary",
|
".wasm": "binary",
|
||||||
".js": "jsx",
|
".js": "jsx",
|
||||||
},
|
},
|
||||||
|
define: {
|
||||||
|
WAFORTH_VERSION: watch
|
||||||
|
? `"dev"`
|
||||||
|
: `"${new Date().toISOString().replace(/T.*/g, "")}"`,
|
||||||
|
},
|
||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
metafile: true,
|
metafile: true,
|
||||||
plugins: [wasmTextPlugin(), forthPlugin()],
|
plugins: [wasmTextPlugin(), forthPlugin()],
|
||||||
|
|
|
@ -1,8 +1,12 @@
|
||||||
|
/* global WAFORTH_VERSION */
|
||||||
|
|
||||||
import WAForth from "../WAForth";
|
import WAForth from "../WAForth";
|
||||||
import sieve from "../../examples/sieve.f";
|
import sieve from "../../examples/sieve.f";
|
||||||
import "./shell.css";
|
import "./shell.css";
|
||||||
|
|
||||||
document.title = "WAForth";
|
document.title = "WAForth";
|
||||||
|
const version =
|
||||||
|
typeof WAFORTH_VERSION !== "undefined" ? WAFORTH_VERSION : "dev";
|
||||||
|
|
||||||
const forth = new WAForth();
|
const forth = new WAForth();
|
||||||
|
|
||||||
|
@ -86,8 +90,7 @@ function startConsole() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function clearConsole() {
|
function clearConsole() {
|
||||||
consoleEl.innerHTML =
|
consoleEl.innerHTML = `<span class='header'><a target='_blank' href='https://github.com/remko/waforth'>WAForth (${version})</a>\n</span><span class="cursor"> </span><input type="text">`;
|
||||||
"<span class='header'><a target='_blank' href='https://github.com/remko/waforth'>WAForth</a>\n</span><span class=\"cursor\"> </span><input type=\"text\">";
|
|
||||||
inputEl = document.querySelector("input");
|
inputEl = document.querySelector("input");
|
||||||
cursorEl = document.querySelector(".cursor");
|
cursorEl = document.querySelector(".cursor");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue