Closed jhftrifork closed 9 years ago
(Correction: I used the file extension .htm
. This appears to not be recognised as a valid HTML file extension.)
This is the code in question: https://github.com/elm-lang/elm-make/blob/748d774d9e3ec8d0163652dd3e118544d66370d3/src/Generate.hs#L48
The policy is that if the output
option ends with ".html", we generate HTML output at that path; otherwise, we generate JavaScript output at that path.
I would change this policy to one of these policies:
output
option ends with ".html" or ".htm", we generate HTML output; otherwise, we generate JavaScript output.output
option ends with ".html", we generate HTML output; else if it ends with ".js", we generate JavaScript output; otherwise, we raise an error.content-type
command-line option which can be set to either "html" or "javascript".This will be resolved in the next release. We will only permit files that end with .html
and .js
. If you want other names you can rename the file afterwards.
I installed the latest version of Elm via cabal. When I copy-paste this "hello world" program into a file
Main.elm
and then runas instructed in the README except with a
.htm
extension, I get a file atmain.htm
which looks like:This is JavaScript, not HTML.
It appears that the tool has different behavior depending on the file extension of the filepath passed in the
output
argument. IMO, this behavior difference should be toggled by a separate flag, e.g.--outputtype=html
.