@@ -72,7 +72,6 @@ export interface OutputContextOptions {
7272export class FileWatcher {
7373 private currentEvents : WatcherEvent [ ] = [ ]
7474 private extensionPaths : string [ ] = [ ]
75- private functionOutputDirectories : string [ ] = [ ]
7675 private app : AppLinkedInterface
7776 private readonly options : OutputContextOptions
7877 private onChangeCallback ?: ( events : WatcherEvent [ ] ) => void
@@ -143,9 +142,11 @@ export class FileWatcher {
143142 ...ALWAYS_IGNORED_PATHS ,
144143 ( path : string ) => {
145144 const normalizedPath = normalizePath ( path )
146- const isFunctionOutput = this . functionOutputDirectories . some (
147- ( directory ) => normalizedPath === directory || normalizedPath . startsWith ( `${ directory } /` ) ,
148- )
145+ const isFunctionOutput = this . app . realExtensions . some ( ( extension ) => {
146+ if ( ! extension . isFunctionExtension ) return false
147+ const directory = normalizePath ( joinPath ( extension . directory , dirname ( extension . outputRelativePath ) ) )
148+ return normalizedPath === directory || normalizedPath . startsWith ( `${ directory } /` )
149+ } )
149150 return isFunctionOutput || isInCargoTargetDirectory ( normalizedPath , cargoProjects )
150151 } ,
151152 ] ,
@@ -161,9 +162,6 @@ export class FileWatcher {
161162
162163 updateApp ( app : AppLinkedInterface ) {
163164 this . app = app
164- this . functionOutputDirectories = app . nonConfigExtensions
165- . filter ( ( extension ) => extension . isFunctionExtension )
166- . map ( ( extension ) => normalizePath ( joinPath ( extension . directory , dirname ( extension . outputRelativePath ) ) ) )
167165 this . extensionPaths = this . app . nonConfigExtensions
168166 . map ( ( ext ) => normalizePath ( ext . directory ) )
169167 . filter ( ( dir ) => dir !== this . app . directory )
0 commit comments