refactor: use JSON import attributes instead of readFileSync in constants (#23258)