Open Krinkle opened 3 months ago
When using these two plugins, @rollup/node-resolve
should typically be placed before @rollup/commonjs
in the plugin list. This is because the node-resolve plugin primarily helps Rollup locate and bundle modules from node_modules, while the commonjs plugin is used to convert CommonJS modules into ES6 modules.
Placing node-resolve first ensures that all module paths are correctly resolved before converting CommonJS modules. This order can often prevent issues related to unresolved paths when handling certain modules. Therefore, the recommended plugin order is:
This sequence helps ensure that the modules used in your project can be correctly resolved and transformed.
@rollup/commonjs
,@rollup/node-resolve
Documentation Is: Confusing.
Please Explain in Detail...
Vs
As an inexperienced user of Rollup, the difference is distracting and giving me reason to be uncertain, thinking that perhaps one of them is wrong or that I'll expose myself to some subtle bug if I do it wrong, or worse, that both are right for different use cases (hoping that's not the case!).
Your Proposal for Changes
If both behave the same, pick one and recommend it the same way in both. If one has issues, pick the other one. If both have merit, pick the same one to recommend by default in both packages, and document why/when to deviate.