Using Dojo 1.7.2
Beginner to Dojo, trying to make a simple custom widget.
I have created a module with this definition, as per the tutorials:
define(['dojo/_base/declare', 'dijit/_Widget', 'dijit/_Templated', 'dojo/text!./templates/groupNode.html'], ...
And am calling it like so:
require(['modules/groupNode', 'dojo/domReady!'], ...
My dojoConfig looks like this:
var dojoConfig = {
async: true,
baseUrl: "./",
packages: [
{ name: "dijit", location: "//ajax.googleapis.com/ajax/libs/dojo/1.7.2/dijit" },
{ name: "dojo", location: "//ajax.googleapis.com/ajax/libs/dojo/1.7.2/dojo" },
{ name: "modules", location: "modules" }
]
};
However, after the page has loaded, this module never finishes defining; when I examine the page source, I see that the script includes look like this:
<script type="text/javascript" charset="utf-8" src="modules/groupNode.js">
<script type="text/javascript" charset="utf-8" src="../dijit//_Widget.js">
<script type="text/javascript" charset="utf-8" src="../dijit//_Templated.js">
Clearly, the dijit modules didn’t compute the correct path, and aren’t loading correctly.
Other custom modules which only use dojo modules work correctly.
There are no errors logged in the console.
I have never used packages before within the configuration. I have always used modulePaths. Here is an example of configuring Dojo:
So this means that in the root of the web directory, there exists a child directory named modules and that is where your custom javascript exists.