I am very grateful to Addi Osmani and Thomas Davis for publishing their examples and templates ( http://backbonetutorials.com/organizing-backbone-using-modules , https://github.com/addyosmani/backbone-aura ).
They really helped me get started.
I am currently developing a large web application. Therefore, I have many components, for example, address management, date management, todos. Each component fills all the space in my application (with the exception of the menu bar). For each selection of a new component in the menu, a transition to the page is required.
In the beginning I took the file structure, the template used by the above tutorials (giving all the views of the "views" directory). But as more components were added, placing all kinds in one view became confusing for me. Even creating subdirectories would not be a solution, because in this file structure I lost information whose presentation is associated with which model.
So, I was looking for another solution and found requirejs amd packages ( http://requirejs.org/docs/api.html#packages ). This helped me a lot, since all modules belonging to one component (models, collections, views) were in the same directory. Because postfix each model using the "Model" (etc.), Things that are enough for me are enough.
Now to the question: I am at the preparation stage. I was not going to build and combine things for the deployment of production. But now I want to try the requirejs optimizer. I read the page " http://requirejs.org/docs/optimization.html from James Burke. But not everything is clear to me.
I want the following: I have these package directories. All amd modules (views, models, collections) from one package directory should be combined into one file, but their dependencies should not be included, since many of these external package dependencies are loaded separately at the beginning.
Is there anyone with the same or similar requirements who has already taken this step and can give some clues.
Many thanks
Wolfgang