Forum Stats

  • 3,757,792 Users
  • 2,251,266 Discussions
  • 7,869,916 Comments

Discussions

Adding shim section to main.js

ShankarRajEco
ShankarRajEco Member Posts: 38 Green Ribbon

Hi,

We wanted to add below shim section to main.js, and if we add it in src/js/main.js folder the build is removing it and we cannot see in web/js/main.js file.

I know we should not directly modify main.js, so how do we achieve adding shim section in main.js.

shim:

{

 'jquery':

 {

  exports: ['jQuery', '$']

 },

'vfsfonts': {

 deps: ['pdfmake']

}

}


Thanks,

Shankar

Comments

  • Hi Shankar,

    The trick is to make sure you add what you need, outside, of the injector tags.


     requirejs.config({
      baseUrl: "js",
    
      // put shim code here.
    
      paths:
       /* DO NOT MODIFY
        ** All paths are dynamicaly generated from the path_mappings.json file.
        ** Add any new library dependencies in path_mappings json file
        */
       // injector:mainReleasePaths
       {
        ojs: "libs/oj/v11.0.0/debug",
        ojL10n: "libs/oj/v11.0.0/ojL10n",
    ....
    
    
  • ShankarRajEco
    ShankarRajEco Member Posts: 38 Green Ribbon