Skip to content

No support for Webpack resolve.alias  #5287

Closed
@andrii-oleksyshyn

Description

@andrii-oleksyshyn

Hello,

It's a copy of issue #5031, it was closed as already implemented but I couldn't manage to make it work.

Steps to reproduce:

I've added this to my tsconfig.json:

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

Path to the constants file: src/app/shared/constants/index.ts

When I import it as usual import { testConst } from './shared/constants/index';, it works fine:

But when I use absolute path, it crashes:
import { testConst } from 'shared/constants/index';

Webpack error:

ERROR in C:/Projects/myProject/UI/src/app/app.component.ts (2,27): Cannot find module 'shared/constants/index'.)
ERROR in ./src/app/app.component.ts
Module not found: Error: Can't resolve 'shared/constants/index' in 'C:\Projects\myProject\UI\src\app'

Could someone confirm that this feature works? Does it need additional config?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions