Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
RequireJS semver-compatible versioning plugin
JavaScript
tag: 0.0.1

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
test
@.js
LICENSE
README.md

README.md

RequireJS Version Plugin

  • Supports any semver ranges for module loading (~1.8, =1.8.1, >=0.5 < 2.0.5).
  • Loads multiple versions of a module only when absolutely necessary.
  • Optimizer support building only the minimum necessary versions for use.

Usage

  define(function(require) {
    var jquery = require('@!jquery#~1.8');
    var csmodule = require('@!cs!csmodule#>=2.0 <5');
  });

Setup

To allow versioning for a module moduleName, provide a version listing file at moduleName.versions.js, and then individual implementations of versions at moduleName-x.x.x.js.

For example, to provide jQuery versions:

jquery.versions.js:

  define(function() { 
    return ['1.8.0', '1.8.1'];
  });

We then provide the implementation files:

  jquery-1.8.0.js
  jquery-1.8.1.js
Something went wrong with that request. Please try again.