lydell/elm-watch

Add output to postprocess arguments

Closed this issue · 2 comments

I'm migrating from webpack to elm-watch at work.

At the moment in postprocess I"m extracting some css information from the elm code and writing that to a file next to the elm output file. But since the output path is not available in postprocess I'm currently reading the elm-watch.json and looking up the output path through the targetName. This feels very clunky, but works 😅.

Could the output path of the code be added to the postprocess arguments? That would help a lot with our setup.

I've tried/considered other setups for extracting the css information, but at the moment doing it in postprocess seems to be the best approach for us.

and writing that to a file

Postprocess is supposed to be “pure” (without side effects). It can be possible to get away with making side effects in there sometimes, but also beware that multiple instances of the postprocess script can run in parallel and potentially overwrite each other.

So I’m not sure it is a good idea to add the output path.

I’m closing this for now. Feel free to post more if you have something more to say and we might reopen!