unplugin-auto-import
unplugin-auto-import copied to clipboard
Can not add path alias like "@" for local directory ts or js with auto import
Describe the bug
I have added local directories js like
dirs: [
"src/store/**",
"src/core/**",
"src/composables/**",
]
and it's generate auto import variable like
get this result
declare global {
const foo : typeof import('./core/services/foo')['default']
}
my except result
declare global {
const foo : typeof import('@/core/services/foo')['default']
}
I want to append path alias the "/core/service/foo". due to this limitation, auto imported "foo" fil is not worked on components folder or other folder.
I can modify the imported file path in unplugin-vue-component package by using "importPathTransform" callback.
is it possible to provide feature in "unplugin-auto-import".
Thanks in advance.
Reproduction
https://codesandbox.io/p/sandbox/vigilant-resonance-78stkp?file=%2Fsrc%2Fauto-import.d.ts%3A1%2C1
System Info
System:
OS: Window 11
CPU: (16) x64 Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
Memory: 5.11 GB / 62.72 GB
Container: Yes
Shell: 5.0.3 - git bash
Binaries:
Node: v18.16.0
npm: 9.5.1
Used Package Manager
npm
Validations
- [X] Follow our Code of Conduct
- [X] Read the Contributing Guide.
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
- [X] The provided reproduction is a minimal reproducible of the bug.
I also encountered this problem, is there any solution?
I want this!