From: edison Date: Mon, 24 Apr 2023 03:03:57 +0000 (+0800) Subject: fix(compiler-sfc): normalize windows paths when resolving types (#8136) X-Git-Tag: v3.3.0-beta.2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=29da50468770fcee16ba5d5bec7166dd5bc120ee;p=thirdparty%2Fvuejs%2Fcore.git fix(compiler-sfc): normalize windows paths when resolving types (#8136) --- diff --git a/packages/compiler-sfc/src/script/resolveType.ts b/packages/compiler-sfc/src/script/resolveType.ts index 13fe57e46a..ac1a42be9b 100644 --- a/packages/compiler-sfc/src/script/resolveType.ts +++ b/packages/compiler-sfc/src/script/resolveType.ts @@ -718,7 +718,7 @@ function importSourceToScope( let resolved if (source.startsWith('.')) { // relative import - fast path - const filename = path.join(scope.filename, '..', source) + const filename = normalizePath(path.join(scope.filename, '..', source)) resolved = resolveExt(filename, fs) } else { // module or aliased import - use full TS resolution, only supported in Node