Skip to content

Commit

Permalink
Merge pull request #3684 from OrfeasZ/fix/watch-project-changes
Browse files Browse the repository at this point in the history
Re-compile deleted files after project changes in watch mode
  • Loading branch information
MangelMaxime authored Jan 24, 2024
2 parents e7d45db + 9441b50 commit cc06404
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/Fable.Cli/Main.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1067,18 +1067,28 @@ let private getFilesToCompile
file
)

let pathResolver = state.GetPathResolver()

let filesToCompile =
projCracked.SourceFilePaths
|> Array.filter (fun path ->
changes.Contains path
|| pendingFiles.Contains path
|| state.TriggeredByDependency(path, changes)
// TODO: If files have been deleted, we should likely recompile after first deletion
|| (
match oldFiles with
| Some oldFiles -> not (oldFiles.ContainsKey(path))
| None -> false
)
|| (
// If files have been deleted, we should likely recompile after first deletion
let outPath = getOutPath state.CliArgs pathResolver path

let wasDeleted =
(path.EndsWith(".fs") || path.EndsWith(".fsx"))
&& not (IO.File.Exists outPath)

wasDeleted)
)

Log.verbose (
Expand Down

0 comments on commit cc06404

Please sign in to comment.