Skip to content

Commit 19cab04

Browse files
author
Richard Feldman
committed
Update README.md
1 parent 3aa21a1 commit 19cab04

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ![RealWorld Example App](https://cloud.githubusercontent.com/assets/556934/25448178/3e7dc5c0-2a7d-11e7-8069-06da5169dae6.png)
22

3-
👉 I gave [a talk](https://www.youtube.com/watch?v=x1FU3e0sT1I),
3+
👉 I gave [a talk](https://www.youtube.com/watch?v=x1FU3e0sT1I)
44
to explain the principles I used to build this. I highly recommend watching it!
55

66
> [Elm](http://elm-lang.org) codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the [RealWorld](https://github.com/gothinkster/realworld-example-apps) spec and API.
@@ -19,11 +19,11 @@ Check out [the full writeup](https://dev.to/rtfeldman/tour-of-an-open-source-elm
1919

2020
# Building
2121

22-
I decided not to include a build sccript, since all you need for local development is the `elm` executable, and all you need on top of that for production is Uglify.
22+
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.
2323

2424
## Development Build
2525

26-
Here's how to do a development build:
26+
[Install Elm](https://guide.elm-lang.org/install.html) (e.g. with `npm install --global elm`), then from the root project directory, run this:
2727

2828
```
2929
$ elm make src/Main.elm --output elm.js
@@ -35,17 +35,19 @@ If you want to include the time-traveling debugger, add `--debug` like so:
3535
$ elm make src/Main.elm --output elm.js --debug
3636
```
3737

38+
To view the site in a browser, bring up `index.html` from any local HTTP server, for example [`http-server`](https://www.npmjs.com/package/http-server).
39+
3840
## Production Build
3941

40-
This is a two-step process. First we compile `elm.js` using `elm make` with `--optimize`, and then we run Uglify on the result.
42+
This is a two-step process. First we compile `elm.js` using `elm make` with `--optimize`, and then we Uglify the result.
4143

4244
#### Step 1
4345

4446
```
4547
$ elm make src/Main.elm --output elm.js --optimize
4648
```
4749

48-
This generates production-optimized JS that is ready to be minified further using Uglify.
50+
This [generates production-optimized JS](https://elm-lang.org/blog/small-assets-without-the-headache) that is ready to be minified further using Uglify.
4951

5052
#### Step 2
5153

@@ -55,4 +57,6 @@ This generates production-optimized JS that is ready to be minified further usin
5557
$ uglifyjs elm.js --compress 'pure_funcs="F2,F3,F4,F5,F6,F7,F8,F9,A2,A3,A4,A5,A6,A7,A8,A9",pure_getters=true,keep_fargs=false,unsafe_comps=true,unsafe=true' --output=elm.js && uglifyjs elm.js --mangle --output=elm.js
5658
```
5759

58-
This runs `uglifyjs` twice - first with `--compress` and then again with `--mangle`. It's necessay to do separate passes if you use `pure_funcs` with Uglify, because if you do 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).
60+
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`.
61+
62+
> It's necessay to do separate passes if you use `pure_funcs` with Uglify, because if you do 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).

0 commit comments

Comments
 (0)