Replace `@dual-bundle/import-meta-resolve` with `import-meta-resolve`
In PR #7532, we introduced the @dual-bundle/import-meta-resolve package to support both ESM and CJS, which is a fork of import-meta-resolve that is pure ESM.
When we switch to pure ESM (maybe in the next major version), we can replace @dual-bundle/import-meta-resolve with import-meta-resolve.
See also the code below:
https://github.com/stylelint/stylelint/blob/a211d8bb2bd2d4c5319852ef4fb35c83f1a82bc3/lib/utils/resolveSilent.mjs#L6-L7
[!NOTE] Node.js has provided the
import.meta.resolve()API, and we would like to use the API instead ofimport-meta-resolve, but it is still experimental. In addition, the--experimental-import-meta-resolveflag is necessary to use the second argumentparent(at the point of Node.js 21.7.1). So it may be difficult to switchimport.meta.resolve()in the next major version.
Upgrading to Node.js 22.0.0 and running Stylelint leads to (node:202332) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.. It comes from @dual-bundle/import-meta-resolve/lib/resolve.js:139:12. So replacing this package is important to also fix this (if the other one has already resolved that deprecation).
@boris-petrov I believe you're describing https://github.com/wooorm/import-meta-resolve/issues/27, right?
@JounQin yes. It's good there is an issue so hopefully it will be fixed at some point. :)
https://github.com/wooorm/import-meta-resolve/releases/tag/4.1.0 now resolved the deprecation warning.
@JounQin Could you merge the upstream change into @dual-bundle/import-meta-resolve, please?