You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unfortunately, there is a third parameter to resolveId that @rollup/plugin-node-resolve (and @rollup/plugin-commonjs) depends upon, which you do not pass along. It is encodes whether we are resolving an entry point and additional custom plugin options which for the node-resolve plugin encode if we are resolving an import or a require. Depending on the package, this can lead to different (and wrong) resolutions.
Hi!
While debugging rollup/plugins#1038 (comment), I stumbled upon an issue with your rollup plugin implementation. Basically you are doing this:
Unfortunately, there is a third parameter to
resolveId
that@rollup/plugin-node-resolve
(and@rollup/plugin-commonjs
) depends upon, which you do not pass along. It is encodes whether we are resolving an entry point and additional custom plugin options which for the node-resolve plugin encode if we are resolving animport
or arequire
. Depending on the package, this can lead to different (and wrong) resolutions.See https://rollupjs.org/guide/en/#resolveid including the first example there, as well as https://rollupjs.org/guide/en/#custom-resolver-options for how custom options work, and why it is important for plugins to forward them.
The solution can be as simple as
I would strongly advise to update your implementation to support this.
The text was updated successfully, but these errors were encountered: