guybedford / chomp

'JS Make' - parallel task runner for the frontend ecosystem with a JS extension system.
https://chompbuild.com
Apache License 2.0
143 stars 7 forks source link

Named environments #3

Closed guybedford closed 2 years ago

guybedford commented 2 years ago

Currently we support a global [env] which permits global env options (alongside local env options per-task).

It would be beneficial to support global named environments like [env.default], [env.development] and [env.production] then to have a --env=development flag that can be passed to vary the global environment.

This means replacing the global [env] with [env.default]. Per-task we may want the ability to split on environment as well in which case the same should also happen to tasks.

[env.default] should always be treated as extended by the current environment I think.

guybedford commented 2 years ago

Implemented in https://github.com/guybedford/chomp/commit/07c5d14e654b5eeda8e77c67cefab3bc13ec5ef1.

guybedford commented 2 years ago

Reverted as this obviously messes with the concept of having uniquely defined builds! The better pattern is to simply separate build:dev from build:production. Duplication of task internals is exactly what templates are for.