Right now, virtually everything that Grit.js does happens before or during the rendering process.
However, there are a number of things that could/should happen after rendering and it would be extremely useful if Grits could do some of them.
Most post processing operations could be included in various Grits plugins, but some of the more fundamental operations could be embedded directly into Grits core.
Configuration:
Of course, post processing operations could be configured in the usual ways, like through the Grits config file, and via CLI options (see also #12).
I was also thinking about a novel way of allowing certain types of operations to be configured by using "placeholder" files that grits will recognize as being post-processing configs and then execute them at the end of rendering ops (when applicable).
As an example, consider JS concatenation and minification.
The user would create a new config file (YAML, JSON, or TOML) such as...
.. and grits would then know to execute the post processor whenever the include pattern(s) match a file that Grits renders or copies. It also knows that the output for the post processing op should be placed at /dist/js/main.js.
The naming syntax for the placeholder files still need more consideration, since I am not thrilled about how that js_.yaml example, above, looks, but I think the concept is reasonably sound.
Post-Processing Operation Examples:
Concatenating, minifying, and/or obfuscating JS, CSS, and others.. (core?)
Right now, virtually everything that Grit.js does happens before or during the rendering process.
However, there are a number of things that could/should happen after rendering and it would be extremely useful if Grits could do some of them.
Most post processing operations could be included in various Grits plugins, but some of the more fundamental operations could be embedded directly into Grits core.
Configuration:
Of course, post processing operations could be configured in the usual ways, like through the Grits config file, and via CLI options (see also #12).
I was also thinking about a novel way of allowing certain types of operations to be configured by using "placeholder" files that grits will recognize as being post-processing configs and then execute them at the end of rendering ops (when applicable).
As an example, consider JS concatenation and minification.
The user would create a new config file (YAML, JSON, or TOML) such as...
/src/content/js/main.js_.yaml
.. and grits would then know to execute the post processor whenever the
include
pattern(s) match a file that Grits renders or copies. It also knows that theoutput
for the post processing op should be placed at/dist/js/main.js
.The naming syntax for the placeholder files still need more consideration, since I am not thrilled about how that
js_.yaml
example, above, looks, but I think the concept is reasonably sound.Post-Processing Operation Examples: