-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Give better insight in what is going on #1215
Comments
Yeah, a verbose mode would be quite useful:
|
I did slap together a simple plugin that tries to report on files being bundled and their sizes that works directly w/ the rollup plugin API. It's not nearly as thorough as what is being proposed here but it's something. https://github.com/danvk/source-map-explorer uses the sourcemaps to let you visually inspect the contents of the output bundles and is super-cool as well. |
@tivac Thanks for the source-map-explorer link - it's fantastic: |
This is all good feedback, thanks. Some of this stuff is definitely on the roadmap — see for for example
Getting plugins to co-ordinate is a very hard problem. To handle that specific case, we'd basically need to add an API that allowed plugins to dictate which extensions were supported and that would allow other plugins to tap into that configuration. Doable, but I think it's a bad idea — I've always said that at some point we should disable support for extensionless imports (obviously plugins like
This is cheating, but I'll often do this sort of thing: // rollup.config.js
export default {
plugins: [
thisPlugin(),
{
transform ( code, id ) {
console.log( id );
console.log( code );
// not returning anything, so doesn't affect bundle
}
},
thatPlugin()
],
// other options
} Would be easy enough to create a rollup-plugin-tee that did that in a slightly neater way, optionally writing to a file etc. |
Maybe this would help. I created some time ago plugin for myself to see what is taking space in bundles. |
This is not a specific bug or feature request, but hopefully more of a discussion point. I've had serious day-long fights with getting rollup to behave the way I wanted, and ultimately ended up with a custom debug build littered with
console.log
only to get an idea of what the hell is going on.There are, I believe, a number of reasons for this:
The architecture of rollup is hard to grasp from the wiki or even the source code. In fact, I still don't understand fully why/how/when data is flowing through the different parts and/or plugins.
A "plugin" in the context of rollup can mean a lot of different things and they are often not composable (try using
includepaths
withnode-resolve
). Reasoning about plugin ordering is bizarre (node-resolve
andtypescript
, in which order? Apparently.ts
needs to be added asextension
fornode-resolve
when used together -- why?)Sometimes plugins aren't just very usable (
typescript
comes to mind, it just doesn't really work with error reporting -- the primary reason a lot of people use typescript to begin with).Plugins are of questionable code quality - they seem slapped together by some crazy copy/pasting, are scarcely commented and often have insane dependencies (
file-as-blob
imports the entire imagemagick hell just to check for a magic byte the start of a resource).In the NPM ecosystem today, developers really like to add 10 dependencies instead of adding 10 lines to their code. For
rollup
this means there's a lot of work to do, but in my opinion lacks the proper tools to figure out why my output file has suddenly ballooned to 1m lines (ah,lodash
is apparently included, why?).I could imagine that adding better tooling (verbose logging, dependency graph output, see what a plugin is doing) in rollup would be very welcome in the js ecosystem today and make developing for it a lot more bearable.
The text was updated successfully, but these errors were encountered: