back to Overview

require()

Returns a reference to a module.
Available in all modules.

Syntax

require(name)

Parameters

name
the name of the module to request. Minified is available as 'minified'.
(return value)
the reference to the module. Use the name 'minified' to get Minified. You can also access any modules defined using define(). If the name is unknown, it returns undefined.

Description

Returns a reference to a module. If you do not use an AMD loader to load Minified, just call require() with the argument 'minified' to get a reference to Minified. You can also access all modules defined using define().

If you do use an AMD loader, Minified will not define this function and you can use the AMD loader to obtain the reference to Minified. Minified's version of require is very simple and will only support Minified and other libraries designed for Minfied, but no real AMD libraries. If you need to work with libraries requiring AMD, you need a real AMD loader.

See also..

  • define() allows you to define modules that can be obtained using require().

Comments

comments powered by Disqus

back to Overview

Functions