Requirejs using shim

前端 未结 2 1397
礼貌的吻别
礼貌的吻别 2020-12-20 15:35

Using shim by requirejs2, there is a way to tell to requires that a module is already loaded?

Example:



        
2条回答
  •  伪装坚强ぢ
    2020-12-20 16:06

    I am not sure if you were able to find the best approach yet for your use case. If you really - for some reason - need to add your other scripts without using RequireJS as in your code example @js999, then you would need to check if the global variable (jQuery, _) of those scripts exist and then define them as modules. From your code example it would look something like this:

    
    
    
    
    

提交回复
热议问题