@Scrum with my previous PR the declaration order of the plugin is now stable. Would you accept a new PR to add a config file option to configure whether config.plugins are registered before or after plugins enabled via CLI?
For example, given the following CLI invokation:
posthtml index.html -u posthtml-plugin-foo -c posthtml.config.js
And posthtml.config.js:
module.exports = {
plugins: {
priority: 'high', // default to 'normal' to preserve the current behavior
...
}
}
It applies the plugins from the config file first and then the ones passed as CLI arguments.
My use case is the following: I am building a CLI that wraps posthtml-cli. When I call posthtml-cli I pass some default plugins via CLI arguments along with the rest of the original args. Since users can pass --config posthtml.config.js my plugins will always run first whereas in many cases it'd be better to run them at the end.
Happy to submit a PR if you like this idea.
@Scrum with my previous PR the declaration order of the plugin is now stable. Would you accept a new PR to add a
configfile option to configure whetherconfig.pluginsare registered before or after plugins enabled via CLI?For example, given the following CLI invokation:
And
posthtml.config.js:It applies the plugins from the config file first and then the ones passed as CLI arguments.
My use case is the following: I am building a CLI that wraps posthtml-cli. When I call posthtml-cli I pass some default plugins via CLI arguments along with the rest of the original args. Since users can pass
--config posthtml.config.jsmy plugins will always run first whereas in many cases it'd be better to run them at the end.Happy to submit a PR if you like this idea.