From 2b4b65528d1561a78b152484e32607eed9049923 Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Thu, 3 Apr 2025 01:57:02 +0800 Subject: [PATCH] fix: avoid using import.meta.dirname; fixes Node.js 18 compatibility Closes #729 The bug is again related to the CLI code rather than the template - we need to refactor the CI workflow to test the CLI code in all environments. --- index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.ts b/index.ts index e2340627..a4862f5a 100755 --- a/index.ts +++ b/index.ts @@ -21,7 +21,7 @@ import { trimBoilerplate, removeCSSImport, emptyRouterConfig } from './utils/tri import cliPackageJson from './package.json' -const language = await getLanguage(path.resolve(import.meta.dirname, 'locales')) +const language = await getLanguage(fileURLToPath(new URL('./locales', import.meta.url))) const FEATURE_FLAGS = [ 'default', -- 2.39.5