Announcement

Collapse
No announcement yet.

Including npm package in extension

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Including npm package in extension

    Hello,

    I'm building an extension for espoCRM using the expocrm/ext-template from Github https://github.com/espocrm/ext-template

    I would like to include this npm package in my extension: https://github.com/bubkoo/html-to-image

    It needs to be installed using npm so I was wandering, how would I go about including this package dependency in my extension?

    The README for ext-template shows how to include a composer package but not an npm package ? Thank you in advance.


  • #2
    Hi,

    There's no functionality for this in ext-template. Consider writing some additional build script that will copy the needed build file from the node_modules to src/client/modules/{your-module}/lib. Or even consider using some bundler to build a UMD for Espo if there's no build shipped with the lib.

    As installing extensions in Espo does not require users to run build in CLI, the trade off it that the extensions should be shipped with pre-bundled 3rd party libs.

    Comment

    Working...
    X