Play - BrowserSync
You can find my blog post explaining quickly all about that project on my website.
This setup assumes you already have
NPM installed on your machine.
- Go to the root of the project
npm installto grab some dependencies
- Open 2 shells
sbt runin the first one and wait for it to finish. You should have a Play server running now.
gulpin the second one, this will start a BrowserSync proxy on top of the Play server (run
npm install -g gulpif you don't have gulp yet).
- Enjoy the result at http://localhost:9001
BrowserSync is configured to listen to the following files and live-reload them:
app/views/index.scala.html: a Scala template, will trigger a full reload of the page, and so on a compilation of the template by Play
resources/less/main.less: a LESS file, watched by Gulp, that will be automatically compiled to
public/stylesheets/main.css, which is watched by BrowserSync and will be hot deployed (the page will be repainted with the new CSS without a full reload)
The 2nd killer feature of BrowserSync (after the live-reloading) is to sync your app across several devices. Meaning that you can open http://localhost:9001 in several browsers, in several devices (desktop, tablet, smartphone, ...) and start interacting with them. All basic actions, like clicking, touching, scrolling, ... will been replicated on all devices. This is pure awesomeness.
Just me... Paul Dijou
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2004 Copyright (C) 2014 Paul Dijou Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed. DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. You just DO WHAT THE FUCK YOU WANT TO.