Skip to content
This repository has been archived by the owner on Jun 14, 2020. It is now read-only.

Custom build

Craig Michael Thompson edited this page Sep 9, 2014 · 12 revisions

Custom build Adding and removing features using git

What you need

In order to build qTip2, you need to have Node.js 0.10.0 or later and grunt / grunt-cli 0.5 or later.

Installing Node.js

Head over to http://nodejs.org/ to grab the OS-specific installer for Node.js and the Node Package Manager.

Installing grunt

  1. Test that grunt-cli is installed globally by running grunt --version at the command-line.
  2. If grunt isn't installed globally, run npm install -g grunt-cli to install the latest version. You may need to run it using sudo.
  3. From the root directory of this project, run npm install to install the needed dependancies.

Checkout dependencies (git submodules)

  1. cd into the checked-out qTip2 directory
  2. Run git submodule init
  3. Then git submodule update
  4. Done!

Building qTip2

First, clone a copy of the main qTip2 git repo by running

git clone git://github.com/Craga89/qTip2.git

Then, in the main directory of the distribution (the one that this file is in), type the following to build qTip2 and its accompanying CSS:

grunt

You can also create each individually using these commands:

grunt clean	# Clean up the dist/ directory
grunt basic	# Build qTip2 with no plugins included
grunt css 	# Build CSS files
grunt all	# Build qTip2 twice, with no plugins and all plugins

To build and test the source code against JSHint/CSSLint, type this:

grunt dev

Finally, you can remove all the built files using the command:

grunt clean

Choosing features

By default qTip2 is built with all plugins enabled. You can see an example of this in the dist file. If you want more control over what plugins are included, you can do so by adding some extra parameters to your build commands.

For example, if you plan on using only the tips plugin, you'd specify the plugins variable as so:

grunt --plugins="tips" [command]

Notice the only thing that was added was the PLUGINS parameter. This tells the compiler which files to include in the final qTip2 build. You can specify multiple plugins by separating them with a space:

grunt --plugins="tips ajax viewport" [command]

By default all plugins are included in the build, so the regular [grunt all] command is actually equivilent to:

grunt --plugins="ajax viewport tips imagemap svg modal bgiframe" [command]