ui5-community / ui5-community/babel-plugin-transform-modules-ui5
[FEATURE REQUEST] Support typescript path mapping
@petermuessig is already working on this.
Since Dec 6, 2024.
- Dominant language
- JavaScript
- Stars
- 33
- Forks
- 20
- Avg merge
- 3h 22m
- Merged PRs (30d)
- 1
Description
In tsconfig.json, it is possible to add a path mapping configuration like this.
{
"compilerOptions": {
"paths": {
"@/*": ["*"]
},
.......
}
}
It help to avoid writing deep relative import path. E.g. import { getMyUtility } from "@/utils"; instead of import { getMyUtility } from "../../../../utils";
But this feature is not supported by babel-plugin-transform-modules-ui5 at runtime when running ui5 serve on dev mode. The transpiled UI5 code resource treats such imports as an url path that contains '@/utils' and thus failed to load the resource.
It would be great to support path mapping for both dev mode and production bundling.
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.
Assessment
This issue has not been assessed yet.