guardian/frontend — pull request #5670 by sndrs (2014-08-20 16:49:03+00:00)
Title: Grunt changes

This PR contains some big-looking but hopefully small suggestions for the way we use grunt. I think these are good ideas, but this is also meant by way of a discussion too...

### 1. use `load-grunt-config`
Means we can move all config to individual `/grunt-configs/CONFIG_NAME.js` files, to hopefully make it easier to read the `Gruntfile` and find what you need.

### 2. kill sass sourcemaps in `prod`
We already don't create them for js. Killing sourcemaps in prod saves 10 secs off compiling on my machine:

`grunt compile —dev` (sourcemaps)

![screen shot 2014-08-20 at 16 58 55](https://cloud.githubusercontent.com/assets/867233/3983936/c1858ace-2883-11e4-977c-728a93da7b7d.png)

`grunt compile` (no sourcemaps)

![screen shot 2014-08-20 at 16 58 36](https://cloud.githubusercontent.com/assets/867233/3983949/dde77af6-2883-11e4-94f3-3ea47c83c2bf.png)

As far as I can tell, `csdevmode`also saves time by not creating sourcemaps. Does this mean people aren’t using them at all?

### 3. Runs `sass` and `r.js` simultaneously in `compile` using `grunt-concurrent`.

Because of savings in `require` this doesn’t make a huge difference in dev, but it runs about twice as fast in prod for me. There may well be other places this can be used too.

`grunt compile —dev`

before:

![compile --dev](https://cloud.githubusercontent.com/assets/867233/3984056/dcce5cce-2884-11e4-8bb7-43b8add91e5e.png)

after:

![new compile --dev](https://cloud.githubusercontent.com/assets/867233/3984061/e7af6bb0-2884-11e4-826c-1d1f39801e9d.png)

`grunt compile`

before:

![compile](https://cloud.githubusercontent.com/assets/867233/3984072/fb7ec730-2884-11e4-9b6c-b1d6c7cee283.png)

after:

![new compile](https://cloud.githubusercontent.com/assets/867233/3984075/03f9ead4-2885-11e4-9456-f3357bf3016c.png)

cc: @phamann @ironsidevsquincy @mattosborn