(Custom Scripts) Managing the Order of Dependent Files

Hi …
I want to use an external JS library which consists of multiple JS files.
These files are dependents. As I understand from camunda docs

https://docs.camunda.org/manual/7.5/webapps/tasklist/configuration/#custom-scripts

There is no way to use shim config of requirejs

Is there any other way to solve this issue?

Hi,

I haven’t used it in a while but I actually think that you can use the requirejs shim option within the customScripts object (like most other requirejs options, as described in the docs).

it should look like:

var camTasklistConf = {
  // …
  customScripts: {
    // names of angular modules defined in your custom script files.
    // will be added to the 'cam.tasklist.custom' as dependencies
    ngDeps: ['my.custom.module'],

    // RequireJS modules to load.
    deps: ['custom-ng-module'],

    // RequreJS path definitions
    paths: {
      'custom-ng-module': '../custom-ng-module/script'
    },
   
    // and here you go...
    shim: {
       'backbone.layoutmanager': {
            deps: ['backbone']
            exports: 'Backbone.LayoutManager'
        }
    }
  }
};

Cheers

1 Like