Skip to content

TypeScript path aliasses #865

@Pidz-b

Description

@Pidz-b

🚀 Feature Request

Affected Languages

  • TypeScript or Javascript
  • Python
  • Java
  • .NET (C#, F#, ...)

General Information

  • JSII Version: AWS CDK 1.11.0 (build 4ed4d96)
  • Platform: Linux 5.2.11-1-MANJARO

What is the problem?

When running cdk deploy or cdk synth, a path alias defined in in tsconfig.json is not resolved to the correct path.

I have all my CDK code in a folder named <project root>/infra/
In one of my files I import a custom file that abstracts our naming:

import { NameGen } from '@infra/lib/NameGen';

The tsconfig.json paths look like:

{
  "compilerOptions": {
    "paths": {
      "@infra/*": ["infra/*"],
      ....
}

When running CDK, the following error is thrown: Cannot find module '@infra/lib/NameGen'


Apparently JSII does not resolve the path aliasing of the tsconfig correctly?

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/largeLarge work item – several weeks of effortfeature-requestA feature should be added or improved.module/toolsIssues related to the JSII toolkitp2styleIssues related to coding style

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions