More information: http://sizzlejs.com/
In order to build Sizzle, you need to have Node.js/npm latest and git 1.7 or later.
(Earlier versions might work OK, but are not tested.)
Windows users have two options:
- Install msysgit (Full installer for official Git) and a binary version of Node.js. Make sure all two packages are installed to the same location (by default, this is C:\Program Files\Git).
- Install Cygwin (make sure you install the git and which packages), and a binary version of Node.js.
Mac OS users should install Xcode (comes on your Mac OS install DVD, or downloadable from
Apple's Xcode site) and
Homebrew. Once Homebrew is installed, run
brew install git to install git,
brew install node to install Node.js.
Linux/BSD users should use their appropriate package managers to install git and Node.js, or build from source if you swing that way. Easy-peasy.
First, clone a copy of the main Sizzle git repo by running:
git clone git://github.com/jquery/sizzle.git
Install the grunt-cli package so that you will have the correct version of grunt available from any project that needs it. This should be done as a global install:
npm install -g grunt-cli
Enter the Sizzle directory and install the Node dependencies, this time without specifying a global install:
cd sizzle && npm install
Make sure you have
grunt installed by testing:
The built version of Sizzle will be put in the
dist/ subdirectory, along with the minified copy and associated map file.
maketo pull down QUnit from github, which is the only thing the Makefile does.
- Open test/index.html in your browser to run the tests.
- The actual unit tests are in test/unit/selectors.js and test/unit/utilities.js.
gruntwill lint, build, test, and compare the sizes of the built files.
grunt jshintwill only lint sizzle.js and the tests.
grunt watchcan be run to re-lint, re-build, and re-test files as you change them.