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

Support watching files not yet created #126

Open zachsa opened 2 years ago

zachsa commented 2 years ago

I get this error

thread 'main' panicked at 'Watching files not yet created is not yet supported, in depending on .ssr/index.js. This should be supported, please post an issue on GitHub!', src/task.rs:1335:29

In this case the .ssr/index.js file is created via a Rollup build, the task looks like this:

[[task]]
name = 'rollup:ssr'
deps = ['ssr/**/*.jsx']
run = 'rollup -c rollup/server.config.js'

Since rollup follows imports I run rollup once whenever a jsx file changes. But then in subsequent tasks I have to depend on the name of the task, not the output of the task (.ssr/index.js).

So far as I know... I can't specify to Rollup to just transform a single file to an output. I COULD do this with SWC, but then I don't have flexibility with file extensions

guybedford commented 2 years ago

Yes this is a TODO.

zachsa commented 2 years ago

Actually, this error has been helpful - it's helped me catch errors in my path defs. So I can definitely see that it could be useful, in that the output of one task might not exist, and is the input of another. But I think this should require an explicit flag. Just because in my experience if this was the default I would have not caught errors