ts-plugin / ts-plugin/ts-import-plugin
Ability to define a function to define the libraryDirectory or the import path of the component
@josejulio is already working on this.
Since Feb 10, 2021.
- Dominant language
- TypeScript
- Stars
- 603
- Forks
- 36
- Avg merge
- 1m
- Merged PRs (30d)
- 1
Description
I would like to define the library directory programatically. So this value would accept string | (lib: string, component: string) => string.
The use case is that the library I'm using splits into 3 folders, so depending on the requested element, this would change the path.
Ideally it would be something like:
...,
libraryDirectory: (libraryName, requiredComponent) => {
// do stuff
return 'dist/foobar/js';
},
....
This is something that I might be able to work on if @Brooooooklyn wants the feature in.
edit: Maybe also other configuration property and instead of returning the libraryDirectory it would return the full import path of the desired component, e.g.:
...,
componentImportPath: (libraryName, requiredComponent) => {
// do stuff
return 'dist/foobar/js/my_cool_component';
},
....
Contributor guide
No contributing guide indexed for this repository
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.