You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently there is options hook that allows to customize options passed to rollup.rollup. However there is no hook for customizing options passed to bundle.generate. In some situations there is a need to override some options in plugin.
I hit such case in Comandeer/rollup-plugin-babel-minify#146. The plugin minifies given JS code and outputs banner at its beginning. The content of the banner can be passed directly to the plugin or determined from OutputOptions.banner passed to Rollup. In some rare situations the banner is inserted twice: once by the plugin and then once again by Rollup. The easiest fix for this situation would be to override OutputOptions.banner (so Rollup won't have anything to insert). At the moment is not possible; there is only banner hook, which allows to add new banner, but don't allow deleting the banner altogether.
Other case, also including banner, this time inserted before minification: #2459. Overriding banner option and inserting it by plugin after minification would solve the issue.
Feature Proposal
I propose adding outputOptions hook that will allow to override OutputOptions passed to bundle.generate:
Feature Use Case
Currently there is
options
hook that allows to customize options passed torollup.rollup
. However there is no hook for customizingoptions
passed tobundle.generate
. In some situations there is a need to override some options in plugin.I hit such case in Comandeer/rollup-plugin-babel-minify#146. The plugin minifies given JS code and outputs banner at its beginning. The content of the banner can be passed directly to the plugin or determined from
OutputOptions.banner
passed to Rollup. In some rare situations the banner is inserted twice: once by the plugin and then once again by Rollup. The easiest fix for this situation would be to overrideOutputOptions.banner
(so Rollup won't have anything to insert). At the moment is not possible; there is onlybanner
hook, which allows to add new banner, but don't allow deleting the banner altogether.Other case, also including banner, this time inserted before minification: #2459. Overriding banner option and inserting it by plugin after minification would solve the issue.
Feature Proposal
I propose adding
outputOptions
hook that will allow to overrideOutputOptions
passed tobundle.generate
:It would be used the same way as existing
options
hook.The text was updated successfully, but these errors were encountered: