-
Notifications
You must be signed in to change notification settings - Fork 2
/
TODO
50 lines (43 loc) · 2.38 KB
/
TODO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
;; TODO option to append .min.js
;; TODO option to not minify if the gzipped size is not better
The options listed at See http://lisperator.net/uglifyjs/compress are supported.
Additionally, :mangle is supported.
The defaults :
```
{
:sequences true, ; join consecutive statemets with the “comma operator”
:properties true, ; optimize property access: a["foo"] → a.foo
:dead_code true, ; discard unreachable code
:drop_debugger true, ; discard “debugger” statements
:unsafe false, ; some unsafe optimizations
:conditionals true, ; optimize if-s and conditional expressions
:comparisons true, ; optimize comparisons
:evaluate true, ; evaluate constant expressions
:booleans true, ; optimize boolean expressions
:loops true, ; optimize loops
:unused true, ; drop unused variables/functions
:hoist_funs true, ; hoist function declarations
:hoist_vars false, ; hoist variable declarations
:if_return true, ; optimize if-s followed by return/continue
:join_vars true, ; join var declarations
:cascade true, ; try to cascade `right` into `left` in sequences
:side_effects true, ; drop side-effect-free statements
:warnings true, ; warn about potentially dangerous optimizations/code
:global_defs {}, ; global definitions
:mangle false
}
```
# Aims
The final aim is to be the go-to library to shave off some size/obfuscate code in Clojure(Script) apps.
Steps (roughly in that order):
- [ ] support source maps (UglifyJS has support for it)
- [ ] make it faster for big files (use uglify-node if availble? operate on files?)
- [ ] minify HTML directories - see https://github.com/kangax/html-minifier (which minifies html/css/js)
- [ ] benchmark and document output sizes versus the google closure compiler when gzipped on a variety of projects.
- [ ] minify JS files with different compressors (yui/google-closure/rollup etc.) and see if chaining them yields better results (after gzipping).
- [ ] minify CSS files as well - http://goalsmashers.github.io/css-minification-benchmark/
- [ ] minify JARS with proguard?
- [ ] better GZIP with zopfli / 1 - wrapper, see http://www.tricoder.net/blog/?p=197 and http://stackoverflow.com/q/30828079/1327651
- [ ] investigate https://en.wikipedia.org/wiki/SDCH
- [ ] better compress with brotli
- [ ] at any given step, see if some protocol could be implemented