immich
immich copied to clipboard
refactor(server): drop module aliases
Using modules aliases can be convenient, but also make the build more complex and often frustrating to deal with. This PR replaces modules aliases with root path imports. This has several benefits, including:
- More transparency around where imports are coming from
- Less required configuration to integrate with other tools (like jest)
- Simpler migration path to ESM
Essentially the changeset comes down to removing tsconfig.paths settings and jestConfig.moduleNameMapper configuration by updating the following imports:
Before:
import {} from '@app/domain';
import {} from '@app/infra';
import {} from '@app/immich';
import {} from '@test';
After:
import {} from 'src/domain';
import {} from 'src/infra';
import {} from 'src/immich';
import {} from 'test';
TLDR is this is simpler and looks almost the same as before.