0

I have developed an sbt-web plugin for Elm language for which I used as inspiration sbt-stylus plugin from this tutorial.

The usage is the following: In assets/elm directory one can put an Elm project: i.e., *.elm files and elm-packages.json. The plugin will only compile Main.elm if it exists, and generate a Main.js. elm-make makes sure to recursively compile only the modules that are imported by Main.elm.

The problem I have is that if I modify one of the modules imported by Main.elm, a new compilation of Main.elm does not get triggered by sbt. Could anyone tell me how to specify the other *.elm files as dependencies of Main.elm in order to trigger the compilation?

Note that I do not want to do something like:

elm-make *.elm --output=Main.js

Thanks!

Alex Sutii
  • 293
  • 3
  • 8
  • Normally it uses the import commands to find what to compile – Simon H Sep 19 '16 at 19:01
  • I do understand how `elm-make` finds what to compile. The problem is that `sbt` does not know that `Main.elm` depends on those other `*.elm` files, so it does not trigger a new compilation for `Main.elm` when one of the imported `*.elm` files change. – Alex Sutii Sep 19 '16 at 21:37
  • 2
    If you use sbt-web's `syncIncremental` function, whenever you compile something, you should return a collection of read files and written files. I've got an example in my project compiling sass files ([sbt-sassify](https://github.com/irundaia/sbt-sassify)) – irundaia Oct 20 '16 at 13:43

0 Answers0