This plugin extends WP Scripts class, adding some additional methods and filters that overload the output to add Require.js syntax.
It loads scripts via Require.js and by default defers until DOMContentLoaded event fires is called within the body and does not wait for DOM to be loaded..
This plugin is design to assist developers in updating and creating JavaScript that is asynchronous that is, scripts that can load in order and do not assume that their dependencies are available immediately.
Use of Asynchronous Module Definition allows script to define it's dependencies and have them loaded prior to the script or the initialization portion executes..
It's common for larger projects to concatenate together scripts however, they can end up jumbled mess and smaller required functions are often duplicated across multiple scripts.
As projects get larger and more diverse it's becoming more economical to load the individual components that are needed rather than download and execute one massive concatenated script file ..
Upload the plugin files to the wp-content plugins requirewp directory, or install the plugin through WordPress plugins screen directly..
In other cases, where scripts are not waiting, you may not be able to correct the issue or will require modification of the scripts ask the theme or plugin developer of the non-working plugin to update their scripts to work with AMD.
By default, RequireWP assumes all scripts are shims and will attempt to load them and their dependencies as such.
Browse the code, check out SVN repository, or subscribe to the development log by RSS...
Read more