How to create a Namespace before any other Code runs?

If I want to create a namespace like you do with WL, how can I achieve it if I want to add to it classes and stuff from different .js?
The main issue is that I need to create the namespace at the top, before my other components.

You don’t have to create the namespace before registering components as the init() etc will be called after the namespace definition. Check out how Sorskoot does it with game.js

I don’t need before the components, I need it before I add something to add
like if I do
var namespace = {};
namespace.stuff = class stuff {};
It’s ok, like you do for WL, but if they happen to be packed together as

namespace.stuff = class stuff {}; 
var namespace = {};

it will not work, or at least it is what’s happening to me right now

Ah, so you can’t put them both in the same file? Or run .stuff = in init() somewhere?
Or maybe in WL.onSceneLoaded ?

The fact is that I’m trying to use it as a namespace
so I’ve classes in different files
that’s why I can’t put it in the same file, nor in some init I guess
I’musing the namespace to avoid collision with names

So, Wonderland Engine will bundle the files in Order of appearance in the “Project Settings > Scripts” path list.
If you make sure to add the files in the right order, you should be able to get this to work as you want it