Skip to content
This repository has been archived by the owner on Aug 23, 2018. It is now read-only.

elm-make 0.16 creates index.html by default #68

Closed
savuori opened this issue Nov 19, 2015 · 5 comments
Closed

elm-make 0.16 creates index.html by default #68

savuori opened this issue Nov 19, 2015 · 5 comments

Comments

@savuori
Copy link

savuori commented Nov 19, 2015

Using a command elm-make Module.elm used to create only elm.js -file, now it creates an index.html file. If this is intentional it might be worth a mention in the upgrade guide because it causes tools like emacs' compile buffer have new side-effects, like overwriting the index.html.

@doppioslash
Copy link

also, how do we compile a stand-alone js file now? --output=file.js doesn't work.

@igrep
Copy link

igrep commented Dec 3, 2015

Well, I experienced both cases in 0.16.
According to my experience, it creates elm.js in newly created elm project,
but it creates index.html in some existing projects.
It might be caused when index.html is already created.

@twitchard
Copy link

This behavior should be removed. It clobbered my existing index.html and made me lose work. Very off-putting to newbies like me.

@evancz
Copy link
Contributor

evancz commented May 12, 2016

This change was made to accommodate new folks. If someone new to Elm is using elm-make they probably just want the HTML to be set up for them. If they decide the want ports, they will have found docs that explain how to do that with an --output flag.

That is the rationale. I get that there are tradeoffs, but this seems like "the best compromise" for now. Perhaps it makes sense to call it something besides index.html but also kind of doesn't make sense.

@evancz evancz closed this as completed May 12, 2016
@twitchard
Copy link

twitchard commented May 13, 2016

@evancz
I propose the following: suppose elm-make includes an HTML comment somewhere in its output, indicating the file was generated with elm-make. Then, when elm-make detects that it is about to overwrite a file, it checks for that comment. If the comment is present, it overwrites the file without another thought. Otherwise, it warns the user it is going to overwrite a file and prompts for confirmation.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants