feat: frontend support.

This commit is contained in:
2026-02-28 18:44:57 +08:00
parent d75671596c
commit f1054e6476
25 changed files with 3681 additions and 120 deletions

View File

@@ -10,14 +10,15 @@ import path from "node:path";
import { fileURLToPath, pathToFileURL } from "node:url";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const bundlePath = path.join(__dirname, "..", "dist", "anisette.js");
const {Anisette, loadWasm} = await import("../js/dist");
// const bundlePath = path.join(__dirname, "..", "dist", "anisette.js");
const { Anisette, loadWasm } = await import(
pathToFileURL(bundlePath).href
).catch(() => {
console.error("Bundle not found. Run: npm run build:js");
process.exit(1);
});
// const { Anisette, loadWasm } = await import(
// pathToFileURL(bundlePath).href
// ).catch(() => {
// console.error("Bundle not found. Run: npm run build:js");
// process.exit(1);
// });
const args = process.argv.slice(2);
if (args.length < 2) {