generator-closure
generator-closure copied to clipboard
Run 'deps' in server & build tasks
Generating a project with the generator and subsequently running grunt server
will open the app without the deps.js file existing yet.
Since the tasks is rather fast, IMHO deps
should be run at the beginning of server
and maybe `build, as well.
hmmm are you sure about this? The fresh generated project contains a proper deps.js
file...
Have not tested recent versions lately, so I didnt yet realize deps.js
is being created now.
However, running deps
in server
could also be beneficial eg. when you just pulled recent changes from a repo that introduced new depencencies or similar. Dunno, just my 2 cents.
Any changes to goog.required scripts won't be mirrored in deps.js in server-mode until you explicitly launch grunt deps
(this is the behaviour of vanilla app generated by this generator).
(btw, live-reloading doesn't work in vanilla app either)
@ostronom that's the expected behavior... why didn't you open a new issue for the live-reloading? does the problem persist? If so please open a new issue
@casio running deps on server is a major nono for so many reasons... On server only your compiled app should land...
@thanpolas err, the 'server' we're talking about here is a local dev server with livereload & whatnot and by no means a production server.
We're both talking about the grunt server
command, I think?
@casio i see...
So what's the issue here? I am not sure i completely understand...
If it's about deps automation, then you have to setup your gruntfile as it'd fit your needs... i can help with that... or it's something else?
@thanpolas I just created this very minor ticket as a little hint regrading developer convenience..U know, so guys checking out the generator would have a proper git clone, npm install, launch & success experience : )
Really minor, so please close as you see fit. However, @ostronom's argument might be worth considering...
I see, i will do a full regression test soon and if all checks out i'll close the issue.
for the record, i don't consider adding the grunt deps
task to livereload/watch, i might add the option commented out in the Gruntfile so it's activated by folks that require it.
Deps generation is decoupled and irrelevant with the watch tasks. The deps task needs to run whenever a change in the deps tree of your product has changed, that doesn't happen with every file change.... Personally, i have the grunt deps
command as a shortcut key in sublime (build option), so whenever i touch the dep tree i just press Cmd+b
and the deps file is updated before i switch windows to my browser...
I've made a new grunt-file with your closure-oriented tasks, which:
- assembles all js and stuff to .tmp directory
- runs deps on them
- makes a symlink (grunt-contrib-symlink or smth) of closure-library to .tmp/.../closure-library
- and serves the app from .tmp
This gives a possiblity to develop not only in js, but in coffee/livescript/etc and to do a deps-run on change of .tmp/*.js to recalculate dependencies.
I will share a gruntfile via gist when i'll be sure that everything works (if you want).
P.S. I can't file an issue about livereload breakage, because i don't know how to fix it :) So it's probably not a bug of this software.