I'm using custom build with included dojo/parser
and dojoConfig
option parseOnLoad: true
in HTML page. But when my page is loaded - parsing is not triggered. I've found workaround: add to dojoConfig
option deps: ["dojo/parser"]
. But it is not clear for me why I should use it if dojo/parser
is contained within my build.
问问题
309 次
1 回答
2
The fact that a module is contained in a built layer does not mean it needs not to be required. Indeed, while a layer contents the code of the modules it includes, the modules themselves will be fully resolved (ie their factory function called) when they will be explicitly required. That's why the deps option solves your issue: it just a shortcuts to a require call.
So, to summarize: load your layer AND require the modules (as you would do for the non-built version)
(Note that in sync mode, the dojo/parser module is automatically required).
于 2013-10-31T09:05:16.933 回答