You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 23, 2018. It is now read-only.
As a build tool for a web technology, elm-make is not just used directly by humans but also by build scripts that combine elm with programs written in other languages.
The current interface is optimized for direct human interaction, which is a fine default but should be overridable for unforeseen use-cases.
Specifically, elm make Main.elm --output=main.js parses the filename given in the --output option, meaning tools can't output to files that do not end in js or html.
Proposal: --format Flag
My proposal is to add a --format flag that would allow you to ignore the filename and declare the intended output format directly.
Currently you would have 2 options: js,html but we can easily add more in the future if needed.
# write js output to main.js
> elm make Main.elm --output=main.js
# writes js output to main
> elm make Main.elm --format=js --output=main
# write js output to main.html
> elm make Main.elm --format=js --output=main.html
This change would be backwards-compatible and wouldn't affect any user not using the feature except in that it makes elm make -h longer.
Use Case: Output to stdout
One non-obvious side effect of this would be to partially solve #39 at least on unix-like systems using /dev/stdout as a filename:
# prints js compilation to stdout
> elm make Main.elm --format=js --output=/dev/stdout
so this would make elm make much easier to use for scripting for the reasons lain out in that issue.
I don't know enough about Windows to say for sure, but from some brief googling it looks like this would not solve #39 for them.
The text was updated successfully, but these errors were encountered:
In implementing this change and trying it out I now see that printing to /dev/stdout would only really work if we add a --silent option that suppresses other printing to stdout.
Looking into that, I see that this would require some changes to elm-package.
Motivation
As a build tool for a web technology,
elm-make
is not just used directly by humans but also by build scripts that combine elm with programs written in other languages.The current interface is optimized for direct human interaction, which is a fine default but should be overridable for unforeseen use-cases.
Specifically,
elm make Main.elm --output=main.js
parses the filename given in the--output
option, meaning tools can't output to files that do not end injs
orhtml
.Proposal:
--format
FlagMy proposal is to add a
--format
flag that would allow you to ignore the filename and declare the intended output format directly.Currently you would have 2 options:
js,html
but we can easily add more in the future if needed.This change would be backwards-compatible and wouldn't affect any user not using the feature except in that it makes
elm make -h
longer.Use Case: Output to stdout
One non-obvious side effect of this would be to partially solve #39 at least on unix-like systems using
/dev/stdout
as a filename:so this would make
elm make
much easier to use for scripting for the reasons lain out in that issue.I don't know enough about Windows to say for sure, but from some brief googling it looks like this would not solve #39 for them.
The text was updated successfully, but these errors were encountered: