How can layabox build a reasonable directory structure?

I haven"t written Canvas h5 for too long. I"ve been doing page building recently. I feel that a good project is maintained and a reasonable directory structure is very important.

before writing canvas h5, all the method contents of createjs, are written in a js, which is very difficult to maintain. So I want to change to a powerful, well-documented engine to write, and take a fancy to layabox (I have also used cocos, to make small games that are too overqualified, and more often I am reading documents that I can"t understand)

so there is a problem, that is, for such a single-page application, how to do it with your directory structure, don"t put it all in one js.

ask layabox veteran players to show your directory structure and specific directory functions. Thank you!


just follow the official recommendation ( to create a JS project and explain the directory structure in detail ), right? Basically, the domain class code is enough in a js file. Maybe larger projects will divide files by module.


you have framework and object-oriented ideas. If you write too much, you will. Learn to quote each other correctly. Multi-use combination to structure, as much as possible to reuse all kinds of code, where copying and pasting code must be fishy. High cohesion and low coupling.

Menu