Closed litzebauer closed 7 years ago
As far as I know, there's really not an easier way, that I know of, to do this. If you look around at other projects, you'll see all of the libraries doing something similar; for example, here's the Material team explicitly listing their globals and then using them to generate their externals.
I'd like to do something similar to this in the rollup script, but I'm not sure if the approach will screw anything up.
It is cumbersome, I agree. But I'm not sure that there's a less cumbersome answer at the moment...
Hmm, I can see this becoming a problem for people not as well versed in rollup working on libraries and forgetting to modify that config.
On Mon, Sep 11, 2017, 9:48 AM Matt Fehskens notifications@github.com wrote:
As far as I know, there's really not an easier way, that I know of, to do this. If you look around at other projects, you'll see all of the libraries doing something similar; for example, here's the Material team explicitly listing their globals https://github.com/angular/material2/blob/4168fb39db770c977bb2bf36336de6b05d38ef9f/tools/package-tools/rollup-globals.ts#L16 and then using them to generate their externals https://github.com/angular/material2/blob/4168fb39db770c977bb2bf36336de6b05d38ef9f/tools/package-tools/rollup-helpers.ts#L41 .
I'd like to do something similar to this in the rollup script https://github.com/gonzofish/angular-librarian/blob/master/commands/initial/templates/tasks/rollup.js#L115, but I'm not sure if the approach will screw anything up.
It is cumbersome, I agree. But I'm not sure that there's a less cumbersome answer at the moment...
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gonzofish/angular-librarian/issues/72#issuecomment-328534489, or mute the thread https://github.com/notifications/unsubscribe-auth/ABLc631GTKqaRWYPGQgcYBLgvM3rBKgKks5shTougaJpZM4PTGiP .
I get what you're saying and I can add some support docs for helping mitigate common issues. But it really is a necessary part of the build process.
Maybe a postinstall hook that outputs a warning to update the rollup config if you are adding a 3rd party dependency.
On Mon, Sep 11, 2017, 10:08 AM Matt Fehskens notifications@github.com wrote:
I get what you're saying and I can add some support docs for helping mitigate common issues. But it really is a necessary part of the build process.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gonzofish/angular-librarian/issues/72#issuecomment-328540412, or mute the thread https://github.com/notifications/unsubscribe-auth/ABLc68rLu1kitf94XFzGzHQDfuutaSrsks5shT7agaJpZM4PTGiP .
Not a bad idea...PR 😄?
sure
On Mon, Sep 11, 2017 at 10:41 AM Matt Fehskens notifications@github.com wrote:
Not a bad idea...PR 😄?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gonzofish/angular-librarian/issues/72#issuecomment-328550981, or mute the thread https://github.com/notifications/unsubscribe-auth/ABLc62kakLZ0djILbyX0EVa9Pxwrs6YIks5shUacgaJpZM4PTGiP .
I updated the list with the huge list of defaults from ng-packagr via 95eb2bf
Is it possible to handle Rollup external and globals better in the config? Explicitly having to call out each external dependency is cumbersome. Could the script dynamically read from package.json dependencies? Or is there a different way to handle it in Rollup?