Jump to content

Correct way to work with 3rd-party libraries in plugins?


snugRugBug

Recommended Posts

Posted

I want to use a library I found on Github in one of my plugins, but I am uncertain of the correct way to go about that.

The library is structured as follows:

lib-dir
  ->js-dir
    ->lib.js
  ->img-dir
    ->img1.png
    ->img2.png
    ->img3.png
    -> etc ...

I see that there is a directory called 'dev/resources' in my plugin. I assume that everything should go in there. Correct me if that is the wrong assumption.

So now my question is: how do I reference my library from my template hooks? I really only need to include the lib.js file, but that javascript file then includes the stuff from img-dir, so I don't want to break the established directory structure.

Please share with me the way the creators intended this to work :smile:

Posted

I don't think you can include files with plugins, you have to create an application (that's what I had to do anyhow when I asked the same question). Then just create a "system" folder in your application structure and it will be bundled up when you build the application .tar file.

Posted

I don't think you can include files with plugins, you have to create an application (that's what I had to do anyhow when I asked the same question). Then just create a "system" folder in your application structure and it will be bundled up when you build the application .tar file.

Thanks @AutoltScript . I took a look at the applications, and it seems like a much more viable development platform for the time being. It has everything the plugin system has, plus some more important features, including the resource bundling I want. I do hope that resource bundling becomes part of the plugin packaging soon, though. The whole plugin system seems a little silly without it.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...