Bower - RequireJS starter template
A RequireJS starter template with the Bower package manager for medium to large size projects.
Note: If you have no idea what this is, this short video will get you started: http://goo.gl/XIwt9
Tools that are used include:
- Bower for package management
- RequireJS for module loading/dependency management
- A bash file for deploying with the RequireJS optimizer and for some cleanup
Bower & RequireJS must be installed globally via NPM like so:
sudo npm install -g bower requirejs
Note: If you want to verify that they were installed, you can check via the following commands after restarting your Terminal/iTerm:
which bower #=> /usr/local/bin/bower which r.js #=> /usr/local/bin/r.js
directory:key in the
.bowerrcfile tells Bower where to install the project "packages"
component.jsonfile under the app's root directory tells Bower what dependencies our applicaiton has so we can install them all with one command like so:
bower install. By specifying
nullfor a version, we're asking for the latest version of that lib... I think!
The only srcipt tag that we add explicitly in the page is the following:
<script src="js/vendor/require.js" data-main="js/main.js"></script>
Make sure that the
build.sh file has the right permissions. If not change permissions with the following:
chmod +x build.sh
Once you're in the directory where the
.sh file is, run the build file like so: