You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using a serverless.ts config in a typescript project with tsconfig paths, the paths are not resolved by serverless framework during the requirement of serverless.ts
According to ts-node documentation (currently used for transpilling serverless.ts), it is required to use the package tsconfig-paths to resolve the paths option of ts config.
I came to the same conclusion - i opened a PR (serverless/serverless#8931) but it does impact the core serverless library, and i'm trying to write tests for handling when tsconfig-paths is and isn't available to be used
Use case description
Using a
serverless.ts
config in a typescript project with tsconfig paths, the paths are not resolved by serverless framework during the requirement ofserverless.ts
=>
Proposed solution
According to ts-node documentation (currently used for transpilling
serverless.ts
), it is required to use the package tsconfig-paths to resolve the paths option of ts config.IMHO, we should not require tsconfig-paths to load
serverless.ts
but we could first try to load it usingrequire("ts-node").register({ require: ["tsconfig-paths/register"] });
and fallback to the original code if not found: https://github.com/serverless/serverless/blob/5fa51dc53d039814aef80dd2a8c8069015215696/lib/configuration/read.js#L105WDYT ?
The text was updated successfully, but these errors were encountered: