Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using elm-live with SPA #156

Open
SimonLab opened this issue Feb 14, 2020 · 0 comments
Open

using elm-live with SPA #156

SimonLab opened this issue Feb 14, 2020 · 0 comments

Comments

@SimonLab
Copy link
Member

elm-live can be used to compile a Elm single page application.
You can install elm-live with npm: npm install -g elm-live and then you'll be able to run the following command:

elm-live src/Main.elm --pushstate -- --output elm.js

the command above will compile the src/Main.elm file.
The documentation (elm-live --help) for the flag --pushstate` is:

Forces the index.html or whatever filename you have passed to the --start-page flag to always be served. Must be used when building with Browser.application. (default: false)

This means that any endpoint of the application will use the same start origin instead of looking for a specific file.

Then all the flags defined after -- are sent directly to elm make instead of elm-live. In our case the Elm application will be compiled to the output file elm.js. By default elm-live compile the application to index.html which means that if you have already an index file it will be overridden.

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

No branches or pull requests

1 participant