Use npm in local javascript module

Use npm in local javascript module

by Max hi -
Number of replies: 0

Dear Moodle Development Experts,

I wonder if it is possible to use npm to install dependencies in a javascript module within a php plugin. Till now, the used npm packages in the plugin were statically copied to the /amd/build folder (in their .min.js version), but this seems quite hacky to me. Is it possible to init a local npm package with node_modules in a javascript module without the need to modify something in the moodle core, e.g. touching the package.json in Moodle's root directory?

I haven't found anything about this yet, thank you very much in advance!

Best regards,

Max

Average of ratings: Useful (2)