Best CodeKit/LESS deployment workflow

I'm using IntelliJ to develop to a local Glassfish server. Part of the development is client side (CSS, Javascript, HTML). Here I want the fastest turn-around possible, without any re-deployment, etc. I've set IntelliJ to "Update Resources" on "Frame Deactivation". This works great for files I edit directly in IntelliJ. Those then get updated right away in the server whenever I switch to the browser window to reload the page.

However, I sometimes use intermediate "code processors", such as LESS or CodeKit (this is on a Mac). Those apps watch the source folder(s), perform their magic when source files change, which re-generates the output. This output also sits in my IntelliJ project, so it gets checked into version control and is otherwise known by the IDE. Now, the problem is, when I switch to the browser after editing, e.g, a LESS file, the LESS source file gets saved automatically by IntelliJ  and the LESS compiler kicks in and re-generates the corresponding CSS file. However, this CSS file then isn't automatically copied to the server. Likely because it isn't IntelliJ that modified the file, so it doesnt really know that it has changed "behind its back", and needs to be copied to the server folder. If I switch back and forth between the browser and IntelliJ a few times, IntelliJ recognizes that the file has changed. Then, the next time I switch back to the broser, it gets copied to the server folder, and is seen by the web browser.

So my question is, how can this workflow be simplified, so that files seen and served by Glassfish are updated automatically when I switch to the browser window, regardless of whether those were changed directly in IntelliJ or by and intermediate procedure (LESS/CodeKit "compilers", in this case)?


Please sign in to leave a comment.