2

Hey so I'm finding the documentation around building dojo a little hazy around layers.

For my Dojo 1.7+ application I would like a layer that contains only Dojo, and a layer that only contains my code, so I can place the appropriate copyright/license headers at the top.

Looking at build profile template, I see:

layers : {
    "dojo/dojo":{
        include:["dojo/dojo","dojo/i18n","dojo/ready","dojo/domReady"]
    },
    "myapp/core":{
        include:["myapp/core/module1","myapp/core/module2","myapp/core/module3"],
        exclude:["dojo/dojo"]
    }
}

But when I look inside my 'myapp/core' layer js file I see lots of occurrences of

'define("dojo*'.

I started tackling this by finding each occurrence of the dojo define and putting that in the dojo/dojo layer include list, but that doesn't seem like the appropriate way of doing layers, is it? At the very least can't I just include certain packages? Am I making a big misunderstanding here?

Bonus it seems like the layer property 'copyrightFile' no longer works. Has that been deprecated, or changed?

Thanks

Charles
  • 50,943
  • 13
  • 104
  • 142
Andrew Daniel
  • 688
  • 1
  • 5
  • 7

1 Answers1

2

Are all these ("dojo/i18n","dojo/ready","dojo/domReady") dependencies the only dependencies that your external modules need? If myapp/core/module2 requires a dojo module that is not included in the dojo core layer, then it will be included in the myapp/core layer.

I have gone down the path you are going found it difficult to maintain the separation of code over time. I would create a single layer with both dojo and your code.

Use a layer to encapsulate code that is for specific area of functionality. For example, I have a graphical workflow editor that has it's own layer because it includes a bunch of svg code that doesn't need to be present in the rest of the application.

Craig Swing
  • 8,152
  • 2
  • 30
  • 43
  • Thanks, I think I have no choice but to build a layer by function rather than by 'package'. My external modules use a lot of Dojo/dijit/dojox modules (quite a big list actually) and I was hoping to just have a layer of dojo and a layer of my stuff. – Andrew Daniel Jun 25 '13 at 14:21