General developer forum

Subdirectories are not supported for AMD modules?

 
Picture of André Storhaug
Subdirectories are not supported for AMD modules?
 

Hi!

I am currently developing a question type plugin that relies heavily on JavaScript AMD modules.

I have a problem where i need to include an external javascript AMD library i have created. The docs says to place the library in the custom theme dir, or plugin dir. However, i do wish to include this within the plugin itself. The only problem is that the library is divided up into multiple subdirectories (which is kind of the reason to use AMD). I woud like to just include the library under amd/src/lib, but i have yet to succeed in doing so.

Is there any way to make this work, without changing the library to a single level file structure?


Regards,

André

 
Average of ratings: -
Picture of Mark Sharp
Re: Subdirectories are not supported for AMD modules?
Core developersParticularly helpful MoodlersPlugin developers

I use a third party AMD plugin in my syntax highlighter filter: https://github.com/sharpchi/moodle-filter_syntaxhighlighter

Basically, I copied the compiled js and put it in amd/src and amd/build

I also added the files to thirdpartylibs.xml so that Moodle wouldn't check them for linting errors.

Hope that helps

Mark

 
Average of ratings: -
Picture of André Storhaug
Re: Subdirectories are not supported for AMD modules?
 

Many thanks.

As it seems that it's not possible to include subfolders, this was the solution i went with.

 
Average of ratings: -