]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore: update edison/feat/resolveConfigDir 13491/head
authorautofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Wed, 18 Jun 2025 06:47:11 +0000 (06:47 +0000)
committerdaiwei <daiwei521@126.com>
Wed, 18 Jun 2025 06:50:18 +0000 (14:50 +0800)
packages/compiler-sfc/src/script/resolveType.ts

index 63ef30b3a49775855ce5c669e0901f6ec2d2e7bf..ae7bcbfe17053a4888158dfe071fce393504fa0f 100644 (file)
@@ -1030,12 +1030,11 @@ function resolveWithTS(
       matchedConfig = configs[0]
     } else {
       const [major, minor] = ts.versionMajorMinor.split('.').map(Number)
-      function getPattern(base: string, p: string): string {
-        const supportsConfigDir =
-          major > 5 || (major === 5 && minor >= 5)
+      const getPattern = (base: string, p: string) => {
+        // ts 5.5+ supports ${configDir} in paths
+        const supportsConfigDir = major > 5 || (major === 5 && minor >= 5)
         return p.startsWith('${configDir}') && supportsConfigDir
-          ? // ts 5.5+ supports ${configDir} in paths
-            normalizePath(p.replace('${configDir}', dirname(configPath!)))
+          ? normalizePath(p.replace('${configDir}', dirname(configPath!)))
           : joinPaths(base, p)
       }
       // resolve which config matches the current file