fix: respect `resolve.preserveSymlinks` when resolving root (fix #23197) (#23198)