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
This codebase was created to demonstrate a fully fledged fullstack application built with Elm including CRUD operations, authentication, routing, pagination, and more.
For more information on how this works with other frontends/backends, head over to the RealWorld repo.
I decided not to include a build script, since all you need for a development build is the elm executable, and all you need on top of that for production is Uglify.
Development Build
Install Elm (e.g. with npm install --global elm), then from the root project directory, run this:
$ elm make src/Main.elm --output elm.js
If you want to include the time-traveling debugger, add --debug like so:
$ elm make src/Main.elm --output elm.js --debug
To view the site in a browser, bring up index.html from any local HTTP server, for example http-server.
Production Build
This is a two-step process. First we compile elm.js using elm make with --optimize, and then we Uglify the result.
Step 1
$ elm make src/Main.elm --output elm.js --optimize
This one lengthy command (make sure to scroll horizontally to get all of it if you're copy/pasting!) runs uglifyjs twice - first with --compress and then again with --mangle.
It's necessary to run Uglify twice if you use the pure_funcs flag, because if you enable both --compress and --mangle at the same time, the pure_funcs argument will have no effect; Uglify will mangle the names first and then not recognize them when it encounters those functions later.