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
In TS v5.5, there is a new template var ${configDir} in compilerOptions.paths definition see official doc
pathsToModuleNameMapper should handle it and replace this var with the correct path value.
I've read the code of the helper in src/config/paths-to-module-name-mapper.ts, it is already an if else soap so maybe adding a third parameter that would replace the templated string ${configDir} by the user provided string could be a basic solution. Although it could be tough to the user to provide the correct path at runtime.
A better solution would be finding the correct path to replace the templated string programmatically but without digging more in the code I didn't find a simple way to get the relative path of the config file path based on the root project directory.
would resolve @database as '^@database/(.*)$': '/path/to/monorepo/packages/package_1/prisma/$1' when loading from package_1/tsconfig.json.
I know it would be much more easier to just defined @database at tsconfig.json package level but unfortunately TS does not let extend the compilerOptions.paths property with the root one, it overwrites it...
The text was updated successfully, but these errors were encountered:
🚀 Feature Proposal
In TS v5.5, there is a new template var
${configDir}
incompilerOptions.paths
definition see official docpathsToModuleNameMapper
should handle it and replace this var with the correct path value.I've read the code of the helper in
src/config/paths-to-module-name-mapper.ts
, it is already an if else soap so maybe adding a third parameter that would replace the templated string${configDir}
by the user provided string could be a basic solution. Although it could be tough to the user to provide the correct path at runtime.A better solution would be finding the correct path to replace the templated string programmatically but without digging more in the code I didn't find a simple way to get the relative path of the config file path based on the root project directory.
Motivation
Keep being updated with TS standard
Example
The following project monorepo structure
with a defined tsconfig.base.json
would resolve
@database
as'^@database/(.*)$': '/path/to/monorepo/packages/package_1/prisma/$1'
when loading frompackage_1/tsconfig.json
.I know it would be much more easier to just defined
@database
attsconfig.json
package level but unfortunately TS does not let extend thecompilerOptions.paths
property with the root one, it overwrites it...The text was updated successfully, but these errors were encountered: