chore: add Node-agnostic utils#15846
Conversation
|
|
Making this a draft because after re-examining why we need this, we could instead make it so that we resolve the paths outside the environment then communicate them back to the environment. EDIT: might not be worth doing that just for some path resolving actually. We also still need |
| try { | ||
| const path = await import('node:path'); | ||
|
|
||
| relative = (file) => path.relative('.', file); |
There was a problem hiding this comment.
This was always supposed to use the Vite root setting rather than '.' which is the same as process.cwd(). I just couldn't figure out how to pass the root setting here until now
splitting out changes from #15574
This PR creates and moves some utils to be Node-agnostic so that we can use them to resolve paths in the dev environment
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm testand lint the project withpnpm lintandpnpm checkChangesets
pnpm changesetand following the prompts. Changesets that add features should beminorand those that fix bugs should bepatch. Please prefix changeset messages withfeat:,fix:, orchore:.Edits