You can specify those exports in package.json.
{
"exports": "dist/index.js"
}
or {
"exports": {
".": "dist/index.js",
"./*": "dist/*.js"
}
}
https://nodejs.org/api/packages.html#subpath-exportsMany packages do this.