Starter project with Angularjs Requirejs Bower Grunt and Bootstrap
First install dependencies:
$ npm install -g grunt-cli $ npm install -g bower $ npm install $ bower install
Now just open
index.html in your browser and let the magic happen!
We are using bower to handle all the dependencies, to add a new one you can run any of the following:
# registered package $ bower install jquery # GitHub shorthand $ bower install desandro/masonry # Git endpoint $ bower install git://github.com/user/package.git # URL $ bower install http://example.com/script.js
Once you are done, you need to update the routes in Requirejs for them to be available. Don't worry though, Grunt will do that for you, on the default task. Just run:
To test locally you develop the Angularjs app inside
app/ and the run
index.html in your browser.
Once you have something good going you can build it automatically with grunt:
$ grunt build
Behind the scenes grunt will:
- Delete the
- Minify and concatenate the app using Requirejs' optimizer
- Point the Requirejs script in
index.htmlto the built file
- Copy the
To test open
build/index.html in your browser.
At the moment the sample is configured to deploy itself to Github Pages, to deploy simply run:
$ grunt deploy
Other sites like heroku, openshift, or virtually anything could be easily configured, if you do so please send a pull request.
Some pending tasks/ideas I have for this sample app are:
- Multiple deploy options exposed as
$ grunt deploy <service>
- Functional Angularjs app with several views, providers...
- Non bootstrap option
- Make this into a Yeoman generator
- Add tests?
Developed by Alejandro U. Alvarez - MIT License