I am making an HTML5 game engine. There is only one file that is supposed to be included in the HTML file, which is engine.js. That script is supposed to create a global Engine object that can be used in other scripts by the user. The Engine object is a wrapper for all classes and functions in the engine, but, I would like to separate the engine into different files. I think that it would be a bit sloppy if the were all supposed to be included by the user, so how can I have the engine.js include the automatically?
(Something like require() in Node.js.)
Take a look at RequireJS. It is a library which fits your requirements.