I want to have a bunch of TS/JS files around my src folder that should always be loaded/required/imported at startup without every programmer in the team have to worry to put them in some global "services.ts" file that is loaded at startup.
Traditionally I would have a services.ts file that gets imported in my index.ts or App.tsx
// src/services.ts
import "events/eventManager.service"
import "sentry/sentry.service"
import "fetch/retry.service"
By importing those files, they all perform some operations on module level (when they are loaded).
// index.ts
import "services"
I am looking now for a way that I can get rid of the src/services.ts file and its manual imports but instead have all the service files loaded already when index.ts get loaded.
I thought there might be some sort of babel mechanism to import files from src by a pattern src/**/*.service.ts that all get implicitly loaded before index.ts is loaded.
Or it builds up a virtual module services which I could then async import using await import("services") which would be fine too.