Commit Graph

1 Commits (24ed8da48ee11b0d4130f1c71a448db59c83f607)

Author SHA1 Message Date
Daniele Belardi 8f87d252fa esm: improve commonjs hint on module not found
Run CommonJS resolver only if `error.code` is ERR_MODULE_NOT_FOUND.
Avoid using absolute paths in hint by:
* using a parent-relative path if the specifier is a relative path
* using a `pkg/x.js` format if the specifier is bare (e.g. `pkg/x`)

PR-URL: https://github.com/nodejs/node/pull/31906
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
2020-05-03 11:29:09 -07:00