Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
alanorozco opened this issue Jun 10, 2021 · 0 comments
Closed

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

alanorozco opened this issue Jun 10, 2021 · 0 comments
Labels
Milestone

Comments

@alanorozco
Copy link

alanorozco commented Jun 10, 2021

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.

Scrum added a commit that referenced this issue Jun 11, 2021
@Scrum Scrum added the feat label Jun 11, 2021
@Scrum Scrum added this to the 0.10.0 milestone Jun 11, 2021
@Scrum Scrum closed this as completed in 44d877b Jun 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants