-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Q: How to support vscode resolution? #19
Comments
Sorry for the duplication: #9 |
You can try to use |
Same question |
@Rush Have you tried to use |
No but I know it can't work. Also, I'm working on a project with a pre
existing config.
|
When in Node and when having the aliases set in package.json, it also runs
It can not work in vscode because there might be another require/CommonJS implementation, never tried, but you can try to do as I suggested |
If you are writing typescript, then add your module aliases as short imports in tsconfig, no more complaining from vs code and also auto importing(auto complete) will work as expected |
Hey y'all. I built an alternative. https://www.npmjs.com/package/link-module-alias I'm using it currently in a project alongside |
One of my colleagues uses this to support aliases in vscode. Never tried myself but it works for him // .vscode/settings.json
{
"path-autocomplete.pathMappings": {
"@": "${folder}/src",
"assets": "${folder}/src/assets"
}
} |
@Rush Thanks, I'm using your package instead! It works well and VSCode auto completes the folders and files. |
@jplew I'm glad it solves your issues. Please take note of this caveat but otherwise do enjoy. |
Simple way to do this with a In your
In
Basically, you can add the baseUrl as your local path, and copy over your aliases into the paths section. For each alias, you have to add It's a little extra work every time you want to add an alias, but it works really well, no extra extension required, and I'm using it now. If there were a way to make this happen automatically (update the paths value when you update the aliases in |
Can confirm this works! |
Hey, I had this problem |
Same here, can't go to file using CTRL+CLICK on imports in viscose using module aliases :( |
In case someone still has issues with a typescript project, this what I did to make it work:
"_moduleAliases": {
"@app": "src/app",
"@commons": "src/commons"
}
{
"compilerOptions": {
"paths": {
"@app/*": ["./src/app/*"],
"@commons/*": ["./src/commons/*"],
}
}
|
@SergioSuarezDev this worked for me. I just restarted the TS server like @sescotti mentioned |
microsoft/vscode#14907
A
jsconfig.json
won't work for me, any idea?The text was updated successfully, but these errors were encountered: