Book Image

Learning less.js

Book Image

Learning less.js

Overview of this book

Table of Contents (22 chapters)
Learning Less.js
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Compiling the Bootstrap CSS and JavaScript


Now that we've seen how Bootstrap can be used to great effect in getting our site off the ground, we can well decide that we want to move away from simply using the precompiled CSS file and compile the code ourselves.

The main reason for doing this is to update or alter the code to fit our requirements—we should not forget that Bootstrap is intended to be customized in this manner! Fortunately, Bootstrap uses Grunt, which we discussed and installed earlier in the book (in Chapter 2, Building a Less Development Toolkit). Bootstrap comes preconfigured with its own package.json file, making compilation a cinch. All we have to do is:

  1. Fire up a command prompt window, and then navigate to the root of the /bootstrap folder and enter the following command:

    npm install
    

    This will automatically install all of the dependencies required to compile Bootstrap.

  2. In the same command window, enter the following:

    grunt
    

    This will run the JSHint and QUnit tests, and then...