typestack / routing-controllers

Create structured, declarative and beautifully organized class-based controllers with heavy decorators usage in Express / Koa using TypeScript and Routing Controllers Framework.
MIT License
4.4k stars 391 forks source link

fix: disable sourceMap in NPM package #1429

Open tanghongxin opened 1 month ago

tanghongxin commented 1 month ago

Description

When I am debugging my own TS project, if source-map is enabled, the stack information points to some non-existent files.

Minimal code-snippet showcasing the problem

tsc
node --enable-source-maps bundle/index.js

Expected behavior

The stack track the correct file.

Actual behavior

The source files pointed by source-map does not exist becasue they are not published on NPM at all, like this:

Error
    at HttpError (my-project/node_modules/src/http-error/HttpError.ts:16:18)
    at BadRequestError (my-project/node_modules/src/http-error/BadRequestError.ts:10:5)
    at InvalidParamError (my-project/node_modules/src/error/ParamNormalizationError.ts:10:5)
    at ActionParameterHandler.normalizeStringValue (my-project/node_modules/src/ActionParameterHandler.ts:167:17)
    at ActionParameterHandler.normalizeParamValue (my-project/node_modules/src/ActionParameterHandler.ts:136:40)
    at <anonymous> (my-project/node_modules/src/ActionParameterHandler.ts:117:39)
image