Configure your project to use path aliases in your toolchain
It's a couple of simple steps to get up and running with Alias HQ:
More experienced TypeScript users may prefer to do this manually – as summarised in the project's readme.
Or you may prefer to let the Alias CLI take the strain:
This interactive session of questions and prompts lets you:
- configure your paths and aliases for the first time
- integrate with tools like Webpack, Jest, etc
- update your project's source code
Open the terminal at your project root, type the following:
alias-hq
If you have any issues, check the troubleshooting section.
Once up and running, follow the steps below.
Visit Configure paths for full docs
If you don't yet have a ts/jsconfig.json
file:
- Choose "Configure paths > Create config"
- Choose "JavaScript" or "TypeScript" as required
- Choose to save the file
To add or update paths in your config file:
- Choose "Configure paths > Update config"
- Choose your "Base URL"
- Choose "Folders" by typing relative paths, or dragging in folders from Finder / Explorer
- Choose an "Alias prefix"
- Choose to save the config
Visit Setup integrations for full docs
To set up tooling or frameworks like Webpack and Jest:
- Choose "Setup integrations > Setup integration"
- Choose an integration from the list
- Follow the instructions
If you want to do this manually, see the Integrations document
Visit Update source code for full docs
To update source code with your new aliases:
- Choose "Update source code"
- Choose "Configure options"
- Type the relative paths of the folders you want to update
- Choose any module roots from the list
- Choose to "Preview updates" or "Update files"