guybedford / chomp

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

Interpolation self-exclusion #133

Closed guybedford closed 2 years ago

guybedford commented 2 years ago

It's useful to use interpolation to define minification:

[[task]]
dep = 'dist/#.js'
target = 'dist/#.min.js'

The problem with the above is that it has recursive behaviour.

To avoid this, we could automatically cause the target pattern to negate the dependency pattern in interpolation.

That is, if the target match matches the dependency glob, we automatically exclude this match set by default.

Seems like it could well be a sensible rule to add.

guybedford commented 2 years ago

We should likely also extend this feature to general interpolation ignore patterns. Basically something like interpolate-ignore = [] where the default is the target space.