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 DTS plugin ,we get tsconfig.json from config.source.tsconfigPath that be processed by Rsbuild which is an absolute path with join root config in Rsbuild config or process.cwd()
When we loading tsconfig.json in compose configs, we get raw value of config.source.tsconfigPath field which maybe a relative path without concating base dir. The root we now use is from root options in Rslib CLI or function params in build javascript api.
We can pass absolute tsconfigPath to Rsbuild with concat our root base to preventing users config root in Rsbuild config to influence the tsconfigPath value in DTS.
What problem does this feature solve?
We should unify the logic of loading Rslib config file / package.json / tsconfig.json in javascript-api and CLI to avoid passing root param.
When we read
tsconfig.json
fromconfig.source.tsconfigPath
when we compose configs, it may be different from Rsbuild internal logic:https://github.com/web-infra-dev/rsbuild/blob/660af78835597f486ea06b1c9baf87ad1bc795df/packages/core/src/createContext.ts#L189-L192
In DTS plugin ,we get
tsconfig.json
fromconfig.source.tsconfigPath
that be processed by Rsbuild which is an absolute path with joinroot
config in Rsbuild config orprocess.cwd()
When we loading tsconfig.json in compose configs, we get raw value of
config.source.tsconfigPath
field which maybe a relative path without concating base dir. The root we now use is fromroot
options in Rslib CLI or function params inbuild
javascript api.We can pass absolute tsconfigPath to Rsbuild with concat our root base to preventing users config
root
in Rsbuild config to influence the tsconfigPath value in DTS.We should handle root well in these situations:
build
command #454 (to be designed)What does the proposed API look like?
The text was updated successfully, but these errors were encountered: