Typescript path aliases don't update until I restart
I have a tsconfig.json for my angular application with path aliases like this
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"paths": {
"@shared": ["src/app/shared/"],
"@lib": ["src/app/shared/lib/"]
},
"allowSyntheticDefaultImports": true,
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"module": "es2015",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"downlevelIteration": true,
"target": "es5",
"typeRoots": ["node_modules/@types"],
"lib": ["es2017", "dom"],
}
}
Webstorm gives me an error "module not found" until I restart, then it recognizes the path entered in the tsconfig. Although the path resolves, new import suggestions don't give the alias as a suggestion.
Please sign in to leave a comment.
Instead of restarting the IDE, try restarting the service using Restart TypeScript Service button in Typescript tool window toolbar: