Monday 31 May 2021

How to load an existing custom lib which is having non AMD and AMD library using requireJS

In my project there is custom third party library (a single build file) , which they have created using couple of non AMD and AMD files. And most of the properties are exposed directly to window object. In our project as per new requirement we have to load this third party library in asynchronous mode using requireJS. I tried with shim configuration but am getting error from third party library saying that globals/window, globals/documents are needed.

  1. How to resolve the above error in current project without editing third party library ? is it possible ?
  2. How to consume this third party libs properties in the project, since all properties are exposed directly to window Object.

This is the error we are encountering now

enter image description here

Could anyone please help me on this ?



from How to load an existing custom lib which is having non AMD and AMD library using requireJS

No comments:

Post a Comment