@@ -4,7 +4,7 @@ import { DEFAULT_EXTENSIONS } from '../constants.ts';
44import { debugLog , debugLogArray } from './debug.ts' ;
55import { findFileWithExtensions , isDirectory } from './fs.ts' ;
66import { _glob , prependDirToPattern } from './glob.ts' ;
7- import { isAbsolute , isInternal , join , toRelative } from './path.ts' ;
7+ import { isAbsolute , isInternal , join , relative , toRelative } from './path.ts' ;
88
99const defaultExtensions = `.{${ [ ...DEFAULT_EXTENSIONS ] . map ( ext => ext . slice ( 1 ) ) . join ( ',' ) } }` ;
1010const hasTSExt = / (?< ! \. d ) \. ( m | c ) ? t s x ? $ / ;
@@ -45,13 +45,13 @@ export const getToSourcePathsHandler = (chief: ConfigurationChief) => {
4545 const patterns = new Set < string > ( ) ;
4646
4747 for ( const specifier of specifiers ) {
48- const absSpecifier = isAbsolute ( specifier ) ? specifier : prependDirToPattern ( dir , specifier ) ;
48+ const absSpecifier = isAbsolute ( specifier ) ? specifier : join ( dir , specifier ) ;
4949 const ws = chief . findWorkspaceByFilePath ( absSpecifier ) ;
5050 if ( ws ?. srcDir && ws . outDir && ! absSpecifier . startsWith ( ws . srcDir ) && absSpecifier . startsWith ( ws . outDir ) ) {
51- const pattern = absSpecifier . replace ( ws . outDir , ws . srcDir ) . replace ( matchExt , extensions ) ;
52- patterns . add ( pattern ) ;
51+ const srcPath = absSpecifier . replace ( ws . outDir , ws . srcDir ) . replace ( matchExt , extensions ) ;
52+ patterns . add ( relative ( dir , srcPath ) ) ;
5353 } else {
54- patterns . add ( absSpecifier ) ;
54+ patterns . add ( specifier ) ;
5555 }
5656 }
5757
0 commit comments