🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

requirejs-common-wrap-middleware

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

requirejs-common-wrap-middleware

requirejs common wrap middleware

latest
Source
npmnpm
Version
0.1.5
Version published
Maintainers
1
Created
Source

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.

Keywords

requirejs

FAQs

Package last updated on 14 Apr 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts