Skip to content

How to require a module in plugin? #189

@nobody4t

Description

@nobody4t

I have been stuck here for long.
I want to test my plugin which needs read a config file. When I try to require path, the test will not be not invoked at all. As I tested a lot, finally I found it is the issue of require.

As usual, my script resides in www/ and I try to add a package.json file in which I specified the module. But not with any luck. you can find the difference between the following path:
mytest/plugins/cordova-plugin-indysdk/www/: under this path, I got all the module installed in node_modules.
mytest/platforms/ios/www/plugins/cordova-plugin-indysdk/www/ : but under this, I only got my script with no module installed. But code under this path will be executed, right?

Did I miss anything?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions