-
-
Notifications
You must be signed in to change notification settings - Fork 18
Description
This is a request to allow the use of ES module files as config files for posthtml through the CLI.
I currently have some build tools that use similar configuration files to posthtml. I have an ES module, config.mjs, that is shared among them to provide build-time string replacements (some computed) for different build flavors. It would be desirable to be able to use this config.mjs from within my posthtml config, as well (such as for use with posthtml-expressions).
Unfortunately, I can't dynamically (asynchronously) import config.mjs from my CJS posthtml.config.js. I tried converting posthtml.config.js to an ES module as well, but even explicitly declaring it with the -c
option, the CLI gives:
Error: No loader specified for extension ".mjs"
If posthtml-cli could resolve posthtml.config.mjs, then existing ES modules could be leveraged by configurations using posthtml-cli.