Excluding Elm source files from SBT binary distribution

122 views Asked by At

I'm using the Elm integration plugin for Scala/Play projects, known as sbt-elm, in conjunction with Play Framework.

I notice that, in addition to the elmMain.js file produced by the elm-make command, all of the .elm source files end up in the target/web/public/main/elm directory. I'm not sure if that's expected behaviour; maybe it's normal operation of the SbtWeb pipeline; but it does mean that the eventual binary distribution contains Elm source code that isn't actually needed at runtime.

To optimize the deployment of my application, I'd like to exclude the Elm source files from the distribution artifacts.

Should I look for a way to prevent the .elm files being copied to the target/web/public/main directory; or look for a way to prevent the .elm files from being packaged into the distribution artifacts? How might I do that?

Many thanks for your attention, and for any guidance that you might be able to offer.

1

There are 1 answers

0
Choucri On

I'm the maintainer of sbt-elm, thank you for raising this question and unfortunately I have no immediate solution for this. Therefore, I opened an issue on Github that you can view here: https://github.com/choucrifahed/sbt-elm/issues/13

Cheers, Choucri