Opened 4 years ago

Closed 4 years ago

#18633 closed defect (invalid)

Dojo Loader - JQuery AMD

Reported by: sivajankumaran Owned by: Rawld Gill
Priority: undecided Milestone: tbd
Component: Loader Version: 1.10.4
Keywords: Cc:
Blocked By: Blocking:

Description

Hi,

I am trying to use the Dojo loader and dojoConfig to load up Jquery AMD library.

Jquery is loaded in:

jquery

/ jquery.js

In the dojoConfig I have the following:

packages: [

{ name: "jquery", location: "jquery" }]

If I use the require statement:

require([

'jquery/jquery'

], function(jquery) { }

);

Then the jquery library does not get loaded correctly.

However If I add the main property in the dojoConfig to main: "jquery" as follows:

packages: [

{ name: "jquery", location: "jquery", main: "jquery" }]

Then change the require to

require([

'jquery'

], function(jquery) { }

);

it works. I don't understand why I need to add the main: "jquery" as I have specified the module in the require as 'jquery/jquery'.

Thanks Sivajan

Change History (1)

comment:1 Changed 4 years ago by dylan

Resolution: invalid
Status: newclosed

The short answer is, this is how AMD works.

Think about how you include modules in Dojo. You don't typically require dojo/dojo, you require dojo/someModule. By default, the Dojo loader automatically includes dojo/dojo which is defined as main for the dojo package.

Note: See TracTickets for help on using tickets.