Search code examples
haskellhaskell-stackhpack

exclude temporarily a file from a `stack build` when using hpack (package.yaml)


One may work on a haskell file in the source-dirs directory and decide for now not to include this file in a stack build. Is there a simple way to exclude temporarily the file form the build?

The obvious work-around is to move the file to another directory, but I hope this can be achieved inside hpack in a simple way which I did not find in the hpack docs.


Solution

  • Specifying the module under an always false conditional will make hpack's auto-discovery skip it:

    when:
    - condition: false
      other-modules: Excluded.Module