I’ve recently started playing with AngularJS. Coming from the Rails world I expected a structure enforced by the framework, good default configuration and separation into development, test and production environments.
It seems that the way to start a new project suggested by the creators of AngularJS is to clone angular-seed project. While this seed project worked for me during development and testing, I was a bit lost when it came to deploying to production.
Should I change this one line each time I make a deployment, then copy the files to my server and finally undo the change? Next thing – there is nothing said about minification in the README. As a fresh AngularJS developer I was quite disappointed that I wasn’t able to have my app up and running quickly.
Lineman.js enters the stage
Lineman.js provides a good structure for your client-side application and is opinionated about how you should run your commands. This means that Lineman.js makes a couple of decisions for me, which I won’t be able to make as a developer learning AngularJS.
Lineman.js takes care about development and testing stages, but does not forget about pushing code to production. It knows that you want your code to be concatenated and minified in production.
You can start with lineman-angular-template, which gives you some nice defaults such as:
- grunt-ngmin config, so you can write:
1 2 3 4
1 2 3 4
and your code will still be minified correctly
template precompilation with grunt-angular-templates so you can avoid making AJAX request for each template
Lineman.js is very easy to learn – start from its homepage. You can check my AngularJS toy project – classky which I built with Lineman.js. Everything worked out of the box and I cannot see any negative sides of using this tool. Recommended!