Possibility to restrict dynamic imports based on authentication

Right.. And seeing the source is what we are trying to avoid.

Ideally we’d have something like import("./some_module", { staffOnly: true }) which placed the import in some restricted area at compile time and checked the logged in user’s isStaff flag when it was requested. It probably brings along a whole host of other issues though, such as not being able to serve it using nginx anymore.