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
Copy file name to clipboardExpand all lines: README.md
+10-6Lines changed: 10 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# 
2
2
3
-
👉 I gave [a talk](https://www.youtube.com/watch?v=x1FU3e0sT1I),
3
+
👉 I gave [a talk](https://www.youtube.com/watch?v=x1FU3e0sT1I)
4
4
to explain the principles I used to build this. I highly recommend watching it!
5
5
6
6
> [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
19
19
20
20
# Building
21
21
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.
23
23
24
24
## Development Build
25
25
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:
27
27
28
28
```
29
29
$ 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:
35
35
$ elm make src/Main.elm --output elm.js --debug
36
36
```
37
37
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
+
38
40
## Production Build
39
41
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.
41
43
42
44
#### Step 1
43
45
44
46
```
45
47
$ elm make src/Main.elm --output elm.js --optimize
46
48
```
47
49
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.
49
51
50
52
#### Step 2
51
53
@@ -55,4 +57,6 @@ This generates production-optimized JS that is ready to be minified further usin
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