You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using dependName will be found dependence from global scope or from YModules and this dependence will be add to bh.lib.
In bundle file will be as follows:
// For global scopebh.lib.bhLibName=dependName;// For YModulesmodules.define('bh',['dependName'],function(provide,bhLibName){bh.lib.bhLibName=bhLibName;});
Shortcomings
Is impossible specify a name for global scope and the other for the modular system.
Is impossible get the module using CommonJS.
Problem Solution
{requires: {bhLibName: {globals: 'dependName',// var name from global scopeym: 'depend-name',// module name from YModulescommonJS: 'path/to/module',// relative path to CommonJS module from target}}}
In bundle file will be as follows:
// For global scopebh.lib.bhLibName=dependName;// For YModulesmodules.define('bh',['depend-name'],function(provide,bhLibName){bh.lib.bhLibName=bhLibName;});// For CommonJSbh.lib.bhLibName=require('path/to/module');
If you want to get the dependency from the global scope for all modular systems:
{requires: {bhLibName: {globals: 'dependName'// var name from global scope}}}
In bundle file will be as follows:
// For global scopebh.lib.bhLibName=dependName;// For YModulesmodules.define('bh',function(provide){bh.lib.bhLibName=dependName;});// For CommonJSbh.lib.bhLibName=dependName;
The text was updated successfully, but these errors were encountered:
Now we can use
dependencies
option:Using
dependName
will be found dependence from global scope or from YModules and this dependence will be add tobh.lib
.In bundle file will be as follows:
Shortcomings
Problem Solution
In bundle file will be as follows:
If you want to get the dependency from the global scope for all modular systems:
In bundle file will be as follows:
The text was updated successfully, but these errors were encountered: