Skip to content

-u allows absolute paths, but does not allow relative paths #338

Closed
@alanorozco

Description

@alanorozco

If I want to use a locally defined plugin.js, this fails:

posthtml -u plugin.js -- foo.html
Error: Cannot find module 'plugin.js'
...

Adding local directory prefix ./ (like for require()) also fails:

posthtml -u ./plugin.js -- foo.html
Error: Cannot find module './plugin.js'
...

However, an absolute path works just fine:

posthtml -u /Users/.../plugin.js -- foo.html
The file /Users/.../foo.html has been saved!

Consider resolving the plugin's module joining the fullpath to process.cwd() as a fallback, so that relative paths can work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions