{"id":13472639,"url":"https://github.com/wking-io/elm-live","last_synced_at":"2025-05-15T07:06:04.648Z","repository":{"id":2290024,"uuid":"46166473","full_name":"wking-io/elm-live","owner":"wking-io","description":"⚡ A flexible dev server for Elm. Live reload included.","archived":false,"fork":false,"pushed_at":"2022-06-18T15:21:19.000Z","size":2600,"stargazers_count":1056,"open_issues_count":53,"forks_count":60,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-05-08T08:40:33.993Z","etag":null,"topics":["developer-tools","elm","livereload"],"latest_commit_sha":null,"homepage":"https://elm-live.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wking-io.png","metadata":{"files":{"readme":"Readme.md","changelog":"Changelog.yaml","contributing":"Contributing.md","funding":null,"license":"License.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-14T07:52:47.000Z","updated_at":"2025-04-15T09:02:50.000Z","dependencies_parsed_at":"2022-08-31T07:40:41.185Z","dependency_job_id":null,"html_url":"https://github.com/wking-io/elm-live","commit_stats":null,"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wking-io%2Felm-live","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wking-io%2Felm-live/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wking-io%2Felm-live/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wking-io%2Felm-live/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wking-io","download_url":"https://codeload.github.com/wking-io/elm-live/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253418958,"owners_count":21905334,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["developer-tools","elm","livereload"],"created_at":"2024-07-31T16:00:56.539Z","updated_at":"2025-05-15T07:05:59.606Z","avatar_url":"https://github.com/wking-io.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Boilerplates"],"sub_categories":["Individual Podcast episodes"],"readme":"\u003cimg alt=\"elm-live\" src=\"./elm-live-logo.png\" width=\"100%\" height=\"auto\" /\u003e\n\n[![Netlify Status](https://api.netlify.com/api/v1/badges/24d05688-7775-4ce8-86fa-c071d7ae909a/deploy-status)](https://app.netlify.com/sites/elm-live/deploys)\n\n# elm-live | A flexible dev server for Elm. Live reload included.\n\n**New Version Available**\n\nThanks to the help of @lucamug and others a new version of elm-live is available! With the following changes:\n\n* Hot reloading\n* Local SSL\n* No reload mode\n* No server mode\n* Removed before and after build commands. If you used these and cannot imagine using elm-live without them make an issue and let's discuss!\n* and more!\n\n\u003cp align=\"center\"\u003e\u003cimg\n  alt=\"Screencast\"\n  src=\"https://cdn.rawgit.com/wking-io/elm-live/b990094/screencast.gif\"\n  title=\"Sweet, isn’t it?\"\n  width=\"405\"\n/\u003e\u003c/p\u003e\n\n## INSTALLATION\n\nTo use the new version of elm-live while it is in alpha you can run one of the following commands:\n\n```sh\n# Globally for a user:\nnpm install --global elm elm-live@next\n\n# …or locally for a project:\nnpm install --save-dev elm elm-live@next\n```\n\nOtherwise, to use the latest stable version:\n\n```sh\n# Globally for a user:\nnpm install --global elm elm-live\n\n# …or locally for a project:\nnpm install --save-dev elm elm-live\n```\n\n### If you are using Elm 0.18\n\n```sh\n# Globally for a user:\nnpm install --global elm elm-live@prev\n\n# …or locally for a project:\nnpm install --save-dev elm elm-live@prev\n```\n\nIf you’d rather bring your own global `elm`, `npm install --global elm-live` will do.\n\n## Version Compatibility\n\n| Node Version   | elm-live Tag Version  |\n| -------------- | --------------------- |\n| 4              | \u003c= v2.6.1             |\n| 6              | \u003e= v2.6.2 \u0026\u0026 \u003c v4.0.0 |\n| 10             | \u003e= v4.0.0             |\n\n## SYNOPSIS\n\n```sh\nelm-live [...\u003coptions\u003e] [--] ...\u003celm make args\u003e  \nelm-live --help\n```\n\n## DESCRIPTION\n\nFirst, we spawn `elm make` with the `elm make args` you’ve given.\n\nWhen the build is ready, we start a static HTTP server in the current directory. We inject a _live reload_ snippet into every HTML file we serve. Every time a static file has changed, we’ll reload your app in all browsers you’ve opened it with. (Mobile and IE included!)\n\nWe also watch all `*.elm` files in the current directory and its subdirectories. Whenever you change, add or remove one of them, we’ll rebuild your program and reload the page.\n\n## OPTIONS\n\n#### `-e, --path-to-elm=PATH`\nAn absolute or relative path to `elm`. If you’ve installed _elm-platform_ locally with _npm_ (`npm install --save-dev elm`), you’ll likely want to set this to `node_modules/.bin/elm`. Default: `elm`.\n\n#### `-p, --port=PORT`\nSet the port to start the server at. If the port is taken, we’ll use the next available one. `PORT` should be a valid port number. Default: `8000`.\n\n#### `-h, --host=HOST`\nSet the host interface to attach the server to. Default: `localhost`.\n\n#### `-S, --ssl`\nStart an https server instead of http. Default: `false`.\n\n#### `-S, --ssl-cert=PATH`\nPass in a relative path to your own ssl cert. Default: `false`.\n\n#### `-S, --ssl-key=PATH`\nPass in a relative path to your own ssl key. Default: `false`.\n\n#### `-x, --proxy-prefix=PREFIX`\nProxy requests to paths starting with `PREFIX` to another server. Requires `--proxy-host` and should be a string like `/api`. Defaults to not proxying\n\n#### `-y, --proxy-host=HOST`\nProxy requests to another server running at `HOST`. Requires `--proxy-prefix` and should be a full URL, eg. `http://localhost:9000`. Defaults to not proxying\n\n#### `-d, --dir=PATH`\nThe base for static content. Default: `.`.\n\n#### `-s, --start-page=PATH`\nA custom html file to serve other than the default `index.html`.\n\n#### `-u, --pushstate`\nServe `index.html` on 404 errors. This lets us use client-side routing in Elm. For instance, we can have a URL like `http://localhost:8000/account` get handled by the Elm _navigation_ package instead of failing with a 404 error.\n\n#### `-H, --hot`\nTurn on hot module reloading.\n\n#### `-o, --open`\nWe’ll open the app in your default browser as soon as the server is up.\n\n#### `-v, --verbose`\nLog more stuff!\n\n#### `--no-reload`\nTurn off live reload. This means you will need to manual reload your website after each build to see the changes.\n\n#### `--no-server`\nTurn off the server for `elm-live`. This is useful when you are using elm inside of another development ecosystem.\n\n#### `--help`\nYou’re looking at it.\n\n\n\u003ca id=\"/examples\"\u003e\u003c/a\u003e\u0026nbsp;\n\n## EXAMPLES\n\n### Have the compiler generate your index.html for you.\n\nThis command will start the server at https://localhost:8000 and compile your elm code to an index.html file in the folder you are running the command from. Note: the `--open` flag will open the page in the browser for you. \n\n```sh\n$ elm-live src/Main.elm --open\n```\n\n### Use a custom HTML file\n\nThis command tells `elm make` to compile your elm code to a file named `main.js` in the folder you are running the command from. From there you just need to include the script in default file of index.html as shown in the Elm guide here: https://guide.elm-lang.org/interop/\n\n```sh\n$ elm-live src/Main.elm --open -- --output=main.js\n```\n\nTo specify an HTML file other than the default, you can use the `--start-page` flag. This is an easy way to avoid `elm make` accidentally overriding your custom HTML.\n\n```sh\n$ elm-live src/Main.elm --open --start-page=custom.html -- --output=main.js\n```\n\n### Support client-side routing in Elm\n\nThis command tells the server to always serve up the index.html no matter what the URL is. This allows Elm to handle the routing clientside. Note: this option is a must when you are using `Browser.Navigation`\n\n```sh\n$ elm-live src/Main.elm --open --pushstate\n```\n\n### Adding the debugger during dev\n\nAll possible `elm make` flags are available in `elm-live`. You just need to make sure they are passed after `--` in the command. So the command below shows how to turn on the debugger in `elm make`.\n\n```sh\nelm-live src/Main.elm --open -- --debug\n```\n\n## TROUBLESHOOTING\n\n#### I’m seeing a SyntaxError about block-scoped declarations\n\nIf you’re seeing one of these:\n\n```\nSyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode\n```\n\nmake sure you’re running on node 6+. If you can’t upgrade, consider [transpiling](https://github.com/wking-io/elm-live/issues/2#issuecomment-156698732) `source/elm-live.js` to ES5.\n\nBy the way, [yarn](https://github.com/yarnpkg/yarn) should be warning you about installing incompatible packages. To get the same behavior in npm, [set the `engine-strict`](https://docs.npmjs.com/misc/config#engine-strict) flag.\n\n## Original Author\nHuge shoutout to the creator [Tomek Wiszniewski](https://github.com/tomekwi)!\n\n## Current Owner\n[Will King](https://github.com/wking-io)\n\n## CREDITS\n\nMany thanks to [Evan Czaplicki](https://github.com/evancz), the creator of Elm, for the [Elm Compiler](https://github.com/elm/compiler) – the most brilliant language compiler the world has ever seen! Without _elm make_, _elm-live_ would be a car without an engine.\n\nMany thanks to [Matt DesLauriers](https://github.com/mattdesl) for the wonderful [budo](https://github.com/mattdesl/budo). That’s what does the heavy lifting on the static server side.\n\nWarm thanks to our amazing contributors! Credits to [Brian](https://github.com/bdukes) for making Windows support possible, [Kurt](https://github.com/kbsymanz) for allowing a configurable `--host` and [Josh](https://github.com/joshmh) for his work on enabling client-side navigation. Thanks to [Ryan](https://github.com/Ryan1729) batch updates are nice and fast. Kudos to [Mathieu](https://github.com/magopian), [Rémy](https://github.com/natim) and [Nicolas](https://github.com/n1k0) for making the developer experience smoother and to [Gabriel](https://github.com/peacememories) for the `--before-build` option. Many thanks to [Noah](https://github.com/eeue56) for making sure elm-live works smoothly with [elm-test](https://github.com/elm-community/elm-test). Thanks to [Darren](https://github.com/darrensiegel) for finding and fixing the bug with `--port` options on the 3.0.0 release.\n\n## LICENSE\n\n[MIT](https://git.io/elm-live.License) © [Will King](https://github.com/wking-io) \u0026 [Tomek Wiszniewski](https://github.com/tomekwi)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwking-io%2Felm-live","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwking-io%2Felm-live","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwking-io%2Felm-live/lists"}