Questions about Grunt

Hi, I’m new to Grunt but I’m not too happy with it. :slight_smile: I explain why:

  1. For compiling/minimizing/etc I already use a preprocessor (such as Prepros) that does more things like live refresh or image optimization. Can Grunt does these things? Or, can I use the preprocessor with Roots (in place of Grunt) without have to change tons of settings?

  2. To use Grunt I have to “npm install” it each time for each new project. Am I right? And it takes some time to install it and some space (about 10MB) that “dirty” the project folder. Also it increases the overall size of the project that increases time to upload the project on ftp with files that don’t serve anymore for the online project.

  3. When I have to make a quick edit on an old project I have to launch Grunt by open new cmd, enter in the project folder and lunch “grunt watch”. That is a little bit uncomfortable compared to the use of a preprocessor.

Let me know if I’m wrong, and if you can help me

Roots rulez, anyway

I think yes. I can only run “grunt” command if the node_modules is in my project folder. Than I add it to gitignore so it won’t push to my code repository and server.

  1. I promise you that grunt can do more things, and yes, it can do LiveReload (already built into the Roots Gruntfile, you just need to set it to true and use the LiveReload browser extension) and image optimization - see this thread. You don’t have to use Grunt if you setup your preprocessor to mimic the Gruntfile.

  2. Yes, but the node_modules/ folder is excluded from git and you don’t need to upload it when you upload your project. Also, stop using FTP :slight_smile:

  3. Not really a big deal… opening Terminal + cd /wherever/your/project/is/ + grunt watch doesn’t take long

Watch the preview of the Grunt screencast where I talk about grunt’s advantages over apps like Prepros

Dude, I have to do that, like, at least once a day. GOSH! Can’t we find a better way?!?!


Write a script to run grunt watch. Put it in your local roots branch. Copy to every new project when copy Roots. Double click in gui file manager.

Ditto npm install.

That’s an interesting idea. I usually just arrow-up like a mad woman :smiley:

I find this no different than starting up MAMP or a similar server.

@popsy At the start of your day open up your terminal app of choice, cd into the directory, and keep the window open until the end of the day. If you need the terminal for other tasks, just open a separate window.

Or, run grunt, then Ctrl or Cmd + Z will pause Grunt, and type “bg” to put it in the background. Then you can run grunt watch and git from the same terminal.

Or run grunt watch & on a Unix derived OS and it will background automatically.

Or write a script that runs at startup to grunt watch… so many solutions. :slight_smile:

I develop in Windows and use a GUI for git so I took the run script (batch file) from file manager approach.

I’d like to hijack this thread to ask about this if that’s ok.

I’m a happy convert to grunt, but I’m only using it locally. When it comes to trying things on a live site, I still just upload files with ftp the old fashioned way.

When you say ‘stop using ftp’ do you mean I should/could be editing files and running grunt directly on the remote server? This would actually be ideal for me because I switch between local machines fairly often.

What are the requirements to do that? Or I guess more specifically: what kind of level of hosting would I need to invest in? I assume my humble shared hosting account won’t cut it? Is this part of why people get VPSs and dedicated servers?

Editing files directly on a live server should be a last resort, followed by weeping in a darkened corner, with a large bottle of whisky, and Paranoid Android by Radiohead on repeat.

If you have SSH and Git installed on your server (quite a few shared hosts offer this) then you should be deploying using Git. If you have full control (VPS or a dedicated server) then you should look into Capistrano. There are plenty of resources on the web already, but we’ll be covering version controlled deployment in forthcoming screencasts.


Thanks for your reply Foxaii. :slight_smile:

Yeah I’ve been reading up on things since that last post and realised benword was probably just talking about git.

Git has always been kind of a mystery to me. I use it to get the latest version of Roots at the start of a new project, but that’s about it. Maybe it’s time to bite the bullet and see what all the fuss is about!

This is a great resource for beginning to use Git:

1 Like

Update: git is pretty cool.

So is the idea to do all the dev locally, then push to a remote repository on my hosting when I’m ready to go live? That doesn’t seem all that different from just uploading with FTP. Am I missing some obvious benefit?

(Basically my host wants me to fax them photo id before they’ll enable ssh access (?!) so I’m trying to judge whether it’s worth the hassle.)

Weird, who’s your host if I may ask?

Git isn’t just for pushing content to a live site, it’s version control. The site has a video called “What is Video Control?” you should check out. For some reason Discourse isn’t letting me post the link this time.

There’s a lot more to it than git push and git pull.

Yeah I can see how cool the version control stuff is, and I’m making my way through the tutorial book you linked (thanks for that). I’ll definitely be using it as part of my local development from now on.

It was mostly just the “use it instead of ftp for deployment” thing I was wondering about.

My host is . I only just switched to them and so far they’ve been pretty good (with awesome goon discounts if that means anything to you). But yeah wanting me to sign a form, attach photo id, scan it and send it to them seems a bit much (and this is after I paid $5 for the “SSH addon”).

If people have other suggestions for good hosts I’m all ears. (preferably less than $20 a month at this stage)
Right now I’m trying out openshift and linode.

I can suggest, I just switched over to them and created both a dev and production VPS from them.

If you go to, they have a promotion for a pretty decent VPS, 1gb RAM for $19 a year. Real affordable for a VPS. Weloveserver’s support is pretty good as well, it’s ticket based but they reply within minutes in my experience.

If you’re looking for more freedom/customization/learning you should look at VPS’s, which I assume you are since you are checking out Linode.

1 Like

I’ll chime in and recommend yet another VPS host:

Their plans start at $5/month and so far they have been great. It doesn’t beat the $19/year above but I thought I would throw it in. It is a small investment to start playing and learning how to setup your very own VPS.

I’ve used Digitalocean as well, no complaints there. If I hadn’t found weloveservers, I would be using Digitalocean right now. $5 is still pretty cheap, and their VPS’s run fast.

Also, their tutorials are very good. I suggest taking a look at them, even if you aren’t using their services, since they are directed at distro’s.

+1 for Paranoid Android :smiley:

What you’re saying is new to me. I’ve always used FTP to upload my websites on the hosting. Could you explain to a newbie how to bypass Ftp upload? Thanks

I have heard good things about digitalocean, and I think I’ll give them a shot.

$5 is cheap enough that I can just use it in parallel with my old shared hosting for a while.

I think it’ll be a long while before I’m confident enough to run a live site off a server I’m managing myself!