Allow custom alias paths
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 10.5k
- Forks
- 564
- PR merge metrics
- No merged PRs in 30d
Description
Feature Request
https://wxt.dev/guide/essentials/config/typescript.html#tsconfig-paths
https://wxt.dev/api/reference/wxt/interfaces/InlineConfig.html#alias
In generate-wxt-dir.ts > getTsConfigEntry, it creates paths using the following code
const paths = Object.entries(wxt.config.alias)
.flatMap(([alias, absolutePath]) => {
const aliasPath = getTsconfigPath(absolutePath);
return [
`"${alias}": ["${aliasPath}"]`,
`"${alias}/*": ["${aliasPath}/*"]`,
];
})
This doesn't work with the way our monorepo is setup, which uses something more like "${alias}/*": ["${aliasPath}/src/lib/*"]
It would be great to have more control over how the alias paths are created. In our case, it would be better to prevent adding the wildcard version so we could add our own
Is your feature request related to a bug?
N/A
What are the alternatives?
Not using the generated tsconfig.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in generate-wxt-dir.ts at getTsConfigEntry, then read the linked TypeScript paths and InlineConfig alias documentation. Determine how custom alias path generation should be configured, including omitting the wildcard mapping. Done means generated tsconfig paths support the requested monorepo layout without requiring users to avoid the generated tsconfig.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100