Q:

Webpack not building after mapping paths in tsconfig

I tried mapping some of my paths in my tsconfig file by adding this:
"baseUrl": ".", // This must be specified if "paths" is.
"paths": {
  "@models/*": [ "ClientApp/app/models/*" ] // This mapping is relative to "baseUrl"
},

But when I build my project webpack throws a lot of errors and doesn't build. My errorlog looks like this:
[at-loader] Using typescript@2.5.3 from typescript and "tsconfig.json" from C:\Users\av427g\Documents\Visual Studio 2017\Projects\Sankini\Sankini\Sankini/tsconfig.json.

[at-loader] Using typescript@2.5.3 from typescript and "tsconfig.json" from C:\Users\av427g\Documents\Visual Studio 2017\Projects\Sankini\Sankini\Sankini/tsconfig.json.

[at-loader] Checking started in a separate process...

[at-loader] Ok, 0.214 sec.

[at-loader] Checking started in a separate process...

[at-loader] Ok, 0.185 sec.
Hash: 355ef8ecfe14a53528d4c53ed6ce1f3ab6fc27fb
Version: webpack 2.7.0
Child
    Hash: 355ef8ecfe14a53528d4
    Time: 22357ms
                 Asset     Size  Chunks                    Chunk Names
        main-client.js   907 kB       0  [emitted]  [big]  main-client
    main-client.js.map  1.03 MB       0  [emitted]         main-client

    ERROR in ./ClientApp/app/components/home/head/head-edit.component.ts
Module not found : error : Can't resolve '@models/HomeHeadDataModel' in 'C:\Users\av427g\Documents\Visual Studio 2017\Projects\Sankini\Sankini\Sankini\ClientApp\app\components\home\head'
     @ ./ClientApp/app/components/home/head/head-edit.component.ts 13:0-62
     @ ./ClientApp/app/components/home/home.module.ts
     @ ./ClientApp/app/app.module.shared.ts
     @ ./ClientApp/app/app.module.browser.ts
     @ ./ClientApp/boot.browser.ts

    ERROR in ./ClientApp/app/components/home/team/team-edit.component.ts
Module not found : error : Can't resolve '@models/HomeTeamDataModel' in 'C:\Users\av427g\Documents\Visual Studio 2017\Projects\Sankini\Sankini\Sankini\ClientApp\app\components\home\team'
     @ ./ClientApp/app/components/home/team/team-edit.component.ts 13:0-62
     @ ./ClientApp/app/components/home/home.module.ts
     @ ./ClientApp/app/app.module.shared.ts
     @ ./ClientApp/app/app.module.browser.ts
     @ ./ClientApp/boot.browser.ts
............

I don't get why it's doing this. As you see at-loader seems to load the correct tsconfig.json file, and my intellisense isn't throwing any errors. Only when building

A:

I hope it isn't too late, I've encountered the same problem and I wasted lots of time looking for a solution. The problem here is that webpack is not aware about your @models module resolution. What you should do is adding this to your webpack config:
resolve: {
    extensions: ['.ts', '.js'],
    alias: {
        '@models': "ClientApp/app/models"
    }
}

