Open anelson opened 8 years ago
The plugin executes grunt serve
on run
and then executes the grunt watch
command.
If you are using grunt-contrib-compass
, there will be a task compass
which can be called in the watch
task. Can you share your Gruntfile.js
?
Sure, here is my Gruntfile.js
: https://gist.github.com/anelson/7936871cff04c226e3fc
In your watch
task, the compass
task is already added. But maybe the files are at a different path.
Can you please check if everything works correctly with the following steps?
$ cd projectName
$ cd ui
$ grunt serve
Make changes to a sass file and see if its reflected.
Running the following commands results in the .tmp/styles/main.css
file being generated:
$ cd projectName/ui
$ grunt clean
$ grunt serve
however that is not my problem. My problem is the following:
$ cd projectName/ui
$ grunt clean
At this point, as you would expect, the .tmp/styles/main.css
file is now deleted. Let's start the Play server:
$ cd ..
$ ./activator
$ run
in this case, .tmp/styles/main.css
is still not created. The app loads, but without the stylesheet it renders improperly.
If I touch the app/styles/main.scss
file, then the watcher picks that up and generates the .css
file, but not before then.
My usual workflow with Play is to keep the SBT
run
task running during development, taking advantage of the automatic recompilation in Play. I'm trying to add a Javascript frontend build with the Yeoman/Grunt/Bower toolchain, which has worked great thanks to your plugin. However, there's an issue with the Play run hook that breaks my usual workflow. I'm too new to the use of this plugin to know if this is a bug or if more experienced developers use a different workflow, so allow me to describe the issue and you decide:When I run a
run
command in SBT, the Play run hook in insbt-yeoman
runs based on this code:This runs
grunt watch
, but this doesn't run tasks likeconcurrent:server
, which runs Compass and generates the CSS files in.tmp
. Because of this, I have to manually rungrunt concurrent:server
first, beforerun
. It seems to me that the Play run hook should runserve
instead ofwatch
, particularly since the instructions in the README for play-yeoman suggest commenting out theconnect:livereload
line inGruntfile.js
.