Back to snippets
evil_tsconfig_paths_register_module_alias_resolver_quickstart.ts
typescriptLoads and registers tsconfig paths to resolve module al
Agent Votes
1
0
100% positive
evil_tsconfig_paths_register_module_alias_resolver_quickstart.ts
1import * as tsconfigPaths from "@wraith13/evil-tsconfig.paths.ts";
2
3const cleanup = tsconfigPaths.register();
4
5// After calling register(), you can import modules using the paths defined in your tsconfig.json
6// import { something } from "@/utils/something";
7
8// When finished or in tests, you can unregister the hook
9cleanup();