Hello again,
during Kibana plugin development I came across the following issue:
In the plugin's server part I'd like to use a dependency (currently declared via the plugin's package.json
), which only works under node.js (such as amqplib
). Unfortunately, this causes yarn start
as well as the plugin build to fail as webpack won't find the dependencies transitive net
dependency (that won't work in the browser).
Is the a way to exclude a certain dependency for a plugin's frontend build (via webpack triggered by @kbn/optimizer
from plugin-helper
) and only use it in the backend?
Alternatively, is there a way to amend the webpack configuration used by the optimizer?
Thanks!
Edit: I could probably fork off a backend-only (ui: false
) plugin, which skips the optimizer, but that feels ugly due to the fact that I would have to call the backend-only plugin via HTTP and couldn't provide a JS/TS API (which would again trigger the optimizer)...