Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
246 changes: 229 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.3.1",
"homepage": "./",
"dependencies": {
"@coseeing/see-mark": "^1.11.0"
"@coseeing/see-mark": "^2.0.0"
},
"scripts": {
"dev": "node scripts/dev.mjs",
Expand Down
14 changes: 8 additions & 6 deletions scripts/pipeline.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
// build.mjs (one-shot, minified) and dev.mjs (watch + serve) so the two stay
// in lockstep instead of being hand-synced.
//
// We use esbuild (not Vite/Rollup) because the bundle includes mathjax-full,
// whose asciimath legacy code requires a NON-STRICT, classic-script bundle with
// a `global` shim. esbuild's iife output (no implicit "use strict", and it
// resolves the mathjax global correctly) satisfies this; Rollup did not.
// The output format must stay `iife`: index.html loads main.js as a classic
// (non-module) script so the exported site also works over file://.
//
// Until see-mark 2.0.0 the bundle additionally needed a non-strict context and
// a `global` shim, because mathjax-full's asciimath legacy code used
// `arguments.callee` and the Node `global`. see-mark 2.0.0 dropped asciimath,
// so the shim is gone; only the remaining mathjax v3 code (tex→mml, mml→svg)
// is bundled and it needs neither.
//
// Output mirrors the old CRA layout so Access8MathWeb's ZIP injection is
// unchanged: build/index.html + build/static/js/main.js + build/static/css/main.css.
Expand Down Expand Up @@ -42,13 +46,11 @@ export const copyPublic = async () => {
await cp(path.join(root, 'public'), out, { recursive: true });
};

// mathjax-full's asciimath legacy references the Node `global`, hence the define shim.
export const esbuildOptions = ({ minify = false } = {}) => ({
entryPoints: [path.join(root, 'src/main.js')],
bundle: true,
format: 'iife',
minify,
define: { global: 'globalThis' },
outfile: path.join(out, 'static/js/main.js'),
logLevel: 'info',
});