-
-
Notifications
You must be signed in to change notification settings - Fork 64
Description
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 from config.source.tsconfigPath when we compose configs, it may be different from Rsbuild internal logic:
-
In DTS plugin ,we get
tsconfig.jsonfromconfig.source.tsconfigPaththat be processed by Rsbuild which is an absolute path with joinrootconfig in Rsbuild config orprocess.cwd() -
When we loading tsconfig.json in compose configs, we get raw value of
config.source.tsconfigPathfield which maybe a relative path without concating base dir. The root we now use is fromrootoptions in Rslib CLI or function params inbuildjavascript 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:
- cli load related config file
- no config mode (to be designed)
- cli params of config [Feature]: Support specify more config of
buildcommand #454 (to be designed) - js api load related config file (to be designed)