Will custom modules work in a sub folder?

Hi all,

Creating a set of custom modules for the Twilio Conversations SDK, and i’d like to group them in a sub folder within the server_connect > modules folder, so it would be server_connect > modules > conversations as the folder structure.

Does anyone know if this will work, or if I’d be better off naming the JS and HJSON files to better distinguish them.

Thanks

I took a quick look at the source-code of a Wappler NodeJS app, I don’t think subfolders will work…

For those wondering what I did, I searched in all files for “server_connect/modules” and found this in app.js:

        if (steps.action) {
            try {
                let module;

                if (fs.existsSync(`extensions/server_connect/modules/${steps.module}.js`)) {
                    module = require(`../../extensions/server_connect/modules/${steps.module}`);
                } else if (fs.existsSync(`lib/modules/${steps.module}.js`)) {
                    module = require(`../modules/${steps.module}`);
                } else {
                    throw new Error(`Module ${steps.module} doesn't exist`);
                }
// (...)

My interpretation of the code leads me to believe subfolders won’t work

Thank you @Apple much appreciated- I’ll go with the renaming approach. It would be ideal if sub folders were supported as the extensions ecosystem (hopefully) grows