lydell/elm-watch

Allow custom elm-watch.json location

jamesrweb opened this issue · 4 comments

Thanks for the amazing package, it really is fantastic and I am using it on multiple projects now. A feature request I have is that it would be nice to be able to say something like:

npx elm-watch make --config path/to/my/elm-watch.json --optimize myTarget

It would also be nice if post processing done inside the elm-watch.json was relative to the file so that related configs like build scripts can be collocated to the elm-watch.json itself. Something like:

{
  "postprocess": ["elm-watch-node", "build.js"],
  "targets": {
    "Main": {
      "inputs": ["../../src/Main.elm"],
      "output": "../../build/main.js"
    }
  }
}

In this case build.js would be in the same directory as the elm-watch.json for example.

Hi!

Can you provide more details? I’m very hesitant to configuration or flags so I want to understand use cases very deeply and try to think of alternative solutions before implementing anything.

Usually I have a config directory like here in one of my projects. This keeps the root directory clean and most tools support custom config locations from the root, does that make sense now?

Yes, thank you! Thanks for the suggestion, but I’m going to pass on that one. For me, simplicity > folder cleanliness.

I mean it is a pretty standard cli tool feature and I don't see how it makes things less simple but if that's your choice then it is what it is. Thanks for the tool either way.