0.1.5 • Published 10 years ago

requirejs-common-wrap-middleware v0.1.5

Weekly downloads
32
License
-
Repository
github
Last release
10 years ago

RequireJS commonJS wrap middleware

Easiest way to share your modules between server and client side

Usage

Sample config

var config = {
  	baseUrl: '/js/',
	basePath: 'static/js/',
	modules: {
		'your/module/url': {
			path: 'path/to/module'
		},
		// example with dependencies mapping
		'your/another/module/url': {
			path: 'path/to/another/module',
			dependenciesMap: {
				'original/dependency/path': 'new/dependency/url'
			}
		}
	}
};

As a middleware

var app = express.createServer();
app.use(require('requirejs-common-wrap-middleware').wrapper(config));

for production at a build script:

require('requirejs-common-wrap-middleware').builder(config);

You can use the same config for wrapper and builder, but wrapper does not use basePath option, in opposite, builder does not use baseUrl option, but use basePath.

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

11 years ago

0.1.2

12 years ago

0.1.1

13 years ago

0.1.0

13 years ago