Skip to content

Commit

Permalink
change require() to import
Browse files Browse the repository at this point in the history
  • Loading branch information
shunguoy committed Jul 27, 2024
1 parent 246ee91 commit acf3d3e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions accessibility-checker/src-ts/lib/ACEngineManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ 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;

Expand Down Expand Up @@ -275,13 +274,14 @@ export class ACEngineManager {
checker = new ace_ibma.Checker();
return resolve();
} else {
fs.writeFile(nodePath + ".js", data, function (err) {
fs.writeFile(nodePath + ".js", data, async function (err) {
if (err) {
console.log(err);
reject(err);
} else {
try {
const ace_ibma = require(nodePath);
//const ace_ibma = require(nodePath);
const ace_ibma = await import(nodePath);
checker = new ace_ibma.Checker();
resolve();
} catch (e) {
Expand Down

0 comments on commit acf3d3e

Please sign in to comment.