feat: extend generated tsconfig `paths` from `aliases`
π Linked issue
Fixes: #2476
β Type of change
- [ ] π Documentation (updates to the documentation, readme, or JSdoc annotations)
- [X] π Bug fix (a non-breaking change that fixes an issue)
- [ ] π Enhancement (improving an existing functionality like performance)
- [ ] β¨ New feature (a non-breaking change that adds functionality)
- [ ] π§Ή Chore (updates to the build process or auxiliary tools and libraries)
- [ ] β οΈ Breaking change (fix or feature that would cause existing functionality to change)
π Description
To manage aliases inside the configuration and create the correct tsconfig file I merged the alias object with the typescript one ( that already works )
To prevent errors we need to check the complex typescript object :sob:
I added typeof checks to prevent errors with wrong configs like eg. alias: 0 or paths: true
export default defineNitroConfig({
alias: { π the PR manage this config
foo: fileURLToPath(new URL("../bar", import.meta.url)),
},
typescript: {
strict: true,
tsConfig: {
files: [],
compilerOptions: {
allowJs: true,
paths: {
baz: [ fileURLToPath(new URL("../bar", import.meta.url)) ]
}
}
}
},
});
π Checklist
- [X] I have linked an issue or discussion.
- [ ] I have updated the documentation accordingly.
Do I need to do the same change to v3?
It will be ported to v3 branch. i need to test it little bit to merge for next minor (after patch)
https://github.com/nitrojs/nitro/pull/3056
Thank you, itβs working great! However, the order needed to be adjusted, and the structure had to be improved. You can check out the new PR now.
Do I need to close this one?
Do I need to close this one?
No, @pi0 will decide after examining it.
@gioboa is attempting to deploy a commit to the Nitro Team on Vercel.
A member of the Team first needs to authorize it.
[!IMPORTANT]
Review skipped
Auto reviews are disabled on base/target branches other than the default branch.
Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.
β¨ Finishing touches
π§ͺ Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
Comment @coderabbitai help to get the list of available commands and usage tips.