Closed
Description
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.