0

So after running the command recommended in Scalatras guides, at root dir:

$ sbt
> ~;jetty:stop;jetty:start

I get jetty to reload changes when I make changes in scala files, but if I make changes in js or css I must end jetty and relaunch the same command.

Is there anyway to improve this workflow? how to livereload also when files inside webapp (*.js, *.css files) dir have been changed?

CommonSenseCode
  • 23,522
  • 33
  • 131
  • 186

1 Answers1

1

Scalatra should reload resources under webapp directory by just start your apps with set ~jetty:start.

Naoki Takezoe
  • 471
  • 2
  • 7
  • Thanks but it still only reloading when changing the *.scala files, not when I change stuff in webapp dir such as js or css files. – CommonSenseCode Oct 10 '17 at 19:07
  • I make a small change in js or css, then save with intellij, and nothing seems to happen in the sbt prompt, am I missing something? – CommonSenseCode Oct 10 '17 at 19:15
  • It looks to be occurred with only sbt 1.0. If you create your project by `sbt new scalatra/scalatra.g8`, try to specify sbt 0.13.15 when creating a project. or also you can switch to sbt 0.13.15 by updating `project/build.properties` by hand. Note that if you've once compiled or run with sbt 1.0, it might need to delete some directories such as `/target`, `project/target` and `project/project` after switching to sbt 0.13.15. – Naoki Takezoe Oct 14 '17 at 04:54
  • It was a problem in xsbt-web-plugin 4.0.0 with sbt 1.0.0. I reported and already fixed (https://github.com/earldouglas/xsbt-web-plugin/issues/355). So sbt-scalatra plugin will be also fixed soon! – Naoki Takezoe Oct 14 '17 at 17:28