Make VS code read webpack.config and recognize path with alias?

前端 未结 4 822
轻奢々
轻奢々 2020-12-14 00:08

I\'m working with Webpack and Visual Studio Code and in order to avoid things like:

import { AuthenticationService } from \'../../../services/authentication/         


        
4条回答
  •  北海茫月
    2020-12-14 00:47

    update typescript@2.0.0 and you can map the same webpack aliases on tsconfig.json by adding:

    "compilerOptions": {
        "baseUrl": "./",
        "paths": {
          "app/*": ["src/app/*"]
        }
    }
    

提交回复
热议问题