Fable icon indicating copy to clipboard operation
Fable copied to clipboard

`Fable` removes all `.js` files from `.fable_modules` when a file in project is added/removed

Open lukaszkrzywizna opened this issue 8 months ago • 1 comments

Description

During fable watch, any file adding/removing causes the clearing of all .js files within fable_modules resulting whole application failing. Only rerun helps.

Repro code

  1. Running fable watch ./src/{my-project} --outDir ./src/{my-project}/.fable-build
  2. Adding/Removing a file in a project

The video shows the problem:

https://github.com/fable-compiler/Fable/assets/12534253/cdfbd0d3-36ec-4a32-9c91-216432eebd41

Related information

  • Fable version: 4.6.0
  • Operating system: Mac OS 14 Sonoma

lukaszkrzywizna avatar Dec 05 '23 08:12 lukaszkrzywizna

Indeed, it looks like when Fable detect a change to the fsproj it cleans the fable_modules, then restore the fsproj/csproj and rebuild the fable_modules however without compiling the Fable dependencies back.

IHMO Fable, should not clean the fable_modules as a whole and instead remove only the dependencies that changed (removed, version changed, added) and keep the others in place.

MangelMaxime avatar Dec 06 '23 15:12 MangelMaxime