Interface RequireConfig

Index

Properties

Properties

optional public baseUrl?: string

optional public callback?: (...modules: any[]) => void

A function to pass to require that should be require after deps have been loaded.

param

optional public config?: { [id: string]: {}; }

AMD configurations, use module.config() to access in define() functions

(): {}

Returns

{}

optional public context?: string

A name to give to a loading context. This allows require.js to load multiple versions of modules in a page, as long as each top-level require call specifies a unique context string.

optional public deps?: Array<string>

An array of dependencies to load.

optional public enforceDefine?: boolean

If set to true, an error will be thrown if a script loads that does not call define() or have shim exports string value that can be checked.

optional public map?: { [id: string]: { [id: string]: string; }; }

For the given module prefix, instead of loading the module with the given ID, substitude a different module ID.

example

requirejs.config({ map: { 'some/newmodule': { 'foo': 'foo1.2' }, 'some/oldmodule': { 'foo': 'foo1.0' } } });

(): { [id: string]: string; }

Returns

{ [id: string]: string; }

optional public packages?: {}

Configures loading modules from CommonJS packages.

optional public paths?: { [key: string]: any; }

(): any

Returns

any

optional public scriptType?: string

Specify the value for the type="" attribute used for script tags inserted into the document by RequireJS. Default is "text/javascript". To use Firefox's JavasScript 1.8 features, use "text/javascript;version=1.8".

optional public shim?: { [key: string]: RequireShim; }

(): RequireShim

Returns

RequireShim

optional public urlArgs?: string

Extra query string arguments appended to URLs that RequireJS uses to fetch resources. Most useful to cachce bust when the browser or server is not configured correcty.

example

urlArgs: "bust= + (new Date()).getTime()

optional public waitSeconds?: number

The number of seconds to wait before giving up on loading a script. The default is 7 seconds.

optional public xhtml?: boolean

If set to true, document.createElementNS() will be used to create script elements.