posthtml / posthtml-cli

CLI for PostHTML
MIT License
29 stars 18 forks source link

`posthtml` fails without config. #337

Closed alanorozco closed 3 years ago

alanorozco commented 3 years ago

With any of these commands:

posthtml
posthtml -- foo.html

I get this error:

...

TypeError: Cannot destructure property 'config' of 'explorer.search(...)' as it is null.
    at _default (/.../lib/node_modules/posthtml-cli/lib/cfg-resolve.js:7:42)
    ...

By pointing to an empty config file ({}), these work just fine:

posthtml -c config.json
posthtml -c config.json -- foo.html

Since an empty configuration file fixes the issue, the tool could also use the default config when -c is absent.