webpack rewrites every import as __webpack_require__(NNNN). yank hashes the module body using a normalized AST and looks it up against ~80k known npm package hashes. 8542 becomes react@18.3.1. Your output package.json is exact, not a guess.
__webpack_require__(NNNN)
8542
react@18.3.1