support yarn PnP
This release makes esmock compatible with yarn PnP. To do this, esmock is published with no dependencies and is instead bundled with resolvewithplus. Changes for this release,
- Changes the package-exported file to
esmock.js
fromesmockLoader.js
, a clerical change to make the "main" esmock file more obvious, - Embeds the resolvewithplus package inside esmock, so the published package will have no dependencies and will support yarn PnP, thanks @koshic
- Detects and uses import.meta.resolve, rather than resolvewithlus, when it is provided by the host environment. See flag
--experimental-import-meta-resolve
- Detects the presence of esmock's loader by using the loader directly. Previously, esmock tested process args with a regexp like this
/--(experimental-)?loader[=\s,"']*esmock/.test(process.argv)
. Directly using the loader is more precise and allows other scripts to wrap and use esmock in un-anticipated ways, credit @koshic