New features
You may now pass fileExtension
as an Array
and the plugin will look for all matching files with those extensions.
For example:
posthtml([
plugin(
{
fileExtension: ['html', 'md'] // looks for both md-layout.html and md-layout.md
}
)
])
.process('`<x-md-layout>test</x-md-layout>`')
.then(result => result.html)
Note that this is just an example - markdown content isn't parsed, it just reads the file as usual.
This is useful in cases where some components in your project should be sourced directly from files with extensions other than html
(because you can't change them or prefer they'd be left unchanged for further processing).
If both md-layout.html
and md-layout.md
exist in the root
folder, the first fileExtension
match will be used (in this case, md-layout.html
).