New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why isn't rollup-plugin-node-resolve a builtin feature? #1555
Comments
Two reasons — one philosophical, one practical, neither set in stone: Philosophically, it's because Rollup is essentially a polyfill of sorts for native module loaders in both Node and browsers. In a browser, (This isn't just about 'bare imports' like the On a practical level, it's just much easier to develop software if these concerns are neatly separated out with a good API. Rollup's core is quite large, and everything that stops it getting larger is a good thing. Meanwhile, it's easier to fix bugs and add features (such as There's also a 'where does it lead?' argument — if Rollup supports node resolution by default, should it also convert CommonJS by default (even though some CommonJS modules can't be translated to ESM), or shim the if (typeof process === 'undefined') {
// some code happens
} ...that I consider that kind of implicit behaviour to be a huge footgun. Rollup's goal is to help you make the leanest, fastest-starting bundle possible, and we can't do that while second-guessing your intentions. Hope this clarifies! |
I propose to add a note to the README: #1559 |
For these 2 rollup.config.js files, I can't tell which one ( resolve or node ) to use when: import resolve from 'rollup-plugin-node-resolve'; OR import node solve from 'rollup-plugin-node-resolve'; |
@JerryWiltz This one
|
Hi. I am just curious, what was the reason behind not making rollup-plugin-node-resolve functionality built-in?
I've always found it confusing that I must use node-resolve to bundle my app with a module also bundled with rollup.
The text was updated successfully, but these errors were encountered: