Skip to content

Running a local plugin using the cli #231

@jestefan-fsl

Description

@jestefan-fsl

I'm currently developing a local Putout plugin and would like to run it across an entire folder (e.g., /src) using the following command:

npx putout src/

From what I understand, declaring a local plugin requires specifying it as a tuple, like this:

plugins: [
  ['new-plugin', require('./putout-plugin-new-plugin')]
]

However, since Putout reads from a .putout.json file, and a JSON file is not able to interpret things like "require", I tried setting the configuration file explicitly using:

PUTOUT_CONFIG_FILE=putout.json.js npx putout src/

Where putout.json.js contains:

module.exports = {
  plugins: [
    ['new-plugin', require('./putout-plugin-new-plugin')]
  ]
};

Despite this, I haven't been able to successfully load the local plugin when running Putout via the CLI.

How can I properly load a local plugin and execute it with the Putout CLI? is this supported?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions