From: Haoqun Jiang Date: Wed, 2 Apr 2025 17:57:02 +0000 (+0800) Subject: fix: avoid using import.meta.dirname; fixes Node.js 18 compatibility X-Git-Tag: v3.16.4~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b4b65528d1561a78b152484e32607eed9049923;p=thirdparty%2Fvuejs%2Fcreate-vue.git 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. --- 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',