top | item 5685295

(no title)

scjr | 13 years ago

What makes this different from the default yeoman webapp generator?

discuss

order

disintegrator|12 years ago

If you like the combination of Jade + CoffeeScript + LESS, then I submit my generator for your consideration (and I would appreciate any insights you may have on its shortcomings or possible improvements). My generator is slightly more barebones than webapp:app. I don't include LiveReload, connect or require.js initially:

- I did not need LiveReload or connect because I use a combination of `grunt watch` and `http-server -c-1`[1] during development with no issues.

- require.js has not been an immediate requirement for me across a lot of projects, so I decided to defer the decision to the developer and go with a minimal setup.

The inbuilt webapp generator makes no decisions on which template language to use (some may prefer this over starting with Jade). It also decides to go with SASS/Compass instead of LESS. This is also fine except that it means I now need to have ruby and compass installed which I wanted to avoid[2].

The way I approach asset revving is a bit different in that I pass the developer a function to use in their Jade templates to refer to assets (images/css/etc...). It will resolve the path to an asset and form the url with a revision appended as a request parameter during template compilation (not after). It is kind of similar to the way django_compressor does its job if you are familiar with it (that was my primary inspiration).

Finally, I intend to improve the Gruntfile further by defining concurrent tasks, adding a clean task and so on.

[1] https://github.com/nodeapps/http-server

[2] I've written both SCSS and LESS and enjoyed both. Going with LESS really came down to reducing time till first page preview.