From 246ee91dd1c4f574053b22a92ddd1c7d8feda213 Mon Sep 17 00:00:00 2001 From: Shunguo Date: Sat, 27 Jul 2024 15:03:19 -0500 Subject: [PATCH] change from require to import --- accessibility-checker/src-ts/lib/ACEngineManager.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/accessibility-checker/src-ts/lib/ACEngineManager.ts b/accessibility-checker/src-ts/lib/ACEngineManager.ts index 076a2cf8d..0ea70b371 100644 --- a/accessibility-checker/src-ts/lib/ACEngineManager.ts +++ b/accessibility-checker/src-ts/lib/ACEngineManager.ts @@ -3,6 +3,7 @@ import * as fs from "fs"; import { ACConfigManager } from "./common/config/ACConfigManager"; import { fetch_get_text } from "./common/api-ext/Fetch"; import { IChecker } from "./common/engine/IChecker"; +import { createRequire as topRequire } from "module"; let ace; @@ -269,7 +270,8 @@ export class ACEngineManager { const nodePath = path.join(engineDir, `ace-node-${fileSuffix}`); if (fs.existsSync(`${nodePath}.js`)) { - const ace_ibma = require(nodePath); + //const ace_ibma = require(nodePath); + const ace_ibma = await import(nodePath); checker = new ace_ibma.Checker(); return resolve(); } else {