README.md

Mobify.js

Mobify.js is an open source library for improving responsive sites
by providing responsive images, JS/CSS optimization, Adaptive
Templating and more. Mobify.js also provides a
"Capturing" API for manipulating the DOM before any resources have
loaded, giving developers the ability to enable the listed features above
without changing any backend markup.

For instructions on how to use the library, follow the instructions on mobifyjs.com
or build the docs site manually in the instructions below.

Development

Building

Mobify.js uses Grunt.js and Require.js to build the library, and manage all of the dependancies. First, you will need to install the grunt-cli globally:

npm install -g grunt-cli

And then download the latest code from git and install the dependancies:

Build Setup

src/mobify-library.js # Defines how to build the full mobify.js library

There is also an example custom build file to make it simple to build a custom
mobify.js library (or to compile the library with executable code):

mobify-custom.js.example

To create a custom build, run the following:

`cp mobify-custom.js.example mobify-custom.js`

Then, run grunt serve as normal. The output of the custom build will be
located in build/custom.

Note: We use a mobifyjs symlink to resolve paths so they can be the same
locally as they are on the CDN. This can be problematic for Windows.

Tests

Tests for Mobify.js are written in QUnit. To run them individually, run
grunt serve and then go to http://localhost:3000/tests/capture.html
or any other of the QUnit tests in the /tests/ folder.

To run all of the tests in an automated fashion using Phantomjs
(the headless webkit browser) run the following command:

grunt test

It's also important when developing not to run into any regressions on all of the
supported browsers. The Gruntfile is setup to be able to run qunit tests
on many browsers we support (in order to do this yourself, you will need a
Saucelabs Connect username and key).