Posts

Showing posts with the label Bower

Bower and Require.js Integration

In the past we've talked about Bower package manager and God knows, I have been obsessively repeating myself about using Require.js  and it's integration with object oriented programming . So how do they integrate with each other? In this article we'll cover the integration of both and see how they get along together. Bower Initiation Let's start by defining, which packages we want to use in our project by filling the bower.json . You can create one yourself or run bower init command for interactive creation. { "name": "RequireJS Starter", "version": "1.0.0", "dependencies": { "jquery": "1.9", "underscore": null, "requirejs": null } } So we'll be needing jQuery, Underscore and of course Require.js. Putting null as a version number will download the latest version. Now run bower install to download all the packages into bo...

What Is Bower And Why You Need It

So you've heard everyone talking about this mythical creature called Bower. But what exactly is it? Better to see once than to hear 100 times, so before we proceed any further take a peek at their  site . The problem Recall how you used to manage, and maybe still do, your 3rd party libraries. Firstly you went to their official site or maybe github repository. After finding the latest minified version, you would  get something like this - xxx-1.0.1.min.js, then  downloaded and saved it into your project. At last referencing it in the HTML would do the trick by copy pasting the script tag - <script src="//code.jquery.com/jquery-1.11.0.min.js">. But what would have happened if a new version came up? Well, if you were aware of the update, you would repeat the process again and put xxx-1.0.2.min.js in your library folder. Then you would change the reference in your HTMLs or JavaScript files. You could of course rename the file to xxx.js and omitting the version...