From f9bcc079cb0aed3bb49cba2f6c9e52507cf3f381 Mon Sep 17 00:00:00 2001 From: ntnyq Date: Sun, 1 Dec 2024 10:10:11 +0800 Subject: [PATCH] fix: `require.extensions` may be `undefined` --- packages/core/src/constants.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/constants.ts b/packages/core/src/constants.ts index 232d5cebe..baa91fbb3 100644 --- a/packages/core/src/constants.ts +++ b/packages/core/src/constants.ts @@ -6,4 +6,4 @@ export const cjsRequire = typeof require === 'undefined' ? createRequire(import.meta.url) : require // eslint-disable-next-line n/no-deprecated-api, sonar/deprecation -export const EXTENSIONS = ['.ts', '.tsx', ...Object.keys(cjsRequire.extensions)] +export const EXTENSIONS = ['.ts', '.tsx', ...Object.keys(cjsRequire.extensions || {})]