rollup/rollup-plugin-node-resolve

mainFields funny behaviour

sormy opened this issue · 4 comments

sormy commented

jsnext/main/module are deprecated

attempt to use { jsnext: true } causes

node-resolve: setting options.jsnext is deprecated, please override options.mainFields instead

attempt to use { mainFields: ["jsnext"] } causes exception:

throw new Error(`node-resolve: do not use deprecated 'module', 'main', 'jsnext' options with 'mainFields'`);

I would vote to revert this mainFields PR and send on rework to original author.

I would vote to revert this mainFields PR and send on rework to original author

Thank you for bringing up this issue but please avoid the snarky comments unless you also want to vote for yourself to become active maintainer of this plugin. Which is an option I would very much welcome as this open source project is, like most other open source project, terribly understaffed.

Nevertheless I will have a look.

Note though that jsnext is a rather uncommon choice for this option as you probably want to use jsnext:main instead. Which is why this case was probably not tested.

Actually your issue should be just what is written in the error: You are using BOTH the mainFields option and one of the other options together. Remove the other options.

sormy commented

I'm apologize. Did not want to offense anybody.

But anyway, thanks for help. You are right, forgot to remove old option before setting new one.

Regarding help with maintenance - I'm open, let me know if you would like me to help with anything related to rollup project. ;-)