-
Notifications
You must be signed in to change notification settings - Fork 27
Flags and plugins
Mikhail Davydov edited this page Mar 2, 2014
·
7 revisions
config | default | description | example | source |
---|---|---|---|---|
async |
false | Provides require.async() function. Requires external module that is out of bundle. If modules uses external modules set this to true. |
demo, code | async.js |
async_plain |
false | This is option of async . It enables async require of both CommonJS modules and function-modules |
||
async_plainonly |
false | This is option of async . If you are using only plain CommonJS modules enable that flag instead of async_plain . |
demo, code | |
preload |
false | Provides require.preload() function. This plugins is similar to async , it only caches modules without executing them. |
demo, code | preload.js |
preload_plain |
false | same as async_plain
|
||
preload_plainonly |
false | same as async_plainonly
|
config | default | description | example | source |
---|---|---|---|---|
cache |
false | It stores all application lmd itself + all modules in localStorage this flag will force all modules to be lazy. | demo, code | cache.js |
cache_async |
false | It enables localStorage cache for require.async()
|
demo, code | cache_async.js |
config | default | description | example | source |
---|---|---|---|---|
js |
false | Provides require.js() . Simple loaded for all javascripts. It works like $.getScript() . |
demo, code | js.js |
css |
false | Provides require.css() . CSS loader. |
demo, code | css.js |
image |
false | Provides require.image() . Image (pre)loader. |
demo, code | image.js |
config | default | description | example | source |
---|---|---|---|---|
race |
false | set true if you are loading the same resources simultaneously | race.js | |
parallel |
false | enables simultaneous loading require.js([a, b, c], ..) resources will be executed in load order! And passed to callback in list order. |
demo, code | parallel.js |
promise |
false | Enables promise interface for all loaders require.js('a.js').then() . Value should be a string with path to promise constructor e.g. "$.Deferred"
|
demo, code | promise.js |
config | default | description | example | source |
---|---|---|---|---|
worker |
false | set true if LMD package will run as worker | ||
node |
false | set true if LMD package will run as Node.js script. | demo, code | node.js |
ie |
true | set false if script will run only in modern browsers | ie.js | |
opera_mobile |
false | set true if LMD package will run in Opera Mobile |
config | default | description | example | source |
---|---|---|---|---|
shortcuts |
false | It enables shortcuts/simlinks/synonyms for modules in LMD package. | demo, code | shortcuts.js |
amd |
false | It enables AMD RequreJS modules in LMD package. | demo, code | amd.js |
config | default | description | example | source |
---|---|---|---|---|
match |
false | Provides require.match(RegExp): Object It requires every matched module |
demo, code | match.js |
config | default | description | example | source |
---|---|---|---|---|
stats |
false | It enables require.stats() function - every module require, load, eval, call statistics. |
demo, code | stats.js |
stats_coverage |
false | It enables code coverage for all in-package modules, you can use list of module names to cover only modules in that list. | demo, code | stats_coverage.js |
stats_coverage_async |
false | enables code coverage for all off-package function-modules for that option you can NOT use list of off-package module names. This options is VERY HEAVY +50Kb sources. Each async LMD module will be parsed and patched on the client - it may take A LOT of time | stats_coverage_async.js | |
stats_sendto |
false | It provides require.stats.sendTo(host[, reportName]) function. It POSTs stats&coverage report to specified stats server. |
stats_sendto.js |
config | default | description | example | source |
---|---|---|---|---|
optimize |
false | It will generate optimized version of all own plugins, but not your modules. | ||
pack |
false | It will minify all scripts using UglifyJS 1.x. It enables optimize . |
||
pack_options |
{} | Options of pack . Should be an object. More info
|
||
lazy |
false | Enables lazy interpretation of all modules. Modules will be turned into string and evaled on demand. |
config | default | description | example | source |
---|---|---|---|---|
mixins |
[] | List of lmd configs to be mixed with current. You can mix your build configs (eg lmd build index+ru+dev ) to create your special builds. |
demo, code | |
depends |
false | Property that enables dependencies lookup for each module. You can notify LMD by adding global "depends" parameter or specify "depends" for each module. Can be true or mask string e.g. "*.lmd.json" | demo, code | |
extends |
false | Configs can inherit from another configs (eg development extends production). Should be a path string to another lmd config e.g "prod.lmd.json"
|
demo, code |