-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
Support dynamic libraries LibrariesOptions #325
Comments
Hey @carmelc,
That's my worry. For such a simple task it feels like we should provide a way achieving it by using CLI as well instead of forcing everyone to use js-based config file. As an extension later we can introduce a function-based approach if there would be a need for that.
I'd prefer this approach, but I'm not sure if we need to restrict this anyhow i.e. allow to specify namespace-based values only ( Feel free to create a PR if you have a solution, we can discuss it there too. |
Hi @timocov, thanks for the detailed reply, |
Agreed, but the caveat is (maybe it is just my perceptive tho) - I can't imagine running rollup without a config file, while from I've seen running
I understood that, my worry is that this would be the first time when this difference would take the place, and if we can avoid that without ruining possible DX it would be much better IMO. |
Understood, your call, if you prefer not to create such divergence from the current approach then I will not add it, if you decide to allow it, I will create the PR, |
Hi,
Currently the ability to define
LibrariesOptions
is static, you can defineinlinedLibraries
,importedLibraries
andallowedTypesLibraries
as static array of strings,If I want all libraries under an organization (namespace) to be inlined, I would need to maintain a huge list of possible libraries (I can see that if
inlinedLibraries
is not provided it is defaulted to[]
), so by default none are inlinedI was thinking about allowing each of these to be a string array (as today) or a method, and if it is a method the logic of
isLibraryAllowed
would check if the type is a function and if so would invoke the callback with the name of the library in question allowing the user to implement custom logic.Obviously I can hack it around by using:
But this is obviously not recommended :)
This would only work in javascript-based configuration and not in the command line,
We can also consider a regex instead of string equality but I believe allowing the user to implement their logic as code is better.
What do you think? if you are fine with such an approach I don't mind creating the PR for it
The text was updated successfully, but these errors were encountered: