-
-
Notifications
You must be signed in to change notification settings - Fork 419
Rollup: Explicitly set output.exports
#1326
Conversation
|
I'm curious. I don't think I've seen this. Do you know if this only happens with certain version of Rollup or its plugins? |
|
All I did was run |
|
I think this revealed another bug in Sapper's Rollup handling. The warning is supposed to include a link to https://rollupjs.org/guide/en/#outputexports that is not present. Sapper seems to not be printing the |
|
While this works, it might be nicer to maintain consistency with Rollup by doing something more like this: |
|
@benmccann Good call, I've updated the pull request with your suggestion. |
output.exports to 'auto'output.exports
benmccann
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks! lgtm
|
|
||
| const resp = await bundle.generate({ format: 'cjs' }); | ||
| const { code } = resp.output ? resp.output[0] : resp; | ||
| const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this now making a new assumption about what version of Rollup you're using? E.g., does this now only work with Rollup >=1? If so, this would be a breaking change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good thing to check. This still works with Rollup 1 though. I just tested against the realworld sample app rewound back a few commits to when it was using Rollup 1.15.1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I would consider this a breaking change though if this now only works with Rollup 1+. I don't know that the required peer dependency is officially documented anywhere - but this code was specifically here to support both < 1 and >= 1 (added by me in #541).
This seems like a reasonable breaking change to make, however, as Rollup 1 is now relatively old. If so, this should probably be lumped together with some other less-jarring but still-breaking changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I missed that you said >= 1 and just assumed you meant > 1 since 0.x is so old now
So I went back to sveltejs/realworld@0c1c672 and ran it as-is without this change and it worked, but it was relying on an old version of Sapper. Then I upgraded it to the latest version of Sapper (still without this change) and got Error: Cannot find module 'svelte/compiler', so I think we may have broken Rollup 0.x support awhile ago
In either case, I'd be a proponent of merging the other breaking changes that are pending and making the next release 0.28.0
Currently, when running a freshly installed Sapper project with Rollup, the following message is displayed:
This pull request explicitly sets
output.exportsto get rid of the above message.