fix(create-rstack): drop node types from lib template src - #379
Conversation
Deploying rstack-cli with
|
| Latest commit: |
9f710e9
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://c8801506.rstack-cli.pages.dev |
| Branch Preview URL: | https://lib-src-drop-node-types.rstack-cli.pages.dev |
chenjiahan
left a comment
There was a problem hiding this comment.
Node types were added intentionally.
They allow app code to use process.env.NODE_ENV and process.env.PUBLIC_*, which Rsbuild replaces at build time. It also support process.env.* or Node globals or APIs in rstack.config.*.
namespace Rspack { interface Process { env: { [key: string]: any } } }
declare var process: NodeJS.Process;With
|
This reverts commit c5562c9.
With
nodeintypes,setTimeoutinsrcis typedNodeJS.Timeoutand leaks into the published.d.ts, forcing consumers to install@types/node; web app and component lib'ssrcis browser code and needs nothing from it, sonodestays only in the tests config.