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

Feature request - support glob deps in interpolates when dep will always be a single file #139

Closed zachsa closed 2 years ago

zachsa commented 2 years ago

Currently I have a task for generating import maps that is run on changes to an html file:

[[task]]
name = 'jspm:client'
targets = ['.cache/#.html']
deps = [
    'client/html/#.html',
    '.cache'
]
invalidation = 'always'
run = "node jspm-client.js"

I would like to be able to change the location of the html files, so that the deps becomes client/pages/**/#.html. I think this is generally useful (although since this job is always re-run for all html files I can just remove the interpolation from this and discover HTML files manually)

In this case the output of .cache is a rollup build that contains an unknown number of chunks

guybedford commented 2 years ago

What is the reason you cannot just use client/html/##.html as the dep and .cache/##.html as the target?

zachsa commented 2 years ago

Does the double hash find nested HTML files?

guybedford commented 2 years ago

Yes that is what the double interpolate form is for.

zachsa commented 2 years ago

This doesn't work as I want to normalize the output directory to be flat.

guybedford commented 2 years ago

Right, but flattening is by definition a many to one mapping, which cannot be supported in interpolation as interpolation must be fully reversible in its analysis.

zachsa commented 2 years ago

I see - thank you