Russell
Russell

Reputation: 12439

Make Play! recompile when a file is modified rather than when browser is refreshed

Just starting out with the Play framework and one minor irritant is that it takes a long time (a few seconds) for it to recompile when I make a change then refresh so I can see it in the browser. This can get a bit irritating when making many minor adjustments to a view, for example.

Is there a magic way to make Play attempt to recompile whenever a source file is changed rather than waiting until the browser is refreshed?

Upvotes: 2

Views: 1354

Answers (1)

Russell
Russell

Reputation: 12439

Yes. The Play console is based on SBT, which has a handy way to run a command whenever a source file is changed by prefixing it with a tilde. So prefix run with a tilde like this in the Play console:

[my-play-app] $ ~run

And the application will attempt to recompile whenever a source file is changed, saving you precious seconds that soon start to add up.

Upvotes: 5

Related Questions