TypeScript: [Bug] TS doesn't detect webpack aliases?
From @Luchillo on July 13, 2016 19:20
- VSCode Version: 1.3.1
- OS Version: Ubuntu 15.10
Steps to Reproduce:
I have a webpack config with an alias for an import path, VSCode doesn’t recognize this, i’ve tried with
the tsconfig.json’s paths option:
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"emitDecoratorMetadata": true,
"experimentalDecorators": true
},
"filesGlob": [
"**/*.ts",
"!node_modules/**/*"
],
"exclude": [
"node_modules",
"typings/global",
"typings/global.d.ts"
],
"paths": {
"tao-animations": "app/theme/core/app.tao-animations.ts"
},
"compileOnSave": true,
"atom": {
"rewriteTsconfig": false
}
}
But it still doesn’t find the module even if webpack compiles ok:

Copied from original issue: Microsoft/vscode#9227
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 22 (6 by maintainers)
I have a similar problem with webpack module resolution.
Here’s the webpack config:
and
tsconfig.jsonIn a
.tsfile,import HelloWorld from '@/components/HelloWorld'triggers amodule not foundproblem on VSCode. Changing it toimport HelloWorld from '@/components/HelloWorld.vue'makes the error disappear.How to add module extension resolution to
tsconfig.json? I’ve not found anything related in the doc, nor in issues.Ok now it works, what happened was i had the
baseUrlproperty outside the compiler options, i think moving it to that section was the fix.