]> git.ipfire.org Git - thirdparty/vuejs/create-vue.git/commitdiff
chore: add comments about __dirname and glob import
authorHaoqun Jiang <haoqunjiang@gmail.com>
Tue, 17 Oct 2023 07:06:17 +0000 (15:06 +0800)
committerHaoqun Jiang <haoqunjiang@gmail.com>
Tue, 17 Oct 2023 07:06:17 +0000 (15:06 +0800)
utils/getLanguage.ts

index fffccc203841c088e36fe0544a18046419c5c216..a8b6e5a1891b2de56aa123d95c939e6377d91593 100644 (file)
@@ -57,6 +57,10 @@ function getLocale() {
 
 export default function getLanguage() {
   const locale = getLocale()
+
+  // Note here __dirname would not be transpiled,
+  // so it refers to the __dirname of the file `<repositoryRoot>/outfile.cjs`
+  // TODO: use glob import once https://github.com/evanw/esbuild/issues/3320 is fixed
   const localesRoot = path.resolve(__dirname, 'locales')
   const languageFilePath = path.resolve(localesRoot, `${locale}.json`)
   const doesLanguageExist = fs.existsSync(languageFilePath)