nestjs / nest-cli

CLI tool for Nest applications 🍹
https://nestjs.com
Other
1.95k stars 389 forks source link

paths don't resolved when building with SWC #2611

Closed its-dibo closed 2 months ago

its-dibo commented 3 months ago

Is there an existing issue for this?

Current behavior

as mentioned in docs:

SWC builder is pre-configured to match the requirements of NestJS applications.

so, we mostly don't need to manually configure SWC. however, the default SWC configuration doesn't handle tsconfig paths.

Minimum reproduction code

.

Steps to reproduce

1- create a new NestJs project 2- add some paths to tsconfig 3- use any path alias in your code 4- build with SWC

Expected behavior

.

Package

Other package

No response

NestJS version

10.3.7

Packages versions

    "@nestjs/common": "^10.3.7",
    "@nestjs/config": "^3.2.2",
    "@nestjs/core": "^10.3.7",
    "@nestjs/jwt": "^10.2.0",
    "@nestjs/passport": "^10.0.3",
    "@nestjs/platform-express": "^10.3.7",
    "@nestjs/platform-fastify": "^10.3.7",
    "@nestjs/schedule": "^4.0.1",
    "@nestjs/swagger": "^7.3.1",
    "@nestjs/typeorm": "^10.0.2",

Node.js version

20.10.0

In which operating systems have you tested?

Other

No response

micalevisk commented 3 months ago

I'd say that this is a feature request than a bug report as handling tsconfig paths was never a thing IIRC

kamilmysliwiec commented 3 months ago

Please provide a minimum reproduction repository (Git repository/StackBlitz/CodeSandbox project).