Subwaytime / vite-aliases

Alias auto generation for Vite
https://www.npmjs.com/package/vite-aliases
MIT License
213 stars 13 forks source link

`useTypescript: true` issue #24

Closed tsanyqudsi closed 3 years ago

tsanyqudsi commented 3 years ago

Hi,

I've noticed the problem when i use import object from '@path/component'. Apparently VS Code didn't recognize the module.

After i check, seems like your config generator forgot to add /* for every alias path. Thus we have errors on VS Code.

example : the path generated : "@components" : ["/home/foo/bar/components"] what should be generated : "@components/*" : ["/home/foo/bar/components/*"]

tsanyqudsi commented 3 years ago

oh and, could you prettify the config ? it gets minified with your script.

just a suggestion, maybe you could change

https://github.com/Subwaytime/vite-aliases/blob/89cae48760e4ca8a1aaa37054e0eb501fcc93abb/src/fs/config.ts#L30

to

 writeFile(`${file}`, JSON.stringify(data, null, 2), (error) => { 
Subwaytime commented 3 years ago

Sorry for the late Comment! Github doesnt show activity for me...

I will get it done today, thanks for the report!

Subwaytime commented 3 years ago

Fixed in v0.8.3