From 068ef26e2286f65524f9e60ce39539d4f96b000c Mon Sep 17 00:00:00 2001 From: Windson Date: Tue, 23 Jan 2024 11:46:27 +0800 Subject: [PATCH] in cjs, use require to instead createRequire. fix #18 --- src/html/Base.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/html/Base.ts b/src/html/Base.ts index 5bf65cd..d260ea5 100644 --- a/src/html/Base.ts +++ b/src/html/Base.ts @@ -8,7 +8,7 @@ import glob from 'fast-glob' import debug from 'debug' import { createRequire } from 'node:module'; -const _require = createRequire(import.meta.url); +const _require = import.meta.url!==undefined ? createRequire(import.meta.url): require; const fsp = fs.promises const DEFAULT_GLOB_PATTERN = [