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
Is your feature request related to a problem? Please describe.
To conditionally add plugins, && syntax is useful and this works in vite as well:
exportdefault{plugins: [condition&&SomePlugin()]}
It errors because the schema is too strict:
[webpack-cli] Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
- configuration.plugins[4] should be one of these:
object { apply, … } | function
-> Plugin of type object or instanceof Function.
Details:
* configuration.plugins[4] should be an object:
object { apply, … }
-> Plugin instance.
* configuration.plugins[4] should be an instance of function.
-> Function acting as plugin.
Describe the solution you'd like
Accept undefined and null values in plugins array, and just ignore them.
Is your feature request related to a problem? Please describe.
To conditionally add plugins,
&&
syntax is useful and this works in vite as well:It errors because the schema is too strict:
Describe the solution you'd like
Accept
undefined
andnull
values inplugins
array, and just ignore them.Describe alternatives you've considered
This works, but is clumsy:
The text was updated successfully, but these errors were encountered: