require.resolve(…) takes a second optional options argument, instead of a second optional parent string argument.
This differs from what's been implemented in https://github.com/nodejs/node/pull/31032.
import.meta.resolve(…) and require.resolve(…) should both take a string and an options object, instead of one taking two strings and the other taking a string and an options object.
/cc @guybedford
@ExE-Boss the intent of the api is to make something that could also be implemented / standardized for browser use cases... so it is not using require.resolve as a reference API.
There is a discussion in the import maps proposal related to this. https://github.com/WICG/import-maps/issues/79
FWIW I'm not saying that we should or should not have an options argument, more pointing towards motivation for the existing API. Part of the reason it is behind a flag is to give us time to workshop and create something that can be cross platform
Most helpful comment
@ExE-Boss the intent of the api is to make something that could also be implemented / standardized for browser use cases... so it is not using
require.resolveas a reference API.There is a discussion in the import maps proposal related to this. https://github.com/WICG/import-maps/issues/79
FWIW I'm not saying that we should or should not have an options argument, more pointing towards motivation for the existing API. Part of the reason it is behind a flag is to give us time to workshop and create something that can be cross platform