Proposition: Add a configuration file
It's could be interesting to add config file to Fornax. I propose to use Toml over yaml because I got a lot of exception when using FsYaml (still trying to understand the reasons). Also, Toml seems better for this kind of usage.
Example of config file:
Exclude = [
"node_modules/",
"packages/"
]
[Style]
type = "sass" # Could by less, css
entry = "main.sass"
output = "bundle.css"
Exclude
Array of path to ignore during Fornax build.
Why ?
Useful when people want to include CSS frameworks (via npm for example).
Current behavior
Read all the folders and build all the files fornax understand (less, sass, etc.)
Compatibility
If the option is not set, we keep the current behavior of Fornax.
Style
- Type: Type of the preprocessor to use
- sass
- less
- css # Should probably not exist see "Compatibility" section
- Entry: Name of the entry file
- Output: Name of the output file
Why ?
In general, when using a preprocessor we have a bunch of files and only one entry point referencing the others. This setting allow this behavior and will improve the build time by fornax. Indeed, fornax will call the preprocessor only for the entry file and not all the files (who are useless).
Current behavior
Call the preprocessor depending on the file extension, and build each of the file found. Take more time than needed, because it's process files that should be processed.
Compatibility
If the option is not set, we keep the current behavior of Fornax.
When people use css
we could forgive to use this settings, as no processor is call. And let the current Fornax behavior.
The config file is optional, and if it does not exist then we keep the current behavior of fornax. Like so, we avoid breaking changes.
I can try to implement this features if you are ok with them.