AnsweredAssumed Answered

Fixing Dojo's and JQuery dependant libraries multipleDefine conflict via Javascript

Question asked by Eletrosul on Jul 6, 2018
Latest reply on Jul 13, 2018 by rscheitlin

This question has been answered many times before, and I know one solution is to simply change it so (Esri's)dojo is the last one to load.


Problem is I'm working on a modular widget that has no access to the page's html to change the order, I must only load libraries via Dojo's AMD Loader.


Folder structure :






This is the Widget.js file:


], function(Datatable){ ... }


And Datatable.js (just another module I created for organization) :

],function(){ ... }


I have two major issues here;


1) The AMD Loader is asynchronous and doesn't resolve non-AMD modules dependencies, meaning that order should be important for these libraries.


datatables.min.js requires bootstrap.bundle.js that requires jquery-3.3.1.min.js


So, If I'm lucky the request will load in order depending on latency, not reliable at all.


2) Both Bootstrap and Datatable generic javascript files raise a "multipleDefine" error, probably due to them trying to define "jquery", I'm really not sure how to fix this.


How can I resolve these 2 problems?