Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#13020 closed defect (invalid)

top-level ids shouldn't need a path mapping if they are children of baseUrl

Reported by: ben hockey Owned by: Rawld Gill
Priority: high Milestone: 1.7
Component: Loader Version: 1.6.1
Keywords: Cc:
Blocked By: Blocking:

Description

transferred from http://bugs.dojotoolkit.org/ticket/12672#comment:138

require({
    baseUrl: '/abs/path/to/base'
},
['init'], function (init) { 
    // ... 
});

tries to fetch 'init' from '/abs/path/to/init' but i think it should be 'abs/path/to/base/init'

adding a path mapping fixes it:

require({
	baseUrl: '/abs/path/to/base',
	paths: {
		init: 'init'
	}
},
['init'], function (init) { 
	// ... 
});

but i would have expected that this mapping wouldn't be necessary

Change History (2)

comment:1 Changed 8 years ago by Rawld Gill

Resolution: invalid
Status: newclosed

top-level modules are siblings to the dojo directory. baseUrl is assumed to be the dojo directory. So /abs/path/to/base is dojo, /abs/path/to/init is the sibling. This is expected behavior.

comment:2 Changed 8 years ago by ben hockey

this is unfortunately inconsistent with requirejs which imo uses a more intuitive approach. this is definitely a dojo-specific way to interpret baseUrl

Note: See TracTickets for help on using tickets.