Skip to content
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

Retrieve plugin config from rollup config file? #461

Closed
YonatanKra opened this issue Jul 23, 2023 · 1 comment
Closed

Retrieve plugin config from rollup config file? #461

YonatanKra opened this issue Jul 23, 2023 · 1 comment
Labels
kind: question This is a usage or similar question scope: downstream Issue in a downstream library, not in this library itself scope: integration Related to an integration, not necessarily to core (but could influence core) scope: upstream Issue in upstream dependency

Comments

@YonatanKra
Copy link

YonatanKra commented Jul 23, 2023

I'm using a 3rd party library that generates the config for me like this:

module.exports = function setVividRollupConfig(config) {
   const rpt2 = config.plugins.find(plugin => plugin.name === 'rpt2');
}

I want to use the plugin, but change only one option.
Do I need to recreate the plugin? Or is there a way to change only one property in the configuration?
Thanks!

@agilgur5 agilgur5 changed the title Is there a way to retrieve plugin config in rollup config file? Retrieve plugin config from rollup config file? Jul 23, 2023
@agilgur5 agilgur5 added kind: question This is a usage or similar question scope: upstream Issue in upstream dependency scope: integration Related to an integration, not necessarily to core (but could influence core) scope: downstream Issue in a downstream library, not in this library itself labels Jul 23, 2023
@agilgur5
Copy link
Collaborator

agilgur5 commented Jul 23, 2023

This is a question for the library you mention or Rollup, not rpt2 as it is not specific to rpt2 (this question applies to any plugin or configuration).

That being said, having maintained a wrapper library in the past (I was the longest solo maintainer of TSDX), I can tell you the answer to that is no.
Plugins are functions and plugin config is a function argument. You cannot retrieve an argument of a function from outside of it or without a reference.

As such, if you are the maintainer of such a wrapper library and allow such overrides, it may make sense to export each plugin's config so that users can do plugin config merging. See also jaredpalmer/tsdx#635

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: question This is a usage or similar question scope: downstream Issue in a downstream library, not in this library itself scope: integration Related to an integration, not necessarily to core (but could influence core) scope: upstream Issue in upstream dependency
Projects
None yet
Development

No branches or pull requests

2 participants