]> git.ipfire.org Git - thirdparty/vuejs/create-vue.git/commitdiff
fix: avoid using import.meta.dirname; fixes Node.js 18 compatibility
authorHaoqun Jiang <haoqunjiang@gmail.com>
Wed, 2 Apr 2025 17:57:02 +0000 (01:57 +0800)
committerHaoqun Jiang <haoqunjiang@gmail.com>
Wed, 2 Apr 2025 18:01:20 +0000 (02:01 +0800)
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

index e2340627361e226e88c37f0df133e3aac970c3d4..a4862f5ac5b87a7fbcec616ef2ec9295dd9a6b52 100755 (executable)
--- 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',