I have succeeded in sharing components (client-code) between plugins (at How to share components among Kibana plugins?).
I assumed that there must the similar way to share server code, but no luck.
I exported things of
server/index.ts. Then from other plugins, I use
import * as commons from 'plugins/plugin_commons'
It won't work and will throw error
FATAL Error: Cannot find module 'plugins/plugin_commons'
How can I get it work? Thanks.